You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Kim, Ducheol" <du...@247realmedia.com> on 2010/03/17 09:43:57 UTC

Invalid xml message returned if I send a soap message from .NET.

Hi All.

Until now , we service API for our own service using jboss WS ( based on axis1.2 ).
Sometimes raise a memory issue , these day we try to change soap engine as axis2.
We did it refer below article and it seems that all of them work fine.
http://www.eclipse.org/webtools/community/tutorials/TopDownAxis2WebService/td_tutorial.html

But if I test it using .net client , NullReferenceException is occurred.

I try to find a reason using TCP/IP Monitor in eclipse, and response message is illegal.
Below is message captured by TCP/IP Monitor when I use .net for client ( Message with blue font is return message of our application. )
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result>&lt;?xml version='1.0'?>&#xd;
&lt;AdXML>&#xd;
&#xd;
&lt;Response>&#xd;
  &lt;Product>Request OK.  Found 1 records.&lt;/Product>&#xd;
  &lt;List numberOfRows='1' pageIndex='1' pageSize='1000' totalNumberOfEntries='1'>&#xd;
    &lt;Product>&#xd;
      &lt;Id>default-product&lt;/Id>&#xd;
    &lt;/Product>&#xd;
  &lt;/List>&#xd;
&lt;/Response>&#xd;
&lt;/AdXML></result></ns1:OasXmlRequestResponse>
22
</soapenv:Body></soapenv:Envelope>
0

You can see that "22" and "0" is in soap message.
I think parse on .net can't be parse soap message because it isn't valid xml.

Below is soap message if I use axis or axis2 for client.
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result>&lt;?xml version='1.0'?>&#xd;
&lt;AdXML>&#xd;
&#xd;
&lt;Response>&#xd;
  &lt;Product>Request OK.  Found 1 records.&lt;/Product>&#xd;
  &lt;List numberOfRows='1' pageIndex='1' pageSize='1000' totalNumberOfEntries='1'>&#xd;
    &lt;Product>&#xd;
      &lt;Id>default-product&lt;/Id>&#xd;
    &lt;/Product>&#xd;
  &lt;/List>&#xd;
&lt;/Response>&#xd;
&lt;/AdXML></result></ns1:OasXmlRequestResponse></soapenv:Body></soapenv:Envelope>

Is it bug on axis2 ?









DUCHEOL.KIM/ SENIOR SOFTWARE ENGINEER
T:02.3459.2318/C.P:018.233.7939/F:568.8432
ducheol.kim@247realmedia.com




24/7 Real Media, Inc. A WPP Company
4F Poongsung Building 51-12 Banpo-4-Dong,Seocho-Gu
Seoul 137-802, South Korea





                                                                                                WWW.247REALMEDIA.COM
                                                                                  >THE SCIENCE OF DIGITAL MARKETING





Re: Invalid xml message returned if I send a soap message from .NET.

Posted by Amila Suriarachchi <am...@gmail.com>.
Can you check the difference between the .Net client request and the Axis2
client request?

you have to check including http headers.

thanks,
Amila.

On Wed, Mar 17, 2010 at 2:13 PM, Kim, Ducheol
<du...@247realmedia.com>wrote:

