Customizing/Remove name space in Soap Response - JAX-WS

63 Views Asked by At

We have implemented a web-service using JAX-WS and we wanted to completely remove the namespace prefix from the web-service response. Just FYI this is running on Oracle WebLogic Server. I want to change the Webservice Response generated. I am not sure if we have access to edit the provided XSLT.

Is there any way where we can enforce the below response not to prefix with any namespace values (Ex:- S,ns2).?? Something like :- Implementing handleResponse(MessageContext messageContext) method in the Web Services Handler, then removing the namespace and set the new Message without namespace to MessageContext.

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> 
<S:Body> 
    <ns2:HelloWorld xmlns:ns2="http://abc.xxx.com/pqr/Helloworld" xmlns="http://abc.xxx.com/commonheader/v"> 
        <WSResponseHeader> 
            <WSContext> 
                <WSNameValue> 
                    <Name>APP Name</Name> 
                    <Value>ABCD</Value> 
                </WSNameValue> 
            </WSContext> 
            <WSMessageData> 
                <Timestamp>2015-05-26T11:10:16.875</Timestamp> 
            </WSMessageData> 
        </WSResponseHeader> 
        <ns2:ResponseHeader> 
            <ns2:RequestID>TEST12</ns2:RequestID> 
            <ns2:ResponseStatus>SUCCESS</ns2:ResponseStatus> 
        </ns2:ResponseHeader> 
        <ns2:HelloResponse> 
            <ns2:HelloAddressList numberOfCandidate="1"> 
                <ns2:HelloAddress> 
                    <ns2:Address countryCode="COUNTRY"> 
                        <ns2:StreetAddress> 
                            <ns2:Street>0000 Street Name</ns2:Street> 
                        </ns2:StreetAddress> 
                        <ns2:City>CITY</ns2:City> 
                        <ns2:State>STATE</ns2:State> 
                        <ns2:PostalCode>ZIP</ns2:PostalCode> 
                    </ns2:Address> 
                    <ns2:Services> 
                        <ns2:Code>HK</ns2:Code> 
                        <ns2:Description>House Keeping</ns2:Description> 
                        <ns2:Available>Y</ns2:Available> 
                    </ns2:Services> 
                </ns2:HelloAddress> 
            </ns2:HelloAddressList> 
        </ns2:HelloResponse> 
    </ns2:HelloWorld> 
</S:Body> 

0

There are 0 best solutions below