Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the best and most comprehencive SOAP library available with relation to querying not serving

Tags:

java

soap

My google-fu is not turning up very promising results for a SOAP library in java, mostly they are for setting up SOAP services where as I need to communicate WITH such a service.

I realise that SOAP is just a matter of building and parsing XML but ideally I would like object mapping and handling done transparently.

So far I have looked at Apache Axis and X-Fire (now Apache CXF) and both seem to deal more with serving SOAP services than actually working with SOAP services.

Could anyone guide me to any gems for dealing with SOAP or have personal experience dealing with SOAP services in Java.

like image 289
BjornS Avatar asked Jan 03 '11 15:01

BjornS


People also ask

What are the two most popular forms of messaging used with SOAP?

There are two common types of encoding used in SOAP messaging: SOAP encoding as described in Section 5 of the SOAP 1.1 specification, and Literal encoding.

What is the difference between SOAP enabled services and REST services which one is preferred and why?

REST allows a greater variety of data formats, whereas SOAP only allows XML. Coupled with JSON (which typically works better with data and offers faster parsing), REST is generally considered easier to work with. Thanks to JSON, REST offers better support for browser clients.

Is REST better than RPC?

The most fundamental difference between RPC and REST is that RPC was designed for actions, while REST is resource-centric. RPC executes procedures and commands with ease. Alternatively, REST is ideal for domain modeling and handling large quantities of data.

Which transport protocol is used by SOAP in most cases?

In most cases, web services are implemented using SOAP/HTTP as a transport protocol.


2 Answers

The frameworks you mention do produce client code.
E.g. for CXF How-to-create-client
They do not only deploy a web service.They provide client code to consume it as well!
The idea is that you run the corresponding automatic tool (wsdl2java for CXF or wsimport shipped with Java for jax-ws) to parse the service's WSDL and the client stubs and required artifacts to communicate with the web service will be created.
Then in your code you use the client stubs to communicate with the web service while the marshall/demarshalling from XML to java types is handled transparently by the framework.
There is also JAX-WS you can look into and if you want something simple you can use SAAJ to send soap messages directly to the web service endpoint.
In the frameworks you mention you should look into the parts that refer to client stub generation and consuming web services

like image 165
Cratylus Avatar answered Nov 15 '22 15:11

Cratylus


For querying a SOAP service, you can use an implementation of the JAX-WS standard such as Project Kenai or the default version included in JDK 6+.

This article shows a sample of setting up a SOAP client (as opposed to a server) using the standard. Given a WSDL, you should be able to use standard tools for your client. This is another example.

like image 36
justkt Avatar answered Nov 15 '22 17:11

justkt