You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Dister Kemp <di...@gmail.com> on 2008/07/23 14:07:31 UTC

Hi - A clarification.

Hello Axis team,


I have an issue on which I could not a find a way to resolve with Axis2.

I have a server running Axis2 on Tomcat with my POJO app. which
exposes some webservices via REST.

There is a webservice - register which returns a string - but is basically
XML.
Now the return on the browser when hitting a webservice endpoint. (register)
it comes as

<ns:registerResponse xmlns:ns="http://abc.com/">



<ns:return>
   &lt;?xml version="1.0" encoding="utf-8"?>&lt;string
xmlns="http://abc.com/">&lt;abc>&lt;register>111
&lt;/register>&lt;/abc>&lt;/string>



</ns:return>
</ns:registerResponse>


As you can see there are two outer tags <ns:registerResponse> and
<ns:return>
which is causing my XML Parser on the client side to fail.

Is there a way to disable those two tags that AXIS2 is sending, so that the
XML tag I am sending is the top level lag and that way my client XML parser
would work.


Any pointers in this regard is highly appreciated.

Thanks
Dister
_____________

Re: Hi - A clarification.

Posted by keith chapman <ke...@gmail.com>.
Hi,

A workaround for you will be to,

1. Save the WSDL file generated by axis2.
2. Edit the types section of the WSDL to suit your needs.
3. Then you will have to generate serverside code using this edited WSDL.
4. Get the generated messagereceiver and set it as your message receirver
using the services.xml
5. Bundle the WSDL into the aar and deploy your service

Thanks,
Keith.

On Thu, Jul 24, 2008 at 4:19 PM, Dister Kemp <di...@gmail.com> wrote:

>
>
> Hello Sanka,
>
>     Thanks for your response. But I was wondering if anything could be
> specified
> in the WSDL file which would indicate to AXIS2 to not emit these two tags.
>
> Or do you think MessageBuilders is something that could come to my help
> here.
>
> The only issue in my case is that I do not have access to the client
> sources.
> The client will directly hit my URL and consume my webservice output XML.
>
> Any help is appreciated.
>
> Thanks
> Dister
> _________
>
>
>
> On Thu, Jul 24, 2008 at 2:31 PM, Sanka Samaranayake <ss...@gmail.com>
> wrote:
>
>> I'm afraid you can't do that if the service is deployed as a POJO Web
>> service. One alternative would be to handle those two elements at the client
>> side via a generated stub.
>>
>> Sanka
>>
>>
>> On Wed, Jul 23, 2008 at 5:37 PM, Dister Kemp <di...@gmail.com>
>> wrote:
>>
>>>
>>>
>>> Hello Axis team,
>>>
>>>
>>> I have an issue on which I could not a find a way to resolve with Axis2.
>>>
>>> I have a server running Axis2 on Tomcat with my POJO app. which
>>> exposes some webservices via REST.
>>>
>>> There is a webservice - register which returns a string - but is
>>> basically XML.
>>> Now the return on the browser when hitting a webservice endpoint.
>>> (register)
>>> it comes as
>>>
>>> <ns:registerResponse xmlns:ns="http://abc.com/">
>>>
>>>
>>>
>>>
>>>
>>> <ns:return>
>>>    &lt;?xml version="1.0" encoding="utf-8"?>&lt;string xmlns="http://abc.com/">&lt;abc>&lt;register>111 &lt;/register>&lt;/abc>&lt;/string>
>>>
>>>
>>>
>>>
>>>
>>> </ns:return>
>>> </ns:registerResponse>
>>>
>>>
>>> As you can see there are two outer tags <ns:registerResponse> and
>>> <ns:return>
>>> which is causing my XML Parser on the client side to fail.
>>>
>>> Is there a way to disable those two tags that AXIS2 is sending, so that
>>> the
>>> XML tag I am sending is the top level lag and that way my client XML
>>> parser would work.
>>>
>>>
>>> Any pointers in this regard is highly appreciated.
>>>
>>> Thanks
>>> Dister
>>> _____________
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Sanka Samaranayake
>> WSO2 Inc.
>>
>> http://sankas.blogspot.com/
>> http://www.wso2.org/
>>
>
>


