aspose file tools*
The moose likes Web Services and the fly likes What is the difference between SOAP header and Http Header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "What is the difference between SOAP header and Http Header" Watch "What is the difference between SOAP header and Http Header" New topic
Author

What is the difference between SOAP header and Http Header

Ajoo Bar
Ranch Hand

Joined: Mar 28, 2011
Posts: 30
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
Rancher

Joined: Sep 21, 2011
Posts: 2408
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

Joined: Mar 28, 2011
Posts: 30
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
Rancher

Joined: Sep 21, 2011
Posts: 2408
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.
 
 
subject: What is the difference between SOAP header and Http Header