java web app calling a web service client (in cxf) - java

I need a very performant and scalable solution to calling web services from java webapp.
Could someone please suggest the best options for calling webservices from java webapp?
Much appreciated

If you are using a restful web service, there are a lot of client libraries which you can choose. Eg. RestEasy Client, Jersey Client,....

Related

How to write Java RESTful Based Axis2 Web Service

I was reading a lot of information on the Internet, I promise, but I didn't find any post or tutorial in which appears How to write Java RESTful Based Axis2 Web Service
I don't know if this task has sense, because I have only read about RESTful Web Services or Web Services based on Axis2. It could be I have mixing differents ideas about how to develop Web Services and so, I need help. What can I do?
Where can I learn how to develop a RESTful Web Service based on Axis2?
You can't write a RESTful Web Service using Axis2. Axis2 is suited for SOAP web services.
For RESTful Web Services you have to use some other framework like Jersey
Edit: it seems you can indeed write a REST WS using Axis2 (yet Axis2 is mostly used for SOAP services).

Test web service on GlassFish or Tomcat

I need to do some performance tests of my web service, in fact it is a simple servlet. I'm using GlassFish 3.1 but i can switch to Tomcat. Could you give some advices and tools names which i can use to do these tests?
We use the open source jmeter tool quite a lot. Here is the project page: http://jmeter.apache.org/
I would recommend SOAP UI as the best tool for testing SOAP web services.
If it's a REST service, you can use any client that can make an HTTP request to a URL. You can use java.net.URLConnection to do that.
I don't see how GLASSFISH or Tomcat matter here. Both have compliant servlet engines.

which is better apache or tomcat apache for webservice of java application..?

I have Used Tomcat Apache to use my java desktop application as a webservice.so is that good option Or i need to use apache server to make my java application as a webservice?
Wht i want is after my webservice made with apachetomcat ..can i call that webservice with wcf or desktop application of .net?
wcf service -> call webservice of java application(using apache tomcat) ->execute java application on server->and return resutl to wcf service
wcf service has function as below
call Javaapplication();
and throught that can i invoke java programm on server?
is it possible?
Apache is an http server. Tomcat is a Java EE environment which includes the ability to function as an http server.
Apache alone won't run your Java application. In many cases, Tomcat will be enough, but in higher-volume situations, you may want to use Apache and Tomcat together.
Other than that, it looks like you need to find a good tutorial on Java EE and Web Services, like, perhaps, this one by Oracle
If you are looking at Apache products, Axis is the tool for web services. And to that, I would look at Axis2. But, I would encourage you to look at the variety of options out there and select the best for you.

Java Web Service for .NET 2.0 Client on Linux (Fedora)

I'm tasked with creating a Java Web Service for a .NET 2.0 client to consume.
What would your suggestions for the implementation be?
The solution doesn't need to be very heavyweight (don't need a full Java EE container I believe) but what do you think is the best solution for this? I have thought about using Glassfish v2 with JAX-WS annotations (#WebService), and JAXB XML Bindings(e.g. #XmlElement), which I assume the .NET client would be able to consume?
Has anyone tried this scenario?
Would Glassfish be overkill though, since I'm merely using the Web Service as a mechanism for .NET on Windows to communicate to the Linux box, the underlying application is extremely small.
Any suggestions are more than welcome :)
Thanks,
James
P.S. Other notes - would you use Axis/CXF instead of Glassfish? Would you use a servlet container such as Tomcat? etc.
I have used Axis2 and it works.
I had the same problem of making Data Exposing API (Web Service in my case) in Java.
I made the web service using Axis2 and Spring (to access database) and the WSDL created via Axis2 was easily consumed via ASP.NET Application via its Add Web Service Dialog Box and the corresponding Proxy Classes were created easily.

Consuming web services with jboss

Can someone point me a good step-by-step tutorial to consuming an already running web service in java?
PS: I tried creating the classes with wsconsume, but it cries with
[ERROR] rpc/encoded wsdls are not supported in JAXWS 2.0. (my web service is rpc/encoded)
If I can consume web services entirely by hand (using no wizards), and understand how is it working, then I'll be happy.
Thanks!
Update: I have found out that rpc web services are not consumed using jbossws, but jboss-jaxrpc, which implements the JAX-RPC specification. I've found a guide for JAX-RPC here, but I'm still looking for other guides that could help.
Apache CXF is the easiest way to get webservices running. Specifically look at the Simple Frontend. The simple front end uses reflection to convert the method/data types to a webservice. It doesn't get much easier than that.
CXF is pretty stable, but does not include all the WS specifications (WS-Eventing for example).
How about the JBossWS website? The details on the client side wsconsume tool are probally what you will look at first.
If you have the WSDL and XSD files, you can use the Axis web-services library to create Java classes that will interact with the services they describe. From the stand-point of this library, you are creating a client application.
You can also consume web services with Spring WS.

Categories