locked
How to add prefix to parent namespace RRS feed

  • Question

  • Hi we are writing a Webservice for a standar client.

    The client is sending the SOAP message as :

    -----------------------------------------------------------------------
    <?xml version="1.0" encoding="UTF-8" ?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header>
    <pre:user xmlnsre="urn:IciUserInterface" SOAP- ENV:mustUnderstand="0" xsi:type="xsd:string">SPAREKH</pre:user>
    <pre:language xmlnsre="urn:IciUserInterface" SOAP-ENV:mustUnderstand="0" xsi:type="xsd:string">EN</pre:language>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <ns0:getAttributes xmlns:ns0="urn:IciUserInterface">
    <userId xmlns="urn:IciUserInterface">ABC</userId>
    </ns0:getAttributes>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    -----------------------------------------------------------------------

    And my webservice is expecting the SOAP message as :

    -------------------------------------------------------------------------
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
    <MyHeader xmlns="http://wicom.com/ws/OII/IciUser/literalTypes">
    <user xmlns="urn:IciUserInterface">string</user>
    <language xmlns="urn:IciUserInterface">string</language>
    </MyHeader>
    </soap:Header>
    <soap:Body>
    <getAttributes xmlns="urn:IciUserInterface">
    <userId xmlns="">string</userId>
    </getAttributes>
    </soap:Body>
    </soap:Envelope>

    -------------------------------------------------------------------------

    In both of the above messages there is the mismatch in namespace of getAttributes's parameter userId.... In the client message there is namespace for userId but in my message the xmlns=""..... due to this I am not able to read the data provided with the getAttributes message.

    I think this is happening because I am not able to seperate the parent namespace using the prefix ns0... as it is done in the client SOAP request.

    Can somebody tell me how to get the prefix ?
    Please

    Thanks
    __________________
    Cheers,
    Saurabh.
    Thursday, December 29, 2005 6:37 AM