How I can add SOAPAction to header
843833Nov 20 2009 — edited Nov 20 2009I am using javax.xml.soap.* classes in JSDK 1.6. I have tried several methods to add SOAPAction to header to header like below,
First one:
MimeHeaders headers = soapMessage.getMimeHeaders();
headers.addHeader("SOAPAction", "http://tempuri.org/GetSessionID");
Second one:
Name n = soapEnvelope.createName("SOAPAction");
SOAPHeaderElement soapaction = header.addHeaderElement(n);
soapaction.addTextNode("http://tempuri.org/GetSessionID");
soapaction.setMustUnderstand(true);
All did not work, each time I got an error message.
I run into the code fro the same session http://forums.sun.com/thread.jspa?threadID=5159365, But I did not find any Call class in JSDK.
Service service = new Service();
Call call = (Call) service.createCall();
call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
call.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://WebServices.SSO/Login");
call.setTargetEndpointAddress( new java.net.URL(endpointUrl) );
Could you take a look at this problem, I assue that it is so simple for you since I an newbie in SOAP.