This is code am using james, its a standalone client am using to invoke a server for webservices, which expects some http headers of Cookie to be set.
String endpoint = "
https://www.test.com/testServices/services/SocketBroker";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("toString"));
ret = (String) call.invoke( new Object[] { } );
System.out.println("Sent 'Hello!', got '" + ret + "'");
I was unable to figure out where to set the code you gave?
I have to set the Cookie http header in soap webservice , as the server where these webservices are deployed at the customer end , has some authentication done everytime something is being accessed by outside world.
So if i have set these headers it would understand that webservice request is good to go and wont authenticate again. Else currently its sending back html login page as response instead of call to exposed method.
Hope am clear?