Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How I can add SOAPAction to header

843833Nov 20 2009 — edited Nov 20 2009
I 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.

Comments

843833
I have found out that Call is a org.apache.axis class. realizing that there is an installation quide for axis api in the web http://ws.apache.org/axis2
but I do not wanna install anything. I just use simple SOAP client so I need jar.file.
Is it possible to do like that just download and use axis API?
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 18 2009
Added on Nov 20 2009
1 comment
470 views