0

I am developing a web service client.

Unprocessed 'mustUnderstand' header element: {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security

Wherever it works fine with SoapUI, returns proper response with following header:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" 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" xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <S:Header>
      <wsse:Security S:mustUnderstand="1">
         <wsu:Timestamp wsu:Id="XWSSGID-13660988101781895308327" xmlns:ns15="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity" xmlns:ns14="http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512" xmlns:ns13="http://www.w3.org/2003/05/soap-envelope">
            <wsu:Created>2013-04-16T08:02:05Z</wsu:Created>
            <wsu:Expires>2013-04-16T08:07:05Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </S:Header>

I can not use wsHttpBinding. My request is:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
   <env:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken>
            <wsse:Username>wstest</wsse:Username>
            <wsse:Password>wstest</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </env:Header>
   <env:Body>
     <-- client method call implementation>
   </env:Body>
</env:Envelope>

please help me on this.

komal kadam
  • 185
  • 1
  • 1
  • 11

1 Answers1

0

in the getHeaders() method you would need to return a XML element that would contain the root element. In this case, I would build a QName element with the following instantiation and add to a Set and return that in the getHeaders element:

@Override
public Set<QName> getHeaders(){
Set<QName> headers = new HashSet<QName>();
QName ck = new QName("http://coldyak.com", "coldyak", "cyk");
headers.add(ck);
return headers;
}

This is all that's needed to handle the mustunderstand attribute. It's sort of like a contract that enforces the webservice to process the header element.

komal kadam
  • 185
  • 1
  • 1
  • 11