SOAP-dust because SOAP is not yet deprecated
SOAP client API for Java developers that need one, until SOAP is deprecated.
SOAP-dust does not require neither perform any code generation.
SOAP-dust fits within a single jar file.
SOAP-dust works on Android.
See an example of using SOAP-dust to query jira at Codehaus here.
Client client = new Client(); client.setWsdlUrl("http://jira.codehaus.org/rpc/soap/jirasoapservice-v2?wsdl"); client.setEndPoint("http://jira.codehaus.org/rpc/soap/jirasoapservice-v2"); ComposedValue authentication = new ComposedValue(); authentication.put("login", myLogin); authentication.put("password", myPasswd); client.call("login", authentication);See a full fonctional example here.
If you do not read wsdl fluently, you can find hope in the explain method.
Just create a new soap-dust client. Then initialize it with the appropriate wsdl url. Finally, call its explain method to display all the operations supported by the remote server and the expected parameters:
Client client = new Client(); client.setWsdlUrl("http://jira.codehaus.org/rpc/soap/jirasoapservice-v2?wsdl"); client.explain(System.out);
soap-dust relies on standard Java HttpURLConnection.
If you need to customize the HttpURLConnection in any way and especially to set a connect and read timeout, you can do this by overriding the protected method of class Client customizeHttpConnectionBeforeCall:
Client client = new Client() { @Override protected void customizeHttpConnectionBeforeCall(HttpURLConnection connection) { connection.setReadTimeout(1000); connection.setConnectTimeout(1000); } };
soap-dust comes with a URL handler for the special protocol test:. A test: url will simulate an http url. When you create this url, you set the file that contain the data you want to be returned when querying this url. You may also set the HTTP status code you want to be obtained when querying this url.
For instance querying the following url will result in a 500 HTTP request. The data received will be extracted from the file test/response.xml:
test:status:500;file:test/response.xml
You can also get the data sent to such an url at the end of your test. See soapdust.urlhandler.test.Handler for more information.
client.call("m", new ComposedValue().put("p", new ComposedValue() .put("p1", "1") .put("p2", "2") .put("p3", "3")...));Here is another example when the element is not of xsd type array but has a maxoccur > 1 :
client.call("m", new ComposedValue() .put("p", "1") .put("p", "2") .put("p", "3")...));