Skip to main content

Simple newbie question: ws to return xml response

1 reply [Last post]
brasta78
Offline
Joined: 2010-12-30
Points: 0

Hi,

I'm trying to build web service that must return xml response:

<?xml version="1.0" encoding="utf-8"?>
<userInfo xmlns = "http://schemas.somepage">
<phone>090123456</phone>
<smtpAddress>userid.spmail@spdomain.com</smtpAddress>
<error code="ok"/>
</userInfo>

I construct that xml response from JAXB classes but my jax-ws web service respond with this SOAP msg:

<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
<S:Body>
<GetUserInfoResponse xmlns="http://schemas.somepage">
<GetUserInfoResult><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<userInfo xmlns="http://schemas.somepage">
<rphone>090123456</phone>
<smtpAddress>userid.spmail@spdomain.com</smtpAddress>
<error code="ok"/>
</userInfo>]]></GetUserInfoResult>
</GetUserInfoResponse>
</S:Body>
</S:Envelope>

So it respond xml in xml message... pls give me the way, how to pass only my constructed xml response

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
brasta78
Offline
Joined: 2010-12-30
Points: 0

Thanks for so many answers :)
My SOAP msg is correct - I should return xml as String