none
How to fix error "Namespace prefix 'soap' not defined" from using WSE 2.0 SP3 [.NET Framewok 1.1] RRS feed

  • Question

  • Hi all,

    I have some problem about using WSE 2.0 SP3 (.NET Framewok 1.1).

    I use WSE 2.0 SP3 for consume secure web service.

    I try to send the UsernameToken with SOAP Header to the secure web service. (Axis Java Web Service)

    See my code below,

    ....

    UsernameToken userToken = new UsernameToken(userName,password, PasswordOption.SendPlainText);
    SoapContext requestContext = this.objProxyService.RequestSoapContext;
    requestContext.Security.Tokens.Add(userToken);
    MessageSignature sig = new MessageSignature(userToken);
    requestContext.Security.Elements.Add(sig);

    ......

    this.objProxyService.GetValue();  --> Error Appear

    But the error "Namespace prefix 'soap' not defined" is occurred, when I try to invoke web method.

    Does it have problem from the SOAP Message use "soapenv" prefix?

    Below is expect SOAP message,

    <soapenv:Envelope xmlns:ser="http://servicexxxxxxxxxx.xx.xx" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header>
        <wsse:Security soapenv:mustUnderstand="1" 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">
          <wsse:UsernameToken wsu:Id="UsernameToken-448969DA1257B4367F14967409135479">
            <wsse:Username>MyUsername</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">MyPassword</wsse:Password>
            <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">dnvHwbnDwj27eNtJhTPpAw==</wsse:Nonce>
            <wsu:Created>2017-06-06T09:21:53.547Z</wsu:Created>
          </wsse:UsernameToken>
        </wsse:Security>
      </soapenv:Header>

    ........

    How can I solve this problem?

    Thank you very much.

    Tuesday, June 6, 2017 11:35 AM

All replies

  • Hi Jatuphum Tungsilnsukchai,

    Thank you for posting here.

    According to your question is more related to WCF, I will move it to  Windows Communication Foundation, Serialization, and Networking forum for suitable support.

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions. 

    Thanks for your understanding and cooperation.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, June 7, 2017 8:16 AM
  • Hi Jatuphum,

    Could you check the difference between your SOPA message and expect SOAP message? It would be helpful if you could share us your current SOAP message.

    Per to this error message, it seems Java Service uses soapenv prefix instead of soap. I would suggest you check the prefix. And I suggest you refer below link.

    #Prefix SOAP XML Instead direct namespace

    https://stackoverflow.com/questions/17415508/prefix-soap-xml-instead-direct-namespace

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 8, 2017 2:55 AM