-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org

Re: Hi - A clarification.

Posted by Dister Kemp <di...@gmail.com>.
Hello Sanka,

    Thanks for your response. But I was wondering if anything could be
specified
in the WSDL file which would indicate to AXIS2 to not emit these two tags.

Or do you think MessageBuilders is something that could come to my help
here.

The only issue in my case is that I do not have access to the client
sources.
The client will directly hit my URL and consume my webservice output XML.

Any help is appreciated.

Thanks
Dister
_________


On Thu, Jul 24, 2008 at 2:31 PM, Sanka Samaranayake <ss...@gmail.com>
wrote:

> I'm afraid you can't do that if the service is deployed as a POJO Web
> service. One alternative would be to handle those two elements at the client
> side via a generated stub.
>
> Sanka
>
>
> On Wed, Jul 23, 2008 at 5:37 PM, Dister Kemp <di...@gmail.com>
> wrote:
>
>>
>>
>> Hello Axis team,
>>
>>
>> I have an issue on which I could not a find a way to resolve with Axis2.
>>
>> I have a server running Axis2 on Tomcat with my POJO app. which
>> exposes some webservices via REST.
>>
>> There is a webservice - register which returns a string - but is basically
>> XML.
>> Now the return on the browser when hitting a webservice endpoint.
>> (register)
>> it comes as
>>
>> <ns:registerResponse xmlns:ns="http://abc.com/">
>>
>>
>>
>>
>> <ns:return>
>>    &lt;?xml version="1.0" encoding="utf-8"?>&lt;string xmlns="http://abc.com/">&lt;abc>&lt;register>111 &lt;/register>&lt;/abc>&lt;/string>
>>
>>
>>
>>
>> </ns:return>
>> </ns:registerResponse>
>>
>>
>> As you can see there are two outer tags <ns:registerResponse> and
>> <ns:return>
>> which is causing my XML Parser on the client side to fail.
>>
>> Is there a way to disable those two tags that AXIS2 is sending, so that
>> the
>> XML tag I am sending is the top level lag and that way my client XML
>> parser would work.
>>
>>
>> Any pointers in this regard is highly appreciated.
>>
>> Thanks
>> Dister
>> _____________
>>
>>
>>
>>
>
>
> --
> Sanka Samaranayake
> WSO2 Inc.
>
> http://sankas.blogspot.com/
> http://www.wso2.org/
>

Re: Hi - A clarification.

Posted by Sanka Samaranayake <ss...@gmail.com>.
I'm afraid you can't do that if the service is deployed as a POJO Web
service. One alternative would be to handle those two elements at the client
side via a generated stub.

Sanka

On Wed, Jul 23, 2008 at 5:37 PM, Dister Kemp <di...@gmail.com> wrote:

>
>
> Hello Axis team,
>
>
> I have an issue on which I could not a find a way to resolve with Axis2.
>
> I have a server running Axis2 on Tomcat with my POJO app. which
> exposes some webservices via REST.
>
> There is a webservice - register which returns a string - but is basically
> XML.
> Now the return on the browser when hitting a webservice endpoint.
> (register)
> it comes as
>
> <ns:registerResponse xmlns:ns="http://abc.com/">
>
>
>
> <ns:return>
>    &lt;?xml version="1.0" encoding="utf-8"?>&lt;string xmlns="http://abc.com/">&lt;abc>&lt;register>111 &lt;/register>&lt;/abc>&lt;/string>
>
>
>
> </ns:return>
> </ns:registerResponse>
>
>
> As you can see there are two outer tags <ns:registerResponse> and
> <ns:return>
> which is causing my XML Parser on the client side to fail.
>
> Is there a way to disable those two tags that AXIS2 is sending, so that the
> XML tag I am sending is the top level lag and that way my client XML parser
> would work.
>
>
> Any pointers in this regard is highly appreciated.
>
> Thanks
> Dister
> _____________
>
>
>
>


-- 
Sanka Samaranayake
WSO2 Inc.

http://sankas.blogspot.com/
http://www.wso2.org/