• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference between SOAP header and Http Header

 
Ajoo Bar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can someone explain me what the difference is between SOAP header and Http Header. Can I use any of these two to do basic HTTP authentication. I'm using a Java Client for sending Webserce request.

When I opened a WSDL which my client sent me in soapUI, I this in the header of that SOAP. How do I set the header information?

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:polh="http://ws.pol.com/PolContractService/2012-01-03/Polcontractservice_V1_0" xmlns:sec="http://ws.pol.com/IBC/2010-11-19/securitybasetype_V1" xmlns:mes="http://ws.pol.com/IBC/2010-11-19/messagecontextbasetype_V1" xmlns:man="http://ws.pol.com/PolContractService/2012-01-03/managecontractrequest_V1" xmlns:con="http://ws.pol.com/Common/2012-01-05/contractbasetype_V1">
<soapenv:Header>
<polh:headerContextParameters>
<securityContextParameters>
<sec:usernameToken>
<sec:userName>?</sec:userName>
<sec:password>?</sec:password>
</sec:usernameToken>
</securityContextParameters>
</polh:headerContextParameters>
</soapenv:Header>

Thanks
Ajoo
 
Tim Moores
Bartender
Posts: 2946
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP headers are used for HTTP Basic/Digest authentication. SOAP headers are used for WS-Security style authentication.

Unfortunately, the process of applying WS-Security differs from SOAP stack to SOAP stack; you'll have to consult the documentation of whichever stack you're using.
 
Ajoo Bar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, can you please explan what that mean, sorry I am new to webservices. I'm not able to identify how to do a basic webserice authentication.

Cheers
 
Tim Moores
Bartender
Posts: 2946
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said, the specifics depend on how your code is accessing the web service, and on which SOAP AP you're using. There is no general formula to follow. The first couple of items in http://www.coderanch.com/how-to/java/WebServicesHowTo page show it for the SOAP and JAX-RPC APIs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic