If the message have also some attachments SOAPMessage.writeTo() should write
them too (can't verify... got an error if i test with a message with
attachment.. Dan Kulp is checking for this) and i want only the envelope...
i'll remove it manually...


Any idea if the logic of getTextContent is correct?


Thx,
 Lorenzo



James Mao wrote:
> 
> If you wish to work with the String level, then just substring the 
> content you want, or just replace it with an empty string
> 
> Or
> 
> You probably should use SOAPMessage.writeTo() instead of getTextContent(),
> 
> Regards,
> James
> 
>> That works!
>>
>> Just 2 questions:
>> the output also include 
>> <?xml version="1.0" encoding="utf-8"?>
>> i have to manually remove it or there is some utility that do it for me?
>>
>> The getTextContent() work fine or should output what i expected?
>> I would use saaj interface so future port to another saaj implementation
>> is
>> more easy...
>>
>> Thx for ur help
>>
>>
>> James Mao wrote:
>>   
>>> Try this
>>>
>>> org.apache.cxf.helpers.XMLUtils.toString(mySOAPMessage.getSOAPPart().getEnvelope())
>>>
>>> James
>>>
>>>
>>>     
>>>> i'm trying to get the SOAPEnvelope content as String. I tryed with
>>>>
>>>> mySOAPMessage.getSOAPPart().getEnvelope().getTextContent() 
>>>>
>>>> but the returned string of this envelope
>>>>
>>>> <soapenv:Envelope
>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>>>>       <soapenv:Body>
>>>>          <eseguiServizio xmlns="http://spcoop.it/cart/pdd-test";>
>>>>             <Richiesta><persona nome="mario"
>>>> cognome="rossi"></Richiesta>
>>>>          </eseguiServizio>
>>>>       </soapenv:Body>
>>>>    </soapenv:Envelope>
>>>>
>>>> is just
>>>>
>>>> <persona nome="mario" cognome="rossi"/>
>>>>
>>>>
>>>> It's correct? If is right how can i get the whole envelope as string?
>>>> Thx
>>>> Lorenzo
>>>>   
>>>>       
>>>     
>>
>>   
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Get-SOAPEnvelope-as-String-tf4639292.html#a13252005
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to