You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Paul Fremantle <pz...@hursley.ibm.com> on 2004/10/27 03:09:32 UTC

Transport issues

I'm trying out Axis 1.3 CPP to Axis Java. Both on Windows. I downloaded 
the binary. I've tried both expat and xerces.

I've got two problems....

One is when I go direct or through Axis Java TCPMON.
"AxisTransportException:Unknow HTTP response, cannot process response 
message Protocol is not HTTP."

 >>>>Here is the HTTP response message:
==============
Listen Port: 8080
Target Host: localhost
Target Port: 9080
==== Request ====
POST /axis/servlet/AxisServlet HTTP/1.1
Host: localhost:8080
Content-Type: text/xml; charset=UTF-8
SOAPAction: "GetQuote"
Content-Length: 378

<?xml version='1.0' encoding='utf-8' ?><SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:getQuote 
xmlns:ns1="urn:xmltoday-delayed-quotes"><symbol 
xsi:type="xsd:string">XXX</symbol></ns1:getQuote></SOAP-ENV:Body></SOAP-ENV:Envelope>==== 
Response ====
HTTP/1.0 200 OK
Content-Type: text/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<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>
  <getQuoteResponse xmlns="urn:xmltoday-delayed-quotes">
   <result>55.35</result>
  </getQuoteResponse>
 </soapenv:Body>
</soapenv:Envelope>
==============

I used a different TCP sniffer, that somehow fixed up the response so my 
client did understand it.
I then got this response:
 >>>"Cannot deserialize the requested element"

I've attached my WSDL.

Thanks
Paul


Re: Transport issues

Posted by Paul Fremantle <pz...@hursley.ibm.com>.
Samisa

THANKS!

Paul

Samisa Abeysinghe wrote:

