Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

add soap header method

 
dale con
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I've created a method that adds a soap header

I'm not sure what to put here - new SOAPHeaderElement (http://........)

Also i'm testing this using eclipse and the wtp tool. But can't see the header being created

Can anyone suggest how i test this to see the header?

Do i have to use something like MessageContext messagecontext = MessageContext.getCurrentContext(); ???

Thanks for any help

public static String addSOAPHeader(String token) throws Exception
{
Service service = new Service();

Call call = (Call)service.createCall();

SOAPHeaderElement tokenHeader = new
SOAPHeaderElement("http://taxservice","TokenHeader");

tokenHeader.setObjectValue(token);

call.addHeader(tokenHeader);

return token;
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic