Announcement Announcement Module
Collapse
No announcement yet.
how to Add xmlns dynamically to Soap envelope Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to Add xmlns dynamically to Soap envelope

    Hi,
    I am using a WS-outboundGateway to get response using webservices.
    The request that is generated through a SOAP UI client is :
    Code:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:lb="http://url">
       <soapenv:Header/>
       <soapenv:Body>
          <lb:retrnTransactionNumber>
    <CREATE_REQUEST>
    
    </CREATE_REQUEST>
    </lb:retrnTransactionNumber>
    </soapenv:Body>
    </soapenv:Envelope>
    The request generated by the ws-outbound gateway is:

    Code:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header/><SOAP-ENV:Body>
    <retrnTransactionNumber>        
    <CREATE_REQUEST>
    
    <CREATE_REQUEST>
    <retrnTransactionNumber>    
    </soapenv:Body>
    </soapenv:Envelope>
    How do i add the xmlns dynamically to the soap-envelope.
    If i send <lb:retrnTransactionNumber> Spring integration gives me an error.Saying the element lb is not bound.

    This is my Ws-outboundgateway configuration

    Code:
    <ws:outbound-gateway id="createGateway"
    		 request-channel="createDataChannel" reply-channel="createInvoiceSerializationChannel"
    		uri="http://localhost:8080/WebserviceTest/services/RequestImpl"  />

    Please help.
    Thanks in advance.
    Regards,
    Annuk

  • #2
    Hi,

    Added the namespace dynamically using the implementation of Client Interceptor.

    Code:
    public boolean handleRequest(MessageContext context) throws WebServiceClientException
    	{
    		SoapMessage soapMessage = (SoapMessage) context.getRequest();
    		SoapEnvelope envelope = soapMessage.getEnvelope();
    
    		envelope.addNamespaceDeclaration("lb", "http://LB_SALES_POSHH");
    
    		return true;
    	}

    and configured the interceptor in WS-OUTBOUNDGATEWAY.


    Code:
    <ws:outbound-gateway id="createGateway"
    		 request-channel="createDataChannel" reply-channel="createSerializationChannel"
    		uri="http://localhost:8080/WebserviceTest/services/RequestImpl"  interceptor="headerInterceptor"/>
    Thanks.

    Comment


    • #3
      Had opened another issue relating to this.

      http://forum.springsource.org/showth...ng-integration

      Thanks.

      Comment

      Working...
      X