>Hi Paul,
>   I generated the client side C++ code for given WSDL and in GetQuote.cpp, within the method
>GetQuote::getQuote it has:
>if(AXIS_SUCCESS == m_pCall->checkMessage("GetQuoteResponse", "urn:xmltoday-delayed-quotes"))
>
>However, if you look at the response it has:
>   <getQuoteResponse xmlns="urn:xmltoday-delayed-quotes">
>
>Hence the deserialization problem comes because of the case difference (GetQuoteResponse vs.
>getQuoteResponse) In fact the WSDL says it should be "GetQuoteResponse", hence one cannot blame
>generated C++ code.
>
>Transport problem:
>This seems to be due to a bug in header reading. I have the following logic:
>            m_Channel >> m_strReceived;
>            if (!m_bReadPastHTTPHeaders)
>            {
>                do
>                {
>                    if (m_strReceived.find ("\r\n\r\n") == std::string::npos)
>                        m_Channel >> m_strReceived;    // Assume non blocking here
>                }
>                while (m_strReceived.find ("\r\n\r\n") == std::string::npos);
>
>If I do not get "\r\n\r\n", I seem to overwrite the current buffer - that is a bug.
>I will fix this in CVS. (This was not revealed in our testing as we in most cases read past the
>HTTP header in one go. In your case it would have read the HTTP header using than one read from
>channel)
>
>Thanks,
>Samisa...
>
>--- Paul Fremantle <pz...@hursley.ibm.com> wrote:
>
>  
>
>>I'm trying out Axis 1.3 CPP to Axis Java. Both on Windows. I downloaded 
>>the binary. I've tried both expat and xerces.
>>
>>I've got two problems....
>>
>>One is when I go direct or through Axis Java TCPMON.
>>"AxisTransportException:Unknow HTTP response, cannot process response 
>>message Protocol is not HTTP."
>>
>> >>>>Here is the HTTP response message:
>>==============
>>Listen Port: 8080
>>Target Host: localhost
>>Target Port: 9080
>>==== Request ====
>>POST /axis/servlet/AxisServlet HTTP/1.1
>>Host: localhost:8080
>>Content-Type: text/xml; charset=UTF-8
>>SOAPAction: "GetQuote"
>>Content-Length: 378
>>
>><?xml version='1.0' encoding='utf-8' ?><SOAP-ENV:Envelope 
>>xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
>>xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
>>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:getQuote 
>>xmlns:ns1="urn:xmltoday-delayed-quotes"><symbol 
>>xsi:type="xsd:string">XXX</symbol></ns1:getQuote></SOAP-ENV:Body></SOAP-ENV:Envelope>==== 
>>Response ====
>>HTTP/1.0 200 OK
>>Content-Type: text/xml; charset=utf-8
>>
>><?xml version="1.0" encoding="UTF-8"?>
>><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>
>>  <getQuoteResponse xmlns="urn:xmltoday-delayed-quotes">
>>   <result>55.35</result>
>>  </getQuoteResponse>
>> </soapenv:Body>
>></soapenv:Envelope>
>>==============
>>
>>I used a different TCP sniffer, that somehow fixed up the response so my 
>>client did understand it.
>>I then got this response:
>> >>>"Cannot deserialize the requested element"
>>
>>I've attached my WSDL.
>>
>>Thanks
>>Paul
>>
>>    
>>
>>><?xml version="1.0" ?>
>>>      
>>>
>><definitions name="urn:GetQuote" 
>>             targetNamespace="urn:xmltoday-delayed-quotes"
>>             xmlns:tns="urn:xmltoday-delayed-quotes"
>>             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>>             xmlns="http://schemas.xmlsoap.org/wsdl/">
>>
>>  <!-- message declns -->
>>  
>>  <message name="GetQuoteRequest">
>>    <part name="symbol" type="xsd:string"/>
>>  </message>
>>
>>  <message name="GetQuoteResponse">
>>    <part name="result" type="xsd:float"/>
>>  </message>
>>
>>  <!-- port type declns -->
>>  <portType name="GetQuote">
>>    <operation name="getQuote" >
>>      <input  message="tns:GetQuoteRequest"/>
>>      <output message="tns:GetQuoteResponse"/>
>>    </operation>
>>  </portType>
>>
>>  <!-- binding declns -->
>>  <binding name="GetQuoteBinding" type="tns:GetQuote">
>>    <soap:binding style="rpc" 
>>                  transport="http://schemas.xmlsoap.org/soap/http"/>
>>    <operation name="getQuote">
>>      <soap:operation soapAction="GetQuote"/>
>>      <input>
>>        <soap:body use="literal" namespace="urn:xmltoday-delayed-quotes" />
>>      </input>
>>      <output>
>>        <soap:body use="literal" namespace="urn:xmltoday-delayed-quotes" />
>>      </output>
>>    </operation>
>>  </binding>
>>
>>  <!-- service decln -->
>>  <service name="GetQuoteService">
>>    <port name="GetQuote" binding="tns:GetQuoteBinding">
>>      <soap:address location="http://localhost:8080/axis/servlet/AxisServlet"/>
>>    </port>
>>  </service>
>>
>></definitions>
>>
>>    
>>
>
>
>
>		
>__________________________________
>Do you Yahoo!?
>Take Yahoo! Mail with you! Get it on your mobile phone.
>http://mobile.yahoo.com/maildemo 
>
>  
>


Re: Transport issues

Posted by Samisa Abeysinghe <sa...@yahoo.com>.
The fix for the axis2 transport to solve the problem is now in CVS.
I think it is not possible to include this in 1.3 release as the binaries are already packaged.

Samisa...

--- Samisa Abeysinghe <sa...@yahoo.com> wrote:

> Hi Paul,
>    I generated the client side C++ code for given WSDL and in GetQuote.cpp, within the method
> GetQuote::getQuote it has:
> if(AXIS_SUCCESS == m_pCall->checkMessage("GetQuoteResponse", "urn:xmltoday-delayed-quotes"))
> 
> However, if you look at the response it has:
>    <getQuoteResponse xmlns="urn:xmltoday-delayed-quotes">
> 
> Hence the deserialization problem comes because of the case difference (GetQuoteResponse vs.
> getQuoteResponse) In fact the WSDL says it should be "GetQuoteResponse", hence one cannot blame
> generated C++ code.
> 
> Transport problem:
> This seems to be due to a bug in header reading. I have the following logic:
>             m_Channel >> m_strReceived;
>             if (!m_bReadPastHTTPHeaders)
>             {
>                 do
>                 {
>                     if (m_strReceived.find ("\r\n\r\n") == std::string::npos)
>                         m_Channel >> m_strReceived;    // Assume non blocking here
>                 }
>                 while (m_strReceived.find ("\r\n\r\n") == std::string::npos);
> 
> If I do not get "\r\n\r\n", I seem to overwrite the current buffer - that is a bug.
> I will fix this in CVS. (This was not revealed in our testing as we in most cases read past the
> HTTP header in one go. In your case it would have read the HTTP header using than one read from
> channel)
> 
> Thanks,
> Samisa...
> 
> --- Paul Fremantle <pz...@hursley.ibm.com> wrote:
> 
> > I'm trying out Axis 1.3 CPP to Axis Java. Both on Windows. I downloaded 
> > the binary. I've tried both expat and xerces.
> > 
> > I've got two problems....
> > 
> > One is when I go direct or through Axis Java TCPMON.
> > "AxisTransportException:Unknow HTTP response, cannot process response 
> > message Protocol is not HTTP."
> > 
> >  >>>>Here is the HTTP response message:
> > ==============
> > Listen Port: 8080
> > Target Host: localhost
> > Target Port: 9080
> > ==== Request ====
> > POST /axis/servlet/AxisServlet HTTP/1.1
> > Host: localhost:8080
> > Content-Type: text/xml; charset=UTF-8
> > SOAPAction: "GetQuote"
> > Content-Length: 378
> > 
> > <?xml version='1.0' encoding='utf-8' ?><SOAP-ENV:Envelope 
> > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:getQuote 
> > xmlns:ns1="urn:xmltoday-delayed-quotes"><symbol 
> > xsi:type="xsd:string">XXX</symbol></ns1:getQuote></SOAP-ENV:Body></SOAP-ENV:Envelope>==== 
> > Response ====
> > HTTP/1.0 200 OK
> > Content-Type: text/xml; charset=utf-8
> > 
> > <?xml version="1.0" encoding="UTF-8"?>
> > <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>
> >   <getQuoteResponse xmlns="urn:xmltoday-delayed-quotes">
> >    <result>55.35</result>
> >   </getQuoteResponse>
> >  </soapenv:Body>
> > </soapenv:Envelope>
> > ==============
> > 
> > I used a different TCP sniffer, that somehow fixed up the response so my 
> > client did understand it.
> > I then got this response:
> >  >>>"Cannot deserialize the requested element"
> > 
> > I've attached my WSDL.
> > 
> > Thanks
> > Paul
> > 
> > > <?xml version="1.0" ?>
> > 
> > <definitions name="urn:GetQuote" 
> >              targetNamespace="urn:xmltoday-delayed-quotes"
> >              xmlns:tns="urn:xmltoday-delayed-quotes"
> >              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >              xmlns="http://schemas.xmlsoap.org/wsdl/">
> > 
> >   <!-- message declns -->
> >   
> >   <message name="GetQuoteRequest">
> >     <part name="symbol" type="xsd:string"/>
> >   </message>
> > 
> >   <message name="GetQuoteResponse">
> >     <part name="result" type="xsd:float"/>
> >   </message>
> > 
> >   <!-- port type declns -->
> >   <portType name="GetQuote">
> >     <operation name="getQuote" >
> >       <input  message="tns:GetQuoteRequest"/>
> >       <output message="tns:GetQuoteResponse"/>
> >     </operation>
> >   </portType>
> > 
> >   <!-- binding declns -->
> >   <binding name="GetQuoteBinding" type="tns:GetQuote">
> >     <soap:binding style="rpc" 
> >                   transport="http://schemas.xmlsoap.org/soap/http"/>
> >     <operation name="getQuote">
> >       <soap:operation soapAction="GetQuote"/>
> >       <input>
> >         <soap:body use="literal" namespace="urn:xmltoday-delayed-quotes" />
> >       </input>
> >       <output>
> >         <soap:body use="literal" namespace="urn:xmltoday-delayed-quotes" />
> >       </output>
> >     </operation>
> >   </binding>
> > 
> >   <!-- service decln -->
> >   <service name="GetQuoteService">
> >     <port name="GetQuote" binding="tns:GetQuoteBinding">
> >       <soap:address location="http://localhost:8080/axis/servlet/AxisServlet"/>
> >     </port>
> >   </service>
> > 
> > </definitions>
> > 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> http://mobile.yahoo.com/maildemo 
> 



		
_______________________________
Do you Yahoo!?
Express yourself with Y! Messenger! Free. Download now. 
http://messenger.yahoo.com

Re: Transport issues

Posted by Samisa Abeysinghe <sa...@yahoo.com>.
Hi Paul,
   I generated the client side C++ code for given WSDL and in GetQuote.cpp, within the method
GetQuote::getQuote it has:
if(AXIS_SUCCESS == m_pCall->checkMessage("GetQuoteResponse", "urn:xmltoday-delayed-quotes"))

However, if you look at the response it has:
   <getQuoteResponse xmlns="urn:xmltoday-delayed-quotes">

Hence the deserialization problem comes because of the case difference (GetQuoteResponse vs.
getQuoteResponse) In fact the WSDL says it should be "GetQuoteResponse", hence one cannot blame
generated C++ code.

Transport problem:
This seems to be due to a bug in header reading. I have the following logic:
            m_Channel >> m_strReceived;
            if (!m_bReadPastHTTPHeaders)
            {
                do
                {
                    if (m_strReceived.find ("\r\n\r\n") == std::string::npos)
                        m_Channel >> m_strReceived;    // Assume non blocking here
                }
                while (m_strReceived.find ("\r\n\r\n") == std::string::npos);

If I do not get "\r\n\r\n", I seem to overwrite the current buffer - that is a bug.
I will fix this in CVS. (This was not revealed in our testing as we in most cases read past the
HTTP header in one go. In your case it would have read the HTTP header using than one read from
channel)

Thanks,
Samisa...

--- Paul Fremantle <pz...@hursley.ibm.com> wrote:

> I'm trying out Axis 1.3 CPP to Axis Java. Both on Windows. I downloaded 
> the binary. I've tried both expat and xerces.
> 
> I've got two problems....
> 
> One is when I go direct or through Axis Java TCPMON.
> "AxisTransportException:Unknow HTTP response, cannot process response 
> message Protocol is not HTTP."
> 
>  >>>>Here is the HTTP response message:
> ==============
> Listen Port: 8080
> Target Host: localhost
> Target Port: 9080
> ==== Request ====
> POST /axis/servlet/AxisServlet HTTP/1.1
> Host: localhost:8080
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: "GetQuote"
> Content-Length: 378
> 
> <?xml version='1.0' encoding='utf-8' ?><SOAP-ENV:Envelope 
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:getQuote 
> xmlns:ns1="urn:xmltoday-delayed-quotes"><symbol 
> xsi:type="xsd:string">XXX</symbol></ns1:getQuote></SOAP-ENV:Body></SOAP-ENV:Envelope>==== 
> Response ====
> HTTP/1.0 200 OK
> Content-Type: text/xml; charset=utf-8
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
>   <getQuoteResponse xmlns="urn:xmltoday-delayed-quotes">
>    <result>55.35</result>
>   </getQuoteResponse>
>  </soapenv:Body>
> </soapenv:Envelope>
> ==============
> 
> I used a different TCP sniffer, that somehow fixed up the response so my 
> client did understand it.
> I then got this response:
>  >>>"Cannot deserialize the requested element"
> 
> I've attached my WSDL.
> 
> Thanks
> Paul
> 
> > <?xml version="1.0" ?>
> 
> <definitions name="urn:GetQuote" 
>              targetNamespace="urn:xmltoday-delayed-quotes"
>              xmlns:tns="urn:xmltoday-delayed-quotes"
>              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>              xmlns="http://schemas.xmlsoap.org/wsdl/">
> 
>   <!-- message declns -->
>   
>   <message name="GetQuoteRequest">
>     <part name="symbol" type="xsd:string"/>
>   </message>
> 
>   <message name="GetQuoteResponse">
>     <part name="result" type="xsd:float"/>
>   </message>
> 
>   <!-- port type declns -->
>   <portType name="GetQuote">
>     <operation name="getQuote" >
>       <input  message="tns:GetQuoteRequest"/>
>       <output message="tns:GetQuoteResponse"/>
>     </operation>
>   </portType>
> 
>   <!-- binding declns -->
>   <binding name="GetQuoteBinding" type="tns:GetQuote">
>     <soap:binding style="rpc" 
>                   transport="http://schemas.xmlsoap.org/soap/http"/>
>     <operation name="getQuote">
>       <soap:operation soapAction="GetQuote"/>
>       <input>
>         <soap:body use="literal" namespace="urn:xmltoday-delayed-quotes" />
>       </input>
>       <output>
>         <soap:body use="literal" namespace="urn:xmltoday-delayed-quotes" />
>       </output>
>     </operation>
>   </binding>
> 
>   <!-- service decln -->
>   <service name="GetQuoteService">
>     <port name="GetQuote" binding="tns:GetQuoteBinding">
>       <soap:address location="http://localhost:8080/axis/servlet/AxisServlet"/>
>     </port>
>   </service>
> 
> </definitions>
> 



		
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo 

Re: Transport issues

Posted by John Hawkins <HA...@uk.ibm.com>.



Andrew - do we get this when we are running our tests?

John Hawkins




                                                                           
             Paul Fremantle                                                
             <pzf@hursley.ibm.                                             
             com>                                                       To 
                                       Apache AXIS C Developers List       
             27/10/2004 02:09          <ax...@ws.apache.org>          
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
              "Apache AXIS C           Transport issues                    
             Developers List"                                              
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




I'm trying out Axis 1.3 CPP to Axis Java. Both on Windows. I downloaded
the binary. I've tried both expat and xerces.

I've got two problems....

One is when I go direct or through Axis Java TCPMON.
"AxisTransportException:Unknow HTTP response, cannot process response
message Protocol is not HTTP."

 >>>>Here is the HTTP response message:
==============
Listen Port: 8080
Target Host: localhost
Target Port: 9080
==== Request ====
POST /axis/servlet/AxisServlet HTTP/1.1
Host: localhost:8080
Content-Type: text/xml; charset=UTF-8
SOAPAction: "GetQuote"
Content-Length: 378

<?xml version='1.0' encoding='utf-8' ?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
"><SOAP-ENV:Body><ns1:getQuote
xmlns:ns1="urn:xmltoday-delayed-quotes"><symbol
xsi:type="xsd:string">XXX</symbol></ns1:getQuote></SOAP-ENV:Body></SOAP-ENV:Envelope>====

Response ====
HTTP/1.0 200 OK
Content-Type: text/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<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>
  <getQuoteResponse xmlns="urn:xmltoday-delayed-quotes">
   <result>55.35</result>
  </getQuoteResponse>
 </soapenv:Body>
</soapenv:Envelope>
==============

I used a different TCP sniffer, that somehow fixed up the response so my
client did understand it.
I then got this response:
 >>>"Cannot deserialize the requested element"

I've attached my WSDL.

Thanks
Paul

<?xml version="1.0" ?>

<definitions name="urn:GetQuote"
             targetNamespace="urn:xmltoday-delayed-quotes"
             xmlns:tns="urn:xmltoday-delayed-quotes"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns="http://schemas.xmlsoap.org/wsdl/">

  <!-- message declns -->

  <message name="GetQuoteRequest">
    <part name="symbol" type="xsd:string"/>
  </message>

  <message name="GetQuoteResponse">
    <part name="result" type="xsd:float"/>
  </message>

  <!-- port type declns -->
  <portType name="GetQuote">
    <operation name="getQuote" >
      <input  message="tns:GetQuoteRequest"/>
      <output message="tns:GetQuoteResponse"/>
    </operation>
  </portType>

  <!-- binding declns -->
  <binding name="GetQuoteBinding" type="tns:GetQuote">
    <soap:binding style="rpc"
                  transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="getQuote">
      <soap:operation soapAction="GetQuote"/>
      <input>
        <soap:body use="literal" namespace="urn:xmltoday-delayed-quotes" />
      </input>
      <output>
        <soap:body use="literal" namespace="urn:xmltoday-delayed-quotes" />
      </output>
    </operation>
  </binding>

  <!-- service decln -->
  <service name="GetQuoteService">
    <port name="GetQuote" binding="tns:GetQuoteBinding">
      <soap:address location="
http://localhost:8080/axis/servlet/AxisServlet"/>
    </port>
  </service>

</definitions>