You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Soyer, Muhammed A." <MS...@MICROS.COM> on 2008/09/10 12:54:58 UTC
How to add ws-addressing and ws-security headers to call a .Net
Service
Hi I am new to axis and I am a little lost ...
I want to add ws-addressing and ws-security headers to my soap calls in able to conform to my service requirements.
I tried a lot of things and I couldn't progress much.
I need to build a soap request as below.
----
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<wsa:Action>http://schemas.ZZZ.com/NGX/1/0/XAuthentication/1/0/AuthenticationPortType/AuthenticateUserRequest</wsa:Action>
<wsa:MessageID>urn:uuid:1978176b-3ce0-4876-bc19-ba172ce40a7e</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:To>http://schemas.ZZZ.com/NGX/1/0/XAuthentication/1/0/</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-3ac1dee5-fd8b-4f98-97ec-92374a714cd2">
<wsu:Created>2008-09-05T16:05:44Z</wsu:Created>
<wsu:Expires>2008-09-05T16:10:44Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<AuthenticateUserRequest xmlns="http://schemas.ZZZ.com/NGX/1/0/XAuthentication/1/0/">
<domainName>local</domainName>
<userLogin>Administrator</userLogin>
<password type="PasswordText">ABCD</password>
<workstation>MSOYERXP999</workstation>
</AuthenticateUserRequest>
</soap:Body>
</soap:Envelope>
But the message that I can create is as below
<?xml version = '1.0' encoding = 'UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:To>http://172.28.69.39:3457/NGX/Router</wsa:To>
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:8CCEB06E38921578361221043202900</wsa:MessageID>
<wsa:Action>http://schemas.ZZZ.com/NGX/1/0/XAuthentication/1/0/AuthenticationPortType/AuthenticateUserRequest</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<ns1:AuthenticateUserRequest xmlns:ns1="http://schemas.ZZZ.com/NGX/1/0/XAuthentication/1/0/">
<ns1:domainName>YYY</ns1:domainName>
<ns1:userLogin>msoyer</ns1:userLogin>
<ns1:password type="PasswordText">secret</ns1:password>
<ns1:workstation>msoyerxp</ns1:workstation>
</ns1:AuthenticateUserRequest>
</soapenv:Body>
</soapenv:Envelope>
I realized that the wsa namespace declarations are different. How can I make them same ? And I couldn't set the WSA:TO element correctly either. It is always taking my endpoint address which is not the case with the .Net client.
Any help would be great...
Thanks