Generating Java from WSDL for use on Android with ksoap2-android SOAP client?

I found this tool to auto generate wsdl to android code, http://www.wsdl2code.com/example.aspx Here is the code: public void callWebService() { SampleService srv1 = new SampleService(); Request req = new Request(); req.companyId = “1”; req.userName = “userName”; req.password = “pas”; Response response = srv1.ServiceSample(req); }

JAX-WS – Adding SOAP Headers

Data can be transferred in SOAP header (JaxWS) by using @WebParam(header = true): @WebMethod(operationName = “SendRequest”, action = “http://abcd.ru/”) @Oneway public void sendRequest( @WebParam(name = “Message”, targetNamespace = “http://abcd.ru/”, partName = “Message”) Data message, @WebParam(name = “ServiceHeader”, targetNamespace = “http://abcd.ru/”, header = true, partName = “ServiceHeader”) Header serviceHeader); If you want to generate a client … Read more

View Savon Request XML without Sending to Server

Using Savon 2 I do it this way, write a method that return the request body from the client. client = Savon::Client.new(….) this is not mentioned in the documentation def get_request # list of operations can be found using client.operations ops = client.operation(:action_name_here) # build the body of the xml inside the message here ops.build(message: … Read more

How can I use an HTTP proxy for a JAX-WS request without setting a system-wide property?

I recommend using a custom ProxySelector. I had the same problem and it works great and is super flexible. It’s simple too. Here’s my CustomProxySelector: import org.hibernate.validator.util.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.*; import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; /** * So the way a ProxySelector works is that … Read more