>  Hi All.
>
>
>
> Until now , we service API for our own service using jboss WS ( based on
> axis1.2 ).
>
> Sometimes raise a memory issue , these day we try to change soap engine as
> axis2.
>
> We did it refer below article and it seems that all of them work fine.
>
>
> http://www.eclipse.org/webtools/community/tutorials/TopDownAxis2WebService/td_tutorial.html
>
>
>
> But if I test it using .net client , NullReferenceException is occurred.
>
>
>
> I try to find a reason using TCP/IP Monitor in eclipse, and response
> message is illegal.
>
> Below is message captured by TCP/IP Monitor when I use .net for client (
> Message with blue font is return message of our application. )
>
> <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse
> xmlns:ns1="http://api.oas.tfsm.com/"><result>&lt;?xml version='1.0'?>&#xd;
>
> &lt;AdXML>&#xd;
>
> &#xd;
>
> &lt;Response>&#xd;
>
>   &lt;Product>Request OK.  Found 1 records.&lt;/Product>&#xd;
>
>   &lt;List numberOfRows='1' pageIndex='1' pageSize='1000'
> totalNumberOfEntries='1'>&#xd;
>
>     &lt;Product>&#xd;
>
>       &lt;Id>default-product&lt;/Id>&#xd;
>
>     &lt;/Product>&#xd;
>
>   &lt;/List>&#xd;
>
> &lt;/Response>&#xd;
>
> &lt;/AdXML></result></ns1:OasXmlRequestResponse>
>
> *22*
>
> </soapenv:Body></soapenv:Envelope>
>
> *0*
>
>
>
> You can see that “22” and “0” is in soap message.
>
> I think parse on .net can’t be parse soap message because it isn’t valid
> xml.
>
>
>
> Below is soap message if I use axis or axis2 for client.
>
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse
> xmlns:ns1="http://api.oas.tfsm.com/"><result>&lt;?xml version='1.0'?>&#xd;
>
> &lt;AdXML>&#xd;
>
> &#xd;
>
> &lt;Response>&#xd;
>
>   &lt;Product>Request OK.  Found 1 records.&lt;/Product>&#xd;
>
>   &lt;List numberOfRows='1' pageIndex='1' pageSize='1000'
> totalNumberOfEntries='1'>&#xd;
>
>     &lt;Product>&#xd;
>
>       &lt;Id>default-product&lt;/Id>&#xd;
>
>     &lt;/Product>&#xd;
>
>   &lt;/List>&#xd;
>
> &lt;/Response>&#xd;
>
> &lt;/AdXML>
> </result></ns1:OasXmlRequestResponse></soapenv:Body></soapenv:Envelope>
>
>
>
> Is it bug on axis2 ?
>
>
>
>
>
>
>
>
>
> DUCHEOL.KIM/ SENIOR SOFTWARE ENGINEER
>
> T:02.3459.2318/C.P:018.233.7939/F:568.8432
> ducheol.kim@247realmedia.com
>
> 24/7 Real Media, Inc. A WPP Company
> 4F Poongsung Building 51-12 Banpo-4-Dong,Seocho-Gu
> Seoul 137-802, South Korea
>
>
>
>
>
> WWW.247REALMEDIA.COM
>
> >THE SCIENCE OF DIGITAL MARKETING
>
>
>
>
>



-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

RE: Invalid xml message returned if I send a soap message from .NET.

Posted by "Kim, Ducheol" <du...@247realmedia.com>.
I found that chunking raise some issued when I use axis2.

I get answer that I need to remove element named "Transfer-Encoding" to off chunking.
I try to it but it isn't effected.

I think axis2 execute on WAS so axsi2.xml isn't effect more elegance.

I googling about it and found a article.
http://stackoverflow.com/questions/2282437/how-to-set-axis2-web-service-client-configuration-using-axis2-xml
According to above, I need to set jvm option to specify axis2.xml, but I use jboss , so it is difficult.

Is there anyone that know solution about it ?

Thanks

From: Kim, Ducheol
Sent: Wednesday, March 17, 2010 6:32 PM
To: 'Anish P S'
Subject: RE: Invalid xml message returned if I send a soap message from .NET.

I remove below element on axis2.xml
( There are two element below element in axis2.xml and I remove all of them. )

<transportSender name="http"
                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <!--parameter name="Transfer-Encoding">chunked</parameter-->

        <!-- If following is set to 'true', optional action part of the Content-Type will not be added to the SOAP 1.2 messages -->
        <!--  <parameter name="OmitSOAP12Action">true</parameter>  -->
    </transportSender>

    <transportSender name="https"
                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <!--parameter name="Transfer-Encoding">chunked</parameter-->
    </transportSender>
But it still exist numeric value on soap message.

Did I make some mistake or is there another way to disable chunking ?

Thanks.

From: Anish P S [mailto:anish.ps@cs-techno.com]
Sent: Wednesday, March 17, 2010 6:20 PM
To: Kim, Ducheol
Subject: Re: Invalid xml message returned if I send a soap message from .NET.

remove <parameter name="Transfer-Encoding">chunked</parameter> from axis2.xml


----- Original Message -----
From: Kim, Ducheol<ma...@247realmedia.com>
To: Anish P S<ma...@cs-techno.com>
Sent: Wednesday, March 17, 2010 2:27 PM
Subject: RE: Invalid xml message returned if I send a soap message from .NET.

Hi Anish.

Thanks for quick answer.

We want client to be able to use same code although server code is changed.

So we need to disable chunking on server side.

Can I disable chunking on server side ?

Thanks
Ducheol
From: Anish P S [mailto:anish.ps@cs-techno.com]
Sent: Wednesday, March 17, 2010 5:51 PM
To: Kim, Ducheol
Subject: Re: Invalid xml message returned if I send a soap message from .NET.

Disable chunking


Options options = stub._getServiceClient().getOptions();

options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
----- Original Message -----
From: Kim, Ducheol<ma...@247realmedia.com>
To: java-user@axis.apache.org<ma...@axis.apache.org>
Sent: Wednesday, March 17, 2010 2:13 PM
Subject: Invalid xml message returned if I send a soap message from .NET.

Hi All.

Until now , we service API for our own service using jboss WS ( based on axis1.2 ).
Sometimes raise a memory issue , these day we try to change soap engine as axis2.
We did it refer below article and it seems that all of them work fine.
http://www.eclipse.org/webtools/community/tutorials/TopDownAxis2WebService/td_tutorial.html

But if I test it using .net client , NullReferenceException is occurred.

I try to find a reason using TCP/IP Monitor in eclipse, and response message is illegal.
Below is message captured by TCP/IP Monitor when I use .net for client ( Message with blue font is return message of our application. )
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result>&lt;?xml version='1.0'?>&#xd;
&lt;AdXML>&#xd;
&#xd;
&lt;Response>&#xd;
  &lt;Product>Request OK.  Found 1 records.&lt;/Product>&#xd;
  &lt;List numberOfRows='1' pageIndex='1' pageSize='1000' totalNumberOfEntries='1'>&#xd;
    &lt;Product>&#xd;
      &lt;Id>default-product&lt;/Id>&#xd;
    &lt;/Product>&#xd;
  &lt;/List>&#xd;
&lt;/Response>&#xd;
&lt;/AdXML></result></ns1:OasXmlRequestResponse>
22
</soapenv:Body></soapenv:Envelope>
0

You can see that "22" and "0" is in soap message.
I think parse on .net can't be parse soap message because it isn't valid xml.

Below is soap message if I use axis or axis2 for client.
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result>&lt;?xml version='1.0'?>&#xd;
&lt;AdXML>&#xd;
&#xd;
&lt;Response>&#xd;
  &lt;Product>Request OK.  Found 1 records.&lt;/Product>&#xd;
  &lt;List numberOfRows='1' pageIndex='1' pageSize='1000' totalNumberOfEntries='1'>&#xd;
    &lt;Product>&#xd;
      &lt;Id>default-product&lt;/Id>&#xd;
    &lt;/Product>&#xd;
  &lt;/List>&#xd;
&lt;/Response>&#xd;
&lt;/AdXML></result></ns1:OasXmlRequestResponse></soapenv:Body></soapenv:Envelope>

Is it bug on axis2 ?









DUCHEOL.KIM/ SENIOR SOFTWARE ENGINEER
T:02.3459.2318/C.P:018.233.7939/F:568.8432
ducheol.kim@247realmedia.com




24/7 Real Media, Inc. A WPP Company
4F Poongsung Building 51-12 Banpo-4-Dong,Seocho-Gu
Seoul 137-802, South Korea





                                                                                                WWW.247REALMEDIA.COM
                                                                                  >THE SCIENCE OF DIGITAL MARKETING