Hi Zoltan,
Usually soap protocol uses http as the transport protocol and hence web service call using soap protocol will have all the freedom to modify any thing related to http transport protocol.
Please go through the sample server side and client side codes which I have attached for simple application level authentication using soap.
Generate the client side stubs and then run the sample client code pointing it to the right service class and port class according to the generated stubs.
I am assuming this should satisfy you. Please let me know your observations.
Below three java files are server side code
HelloWorld.java
HelloWorldImpl.java
@WebService(name = "HelloWorldImpl", targetNamespace = "http://authentication.jaxws.com/")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class HelloWorldImpl implements HelloWorld{
@Resource
WebServiceContext wsctxt;
@Override
public
String sayHello(String name) {
// TODO Auto-generated method stub
MessageContext msgctxt=wsctxt.getMessageContext();
Map map=(Map)msgctxt.get(MessageContext.HTTP_REQUEST_HEADERS);
List username=(List)map.get("Username");
List password=(List)map.get("Password");
System.out.println(username.get(0));
System.out.println(password.get(0));
if(username.get(0).equals("Username") && password.get(0).equals("Password")){
return "correct user "+name;
}else
return "unknown user "+name +username.get(0)+" "+password.get(0);
}
}
Main.java
Thanks,
Kesava.