Results 1 to 3 of 3

Thread: how to Add xmlns dynamically to Soap envelope

  1. #1
    Join Date
    May 2011
    Location
    Mumbai, India
    Posts
    93

    Question 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. #2
    Join Date
    May 2011
    Location
    Mumbai, India
    Posts
    93

    Thumbs up

    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.

  3. #3
    Join Date
    May 2011
    Location
    Mumbai, India
    Posts
    93

    Default

    Had opened another issue relating to this.

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

    Thanks.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •