Hi Sandamal,

According to the offline chat I had with you, this should already be solved
right? Given solution should perfectly work for the given case.

Thanks,


On Tue, Aug 5, 2014 at 2:47 PM, Sandamal Weerasinghe <[email protected]>
wrote:

> Hi Gayan,
>
>
> This is the body of the Soap envelope that I need copied.
>
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Body 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
>    <ns:getQuoteResponse xmlns:ns="http://services.samples";>
>       <ns:return xmlns:ax23="http://services.samples/xsd"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:type="ax23:GetQuoteResponse">
>          <ax23:change>-2.6118882540227526</ax23:change>
>          <ax23:earnings>12.94566873541299</ax23:earnings>
>          <ax23:high>-172.3778889138847</ax23:high>
>          <ax23:last>175.8553311594652</ax23:last>
>          <ax23:lastTradeTimestamp>Tue Aug 05 14:43:06 IST 
> 2014</ax23:lastTradeTimestamp>
>          <ax23:low>182.9590055156625</ax23:low>
>          <ax23:marketCap>4.899401067021363E7</ax23:marketCap>
>          <ax23:name>IBM Company</ax23:name>
>          <ax23:open>-175.20550902687447</ax23:open>
>          <ax23:peRatio>-17.11558033436292</ax23:peRatio>
>          <ax23:percentageChange>1.5254260629340552</ax23:percentageChange>
>          <ax23:prevClose>-171.22352354456038</ax23:prevClose>
>          <ax23:symbol>IBM</ax23:symbol>
>          <ax23:volume>7888</ax23:volume>
>       </ns:return>
>    </ns:getQuoteResponse></soapenv:Body>
>
>
>
> This is the SOAP body that needs to be replaced.
>
>
> <?xml version="1.0" encoding="UTF-8"?><soap:Body 
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; />
>
>
> Sandamal Weerasinghe | Software Engineer | WSO2 Lanka (Pvt) Ltd
>
>
> On Tue, Aug 5, 2014 at 1:49 PM, Gayan Yalpathwala <[email protected]> wrote:
>
>> Hi Sandamal,
>>
>> You can use org.apache.synapse.util.PayloadHelper class for all such
>> utility methods. Following is an example for your case.
>>
>> PayloadHelper.setXMLPayload(envelope2,
>> envelope1.getBody().getFirstElement().cloneOMElement());
>>
>> Hope this helps. Thanks,
>>
>>
>> On Tue, Aug 5, 2014 at 12:08 PM, Sandamal Weerasinghe <[email protected]>
>> wrote:
>>
>>> Hi,
>>>
>>> I need to copy the SOAPBody of one SOAP Envelope and replace the
>>> SOAPBody of another using it. Does anyone know a fast mechanism to achieve
>>> this?
>>>
>>> Thanks.
>>>
>>> Sandamal Weerasinghe | Software Engineer | WSO2 Lanka (Pvt) Ltd
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Gayan Kaushalya Yalpathwala*
>>  Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 71 8682704 <http://asia14.wso2con.com/>
>>
>>  <http://asia14.wso2con.com/>
>>
>
>


-- 
*Gayan Kaushalya Yalpathwala*
 Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 71 8682704 <http://asia14.wso2con.com/>

<http://asia14.wso2con.com/>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to