Re: Newbie questions and some weird behavior

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Newbie questions and some weird behavior

Samisa Abeysinghe
You could test this with simple axis server and debug the same on Linux
with gdb.

I have written a small help file to let you know how to get simple axis
server up and running on Windows. I hope you could adopt this to Linux.
I have it http://people.apache.org/~samisa/SimpleAxisServer_HOWTO.txt
for the time being, till I check the rest of the docs and commit this to
CVS.

Will have a look at you wsdl and see if I could get it working. Please
try simple axis server in the mean time.

Thanks,
Samisa...

On Wed, 2005-05-04 at 16:56, Yampolsky, Robert wrote:

> I'm an axis newbie, and am having trouble getting my first service to
> work.  I am able to build and deploy a simple MD5Service I found on
> the web, so I think my axis and apache installations are working ok.
> It's axiscpp 1.5 and apache 2.0.46 (RHEL 3.0).  I installed axiscpp
> from pre-built binaries in the default /usr/local/axiscpp_deploy
> directory.
>
> I've included the server.wsdd entry and wsdl file below in case I'm
> just doing this all wrong.  Thanks in advance for putting up with my
> (probably clueless) questions.  I've been trying to educate myself on
> this via Google, etc, and have found some good docs, but still can't
> get it to work.
>
> Anyway, at one point today (after restarting Apache, this went away),
> I would run my client repeatedly and get one of the following
> exceptions (wierdly, the exception would change without any changes to
> the code):
>
> Exception : Soap method is not allowed to invoke
>         (I read in this list that this is caused by a missing
> SoapAction, but it's there in my wsdl and in the generated code)
>
> Exception : Requested service is not registerd at the server
>         (I originally had CPP:RPC, which I figured was causing this -
> since my binding style is document, but I still got it sometimes)
>
> Exception : Soap content is not valid
>         (your guess is as good as mine - I don't know yet if my soap
> content's any good)
>
>
> After restarting apache, the service seems to run.  At least the
> client doesn't log any exceptions, but I get an empty response from
> the service (null pointers for all the return values).  Not knowing
> how to debug the service, I tried having it open a file and log info
> there.  But when I add code to my server to do that, I get the
> following exception on running my client:
>
> Exception : HTTPTransportException:Input streaming error while getting
> data Timed out waiting for HTTP header message (1).
>
> This exception occurs immediately, so I don't know how it could be a
> timeout condition.
>
> For yucks, I tried replacing the fopen and fprintf's with a simple
> sprintf to a character buffer and got the same exception.  When I
> comment out all the logging code the service seems to 'work' again
> (with null return values).  At least that gives some kind of
> indication that my server is indeed running.
>
> So, my main question is, how are you supposed to debug axiscpp
> services?  Is the simple_axis_server thing supposed to facilitate
> this?  If so, any instructions?
>
>
> Some other questions:
>
> 1. Even though I've got complex types as the inputs and outputs of my
> service, xwsdl2ws generates methods that take all of the fields from
> the complex types as individual parameters (rather than passing and
> returning a structure).  When I changed my binding style to "rpc", I
> got structure-based methods generated.  Is that just 'the way it
> works', or can I control this?  Is one kind of method better than the
> other (the struct way seems more self-documenting than having
> Value0..7 and OutValue0..5?
>
> 2. When I try to bring up ?wsdl URL's for my service or the axis
> 'Calculator' sample (http://localhost/axis/calculator?wsdl), Apache
> logs a segfault.  Do I have to explicitly put the wsdl file somewhere
> (or point to it in axiscpp.conf or elsewhere)?
>
>
> ========================
>
> Here's my server.wsdd entry:
>
>         <service name="HUB_TO_HUB" provider="CPP:DOCUMENT"
> description="TVB Hub-to-Hub Service">
>                 <parameter name="allowedMethods" value="Hub_Request
> "/>
>                 <parameter name="className"
> value="/usr/local/axiscpp_deploy/lib/libhub2hub.so" />
>         </service>
>
> Here's the wsdl:
>
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions
>    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
>    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>    xmlns:s="http://www.w3.org/2001/XMLSchema"
>    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>    xmlns:tns="http://localhost/axis/HUB_TO_HUB"
>    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
>    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>    targetNamespace="http://localhost/axis/HUB_TO_HUB"
>    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
>
>   <wsdl:types>
>     <s:schema elementFormDefault="qualified"
> targetNamespace="http://localhost/axis/HUB_TO_HUB">
>       <s:element name="Hub_Request" type="tns:HUB_IN" />
>       <s:complexType name="HUB_IN">
>         <s:sequence>
>           <s:element minOccurs="0" maxOccurs="1" name="TO_TP"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="FROM_TP"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="TO_HUB"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="FROM_HUB"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="UID"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="APIKEY"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="ROUTING"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="MESSAGE"
> type="s:string" />
>         </s:sequence>
>       </s:complexType>
>     </s:schema>
>     <s:schema elementFormDefault="qualified">
>       <s:element name="Hub_Response" nillable="true"
> type="tns:MSG_RECPT" />
>       <s:complexType name="MSG_RECPT">
>         <s:sequence>
>           <s:element minOccurs="0" maxOccurs="1" name="UID"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="TO_TP"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="FROM_TP"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="STATUS"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="STATUS_MSG"
> type="s:string" />
>           <s:element minOccurs="0" maxOccurs="1" name="TIMESTAMP"
> type="s:string" />
>         </s:sequence>
>       </s:complexType>
>     </s:schema>
>   </wsdl:types>
>
>   <wsdl:message name="Hub_RequestIn">
>
>   <wsdl:message name="Hub_RequestIn">
>     <wsdl:part name="Hub_Request" element="tns:Hub_Request" />
>   </wsdl:message>
>   <wsdl:message name="Hub_RequestOut">
>     <wsdl:part name="Hub_Response" element="tns:Hub_Response" />
>   </wsdl:message>
>
>   <wsdl:portType name="HUB_TO_HUB">
>     <wsdl:operation name="Hub_Request">
>       <wsdl:input message="tns:Hub_RequestIn" />
>       <wsdl:output message="tns:Hub_RequestOut" />
>     </wsdl:operation>
>   </wsdl:portType>
>
>   <wsdl:binding name="HUB_TO_HUBSoap" type="tns:HUB_TO_HUB">
>     <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> style="document" />
>     <wsdl:operation name="Hub_Request">
>       <soap:operation soapAction="HUB_TO_HUB#Hub_Request"
> style="document" />
>       <wsdl:input>
>         <soap:body use="literal" />
>       </wsdl:input>
>       <wsdl:output>
>         <soap:body use="literal" />
>       </wsdl:output>
>     </wsdl:operation>
>   </wsdl:binding>
>
>   <wsdl:service name="HUB_TO_HUB">
>     <wsdl:port name="HUB_TO_HUB" binding="tns:HUB_TO_HUBSoap">
>       <soap:address location="http://localhost/axis/HUB_TO_HUB" />
>     </wsdl:port>
>   </wsdl:service>
> </wsdl:definitions>
>
> R o b   Y a m p o l s k y
> Harris Corporation
> [hidden email]
> (212) 303 - 4250
--
Samisa Abeysinghe <[hidden email]>
Virtusa Corporation
Reply | Threaded
Open this post in threaded view
|

Re: Newbie questions and some weird behavior

Samisa Abeysinghe
I have added this how to content for windows into the win install guide
and commited this into cvs.
Please see
http://cvs.apache.org/viewcvs.cgi/*checkout*/ws-axis/c/docs/wininstall-guide.html#simpleaxis

Plan to update the Linux guide as well.

Thanks,
Samisa...

On Thu, 2005-05-05 at 14:05, Samisa Abeysinghe wrote:

> You could test this with simple axis server and debug the same on Linux
> with gdb.
>
> I have written a small help file to let you know how to get simple axis
> server up and running on Windows. I hope you could adopt this to Linux.
> I have it http://people.apache.org/~samisa/SimpleAxisServer_HOWTO.txt
> for the time being, till I check the rest of the docs and commit this to
> CVS.
>
> Will have a look at you wsdl and see if I could get it working. Please
> try simple axis server in the mean time.
>
> Thanks,
> Samisa...
>
> On Wed, 2005-05-04 at 16:56, Yampolsky, Robert wrote:
> > I'm an axis newbie, and am having trouble getting my first service to
> > work.  I am able to build and deploy a simple MD5Service I found on
> > the web, so I think my axis and apache installations are working ok.
> > It's axiscpp 1.5 and apache 2.0.46 (RHEL 3.0).  I installed axiscpp
> > from pre-built binaries in the default /usr/local/axiscpp_deploy
> > directory.
> >
> > I've included the server.wsdd entry and wsdl file below in case I'm
> > just doing this all wrong.  Thanks in advance for putting up with my
> > (probably clueless) questions.  I've been trying to educate myself on
> > this via Google, etc, and have found some good docs, but still can't
> > get it to work.
> >
> > Anyway, at one point today (after restarting Apache, this went away),
> > I would run my client repeatedly and get one of the following
> > exceptions (wierdly, the exception would change without any changes to
> > the code):
> >
> > Exception : Soap method is not allowed to invoke
> >         (I read in this list that this is caused by a missing
> > SoapAction, but it's there in my wsdl and in the generated code)
> >
> > Exception : Requested service is not registerd at the server
> >         (I originally had CPP:RPC, which I figured was causing this -
> > since my binding style is document, but I still got it sometimes)
> >
> > Exception : Soap content is not valid
> >         (your guess is as good as mine - I don't know yet if my soap
> > content's any good)
> >
> >
> > After restarting apache, the service seems to run.  At least the
> > client doesn't log any exceptions, but I get an empty response from
> > the service (null pointers for all the return values).  Not knowing
> > how to debug the service, I tried having it open a file and log info
> > there.  But when I add code to my server to do that, I get the
> > following exception on running my client:
> >
> > Exception : HTTPTransportException:Input streaming error while getting
> > data Timed out waiting for HTTP header message (1).
> >
> > This exception occurs immediately, so I don't know how it could be a
> > timeout condition.
> >
> > For yucks, I tried replacing the fopen and fprintf's with a simple
> > sprintf to a character buffer and got the same exception.  When I
> > comment out all the logging code the service seems to 'work' again
> > (with null return values).  At least that gives some kind of
> > indication that my server is indeed running.
> >
> > So, my main question is, how are you supposed to debug axiscpp
> > services?  Is the simple_axis_server thing supposed to facilitate
> > this?  If so, any instructions?
> >
> >
> > Some other questions:
> >
> > 1. Even though I've got complex types as the inputs and outputs of my
> > service, xwsdl2ws generates methods that take all of the fields from
> > the complex types as individual parameters (rather than passing and
> > returning a structure).  When I changed my binding style to "rpc", I
> > got structure-based methods generated.  Is that just 'the way it
> > works', or can I control this?  Is one kind of method better than the
> > other (the struct way seems more self-documenting than having
> > Value0..7 and OutValue0..5?
> >
> > 2. When I try to bring up ?wsdl URL's for my service or the axis
> > 'Calculator' sample (http://localhost/axis/calculator?wsdl), Apache
> > logs a segfault.  Do I have to explicitly put the wsdl file somewhere
> > (or point to it in axiscpp.conf or elsewhere)?
> >
> >
> > ========================
> >
> > Here's my server.wsdd entry:
> >
> >         <service name="HUB_TO_HUB" provider="CPP:DOCUMENT"
> > description="TVB Hub-to-Hub Service">
> >                 <parameter name="allowedMethods" value="Hub_Request
> > "/>
> >                 <parameter name="className"
> > value="/usr/local/axiscpp_deploy/lib/libhub2hub.so" />
> >         </service>
> >
> > Here's the wsdl:
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <wsdl:definitions
> >    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> >    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >    xmlns:s="http://www.w3.org/2001/XMLSchema"
> >    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> >    xmlns:tns="http://localhost/axis/HUB_TO_HUB"
> >    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
> >    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> >    targetNamespace="http://localhost/axis/HUB_TO_HUB"
> >    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
> >
> >   <wsdl:types>
> >     <s:schema elementFormDefault="qualified"
> > targetNamespace="http://localhost/axis/HUB_TO_HUB">
> >       <s:element name="Hub_Request" type="tns:HUB_IN" />
> >       <s:complexType name="HUB_IN">
> >         <s:sequence>
> >           <s:element minOccurs="0" maxOccurs="1" name="TO_TP"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="FROM_TP"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="TO_HUB"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="FROM_HUB"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="UID"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="APIKEY"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="ROUTING"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="MESSAGE"
> > type="s:string" />
> >         </s:sequence>
> >       </s:complexType>
> >     </s:schema>
> >     <s:schema elementFormDefault="qualified">
> >       <s:element name="Hub_Response" nillable="true"
> > type="tns:MSG_RECPT" />
> >       <s:complexType name="MSG_RECPT">
> >         <s:sequence>
> >           <s:element minOccurs="0" maxOccurs="1" name="UID"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="TO_TP"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="FROM_TP"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="STATUS"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="STATUS_MSG"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="TIMESTAMP"
> > type="s:string" />
> >         </s:sequence>
> >       </s:complexType>
> >     </s:schema>
> >   </wsdl:types>
> >
> >   <wsdl:message name="Hub_RequestIn">
> >
> >   <wsdl:message name="Hub_RequestIn">
> >     <wsdl:part name="Hub_Request" element="tns:Hub_Request" />
> >   </wsdl:message>
> >   <wsdl:message name="Hub_RequestOut">
> >     <wsdl:part name="Hub_Response" element="tns:Hub_Response" />
> >   </wsdl:message>
> >
> >   <wsdl:portType name="HUB_TO_HUB">
> >     <wsdl:operation name="Hub_Request">
> >       <wsdl:input message="tns:Hub_RequestIn" />
> >       <wsdl:output message="tns:Hub_RequestOut" />
> >     </wsdl:operation>
> >   </wsdl:portType>
> >
> >   <wsdl:binding name="HUB_TO_HUBSoap" type="tns:HUB_TO_HUB">
> >     <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> > style="document" />
> >     <wsdl:operation name="Hub_Request">
> >       <soap:operation soapAction="HUB_TO_HUB#Hub_Request"
> > style="document" />
> >       <wsdl:input>
> >         <soap:body use="literal" />
> >       </wsdl:input>
> >       <wsdl:output>
> >         <soap:body use="literal" />
> >       </wsdl:output>
> >     </wsdl:operation>
> >   </wsdl:binding>
> >
> >   <wsdl:service name="HUB_TO_HUB">
> >     <wsdl:port name="HUB_TO_HUB" binding="tns:HUB_TO_HUBSoap">
> >       <soap:address location="http://localhost/axis/HUB_TO_HUB" />
> >     </wsdl:port>
> >   </wsdl:service>
> > </wsdl:definitions>
> >
> > R o b   Y a m p o l s k y
> > Harris Corporation
> > [hidden email]
> > (212) 303 - 4250
--
Samisa Abeysinghe <[hidden email]>
Virtusa Corporation
Reply | Threaded
Open this post in threaded view
|

RE: Newbie questions and some weird behavior

Yampolsky, Robert
In reply to this post by Samisa Abeysinghe
> Will have a look at you wsdl and see if I could get it working. Please
> try simple axis server in the mean time.
>
> Thanks,
> Samisa...
>

Thanks.  I tried simple axis server with gdb, and was able to debug my
server.  It now is able to log its inputs and outputs, and they look
basically right.  But the client still gets null pointers for all of the
results.

Then I used tcpdump to look at the SOAP that was passed back and forth.
I've included it below.
It looks like the input is correct, but the response is screwed up.
Instead of what I expect to get:
        <MSG_RECPT>
                <UID>....</UID>
                <TO_TP>....</TO_TP>
                etc.
        </MSG_RECPT>

I'm getting:
        <MSG_RECPT>UID>....</MSG_RECPT>UID>
        <MSG_RECPT>TO_TP>....</MSG_RECPT>TO_TP>
        etc.

Also, the data between the bad XML tags is garbage.  Interestingly, I
get binary garbage that grows by 4 bytes for each subsequent result
'string'.

Anyway, progress.

Here's the TCP dump of the SOAP:

POST /axis/HUB_TO_HUB HTTP/11  Host: 172 1648 246:80
Content-Type: text/xml; charset=UTF-8
SOAPAction: "HUB_TO_HUB#Hub_Request"  Content-Length: 571

<?xml version='1 0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas xmlsoap
org/soap/envelope/"
xmlns:xsd="http://wwww3 org/2001/XMLSchema"
xmlns:xsi="http://www w3 org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:Hub_Request xmlns:ns1="http://localhost/axis/HUB_TO_HUB">
<ns1:TO_TP>A</ns1:TO_TP>
<ns1:FROM_TP>B</ns1:FROM_TP>
<ns1:TO_HUB>C</ns1:TO_HUB>
<ns1:FROM_HUB>E</ns1:FROM_HUB>
<ns1:UID>F</ns1:UID>
<ns1:APIKEY>G</ns1:APIKEY>
<ns1:ROUTING></ns1:ROUTING>
<ns1:MESSAGE></ns1:MESSAGE>
</ns1:Hub_Request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

HTTP/1 1 200 OK  Date: Thu, 05 May 2005 18:26:37 GMT
Server: Apache/2 0 46 (Red Hat)  Content-Length: 689
Connection: close  Content-Type: text/xml
<?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:Hub_Response
xmlns:ns1="http://localhost/axis/HUB_TO_HUB">
<MSG_RECPT>UID>....</MSG_RECPT>UID>
<MSG_RECPT>TO_TP>........</MSG_RECPT>TO_TP>
<MSG_RECPT>FROM_TP>............</MSG_RECPT>FROM_TP>
<MSG_RECPT>STATUS>&amp................</MSG_RECPT>STATUS>
<MSG_RECPT>STATUS_MSG>....&amp................</MSG_RECPT>STATUS_MSG>
<MSG_RECPT>TIMESTAMP>.....&amp...................</MSG_RECPT>TIMESTAMP>
</ns1:Hub_Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


 

> > ========================
> >
> > Here's my server.wsdd entry:
> >
> >         <service name="HUB_TO_HUB" provider="CPP:DOCUMENT"
> > description="TVB Hub-to-Hub Service">
> >                 <parameter name="allowedMethods" value="Hub_Request
> > "/>
> >                 <parameter name="className"
> > value="/usr/local/axiscpp_deploy/lib/libhub2hub.so" />
> >         </service>
> >
> > Here's the wsdl:
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <wsdl:definitions
> >    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> >    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >    xmlns:s="http://www.w3.org/2001/XMLSchema"
> >    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> >    xmlns:tns="http://localhost/axis/HUB_TO_HUB"
> >    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
> >    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> >    targetNamespace="http://localhost/axis/HUB_TO_HUB"
> >    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
> >
> >   <wsdl:types>
> >     <s:schema elementFormDefault="qualified"
> > targetNamespace="http://localhost/axis/HUB_TO_HUB">
> >       <s:element name="Hub_Request" type="tns:HUB_IN" />
> >       <s:complexType name="HUB_IN">
> >         <s:sequence>
> >           <s:element minOccurs="0" maxOccurs="1" name="TO_TP"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="FROM_TP"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="TO_HUB"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="FROM_HUB"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="UID"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="APIKEY"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="ROUTING"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="MESSAGE"
> > type="s:string" />
> >         </s:sequence>
> >       </s:complexType>
> >     </s:schema>
> >     <s:schema elementFormDefault="qualified">
> >       <s:element name="Hub_Response" nillable="true"
> > type="tns:MSG_RECPT" />
> >       <s:complexType name="MSG_RECPT">
> >         <s:sequence>
> >           <s:element minOccurs="0" maxOccurs="1" name="UID"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="TO_TP"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="FROM_TP"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="STATUS"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="STATUS_MSG"
> > type="s:string" />
> >           <s:element minOccurs="0" maxOccurs="1" name="TIMESTAMP"
> > type="s:string" />
> >         </s:sequence>
> >       </s:complexType>
> >     </s:schema>
> >   </wsdl:types>
> >
> >   <wsdl:message name="Hub_RequestIn">
> >
> >   <wsdl:message name="Hub_RequestIn">
> >     <wsdl:part name="Hub_Request" element="tns:Hub_Request" />
> >   </wsdl:message>
> >   <wsdl:message name="Hub_RequestOut">
> >     <wsdl:part name="Hub_Response" element="tns:Hub_Response" />
> >   </wsdl:message>
> >
> >   <wsdl:portType name="HUB_TO_HUB">
> >     <wsdl:operation name="Hub_Request">
> >       <wsdl:input message="tns:Hub_RequestIn" />
> >       <wsdl:output message="tns:Hub_RequestOut" />
> >     </wsdl:operation>
> >   </wsdl:portType>
> >
> >   <wsdl:binding name="HUB_TO_HUBSoap" type="tns:HUB_TO_HUB">
> >     <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> > style="document" />
> >     <wsdl:operation name="Hub_Request">
> >       <soap:operation soapAction="HUB_TO_HUB#Hub_Request"
> > style="document" />
> >       <wsdl:input>
> >         <soap:body use="literal" />
> >       </wsdl:input>
> >       <wsdl:output>
> >         <soap:body use="literal" />
> >       </wsdl:output>
> >     </wsdl:operation>
> >   </wsdl:binding>
> >
> >   <wsdl:service name="HUB_TO_HUB">
> >     <wsdl:port name="HUB_TO_HUB" binding="tns:HUB_TO_HUBSoap">
> >       <soap:address location="http://localhost/axis/HUB_TO_HUB" />
> >     </wsdl:port>
> >   </wsdl:service>
> > </wsdl:definitions>
> >
Reply | Threaded
Open this post in threaded view
|

RE: Newbie questions and some weird behavior

Samisa Abeysinghe
Looks to me as if there are serialization problems on the server side.
I guess this is something to do with errors in the manipulation of the
pointer data members of the class being serialized by server for
response.

One thing to figure out is to know whether the error is in generated
code or in the user written code. Will have to generate the code and
see.

Thanks,
Samisa...

On Thu, 2005-05-05 at 19:09, Yampolsky, Robert wrote:

> > Will have a look at you wsdl and see if I could get it working. Please
> > try simple axis server in the mean time.
> >
> > Thanks,
> > Samisa...
> >
>
> Thanks.  I tried simple axis server with gdb, and was able to debug my
> server.  It now is able to log its inputs and outputs, and they look
> basically right.  But the client still gets null pointers for all of the
> results.
>
> Then I used tcpdump to look at the SOAP that was passed back and forth.
> I've included it below.
> It looks like the input is correct, but the response is screwed up.
> Instead of what I expect to get:
> <MSG_RECPT>
> <UID>....</UID>
> <TO_TP>....</TO_TP>
> etc.
> </MSG_RECPT>
>
> I'm getting:
> <MSG_RECPT>UID>....</MSG_RECPT>UID>
> <MSG_RECPT>TO_TP>....</MSG_RECPT>TO_TP>
> etc.
>
> Also, the data between the bad XML tags is garbage.  Interestingly, I
> get binary garbage that grows by 4 bytes for each subsequent result
> 'string'.
>
> Anyway, progress.
>
> Here's the TCP dump of the SOAP:
>
> POST /axis/HUB_TO_HUB HTTP/11  Host: 172 1648 246:80
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: "HUB_TO_HUB#Hub_Request"  Content-Length: 571
>
> <?xml version='1 0' encoding='utf-8' ?>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas xmlsoap
> org/soap/envelope/"
> xmlns:xsd="http://wwww3 org/2001/XMLSchema"
> xmlns:xsi="http://www w3 org/2001/XMLSchema-instance">
> <SOAP-ENV:Body>
> <ns1:Hub_Request xmlns:ns1="http://localhost/axis/HUB_TO_HUB">
> <ns1:TO_TP>A</ns1:TO_TP>
> <ns1:FROM_TP>B</ns1:FROM_TP>
> <ns1:TO_HUB>C</ns1:TO_HUB>
> <ns1:FROM_HUB>E</ns1:FROM_HUB>
> <ns1:UID>F</ns1:UID>
> <ns1:APIKEY>G</ns1:APIKEY>
> <ns1:ROUTING></ns1:ROUTING>
> <ns1:MESSAGE></ns1:MESSAGE>
> </ns1:Hub_Request>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> HTTP/1 1 200 OK  Date: Thu, 05 May 2005 18:26:37 GMT
> Server: Apache/2 0 46 (Red Hat)  Content-Length: 689
> Connection: close  Content-Type: text/xml
> <?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:Hub_Response
> xmlns:ns1="http://localhost/axis/HUB_TO_HUB">
> <MSG_RECPT>UID>....</MSG_RECPT>UID>
> <MSG_RECPT>TO_TP>........</MSG_RECPT>TO_TP>
> <MSG_RECPT>FROM_TP>............</MSG_RECPT>FROM_TP>
> <MSG_RECPT>STATUS>&amp................</MSG_RECPT>STATUS>
> <MSG_RECPT>STATUS_MSG>....&amp................</MSG_RECPT>STATUS_MSG>
> <MSG_RECPT>TIMESTAMP>.....&amp...................</MSG_RECPT>TIMESTAMP>
> </ns1:Hub_Response>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
>
>  
> > > ========================
> > >
> > > Here's my server.wsdd entry:
> > >
> > >         <service name="HUB_TO_HUB" provider="CPP:DOCUMENT"
> > > description="TVB Hub-to-Hub Service">
> > >                 <parameter name="allowedMethods" value="Hub_Request
> > > "/>
> > >                 <parameter name="className"
> > > value="/usr/local/axiscpp_deploy/lib/libhub2hub.so" />
> > >         </service>
> > >
> > > Here's the wsdl:
> > >
> > > <?xml version="1.0" encoding="utf-8"?>
> > > <wsdl:definitions
> > >    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> > >    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > >    xmlns:s="http://www.w3.org/2001/XMLSchema"
> > >    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> > >    xmlns:tns="http://localhost/axis/HUB_TO_HUB"
> > >    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
> > >    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> > >    targetNamespace="http://localhost/axis/HUB_TO_HUB"
> > >    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
> > >
> > >   <wsdl:types>
> > >     <s:schema elementFormDefault="qualified"
> > > targetNamespace="http://localhost/axis/HUB_TO_HUB">
> > >       <s:element name="Hub_Request" type="tns:HUB_IN" />
> > >       <s:complexType name="HUB_IN">
> > >         <s:sequence>
> > >           <s:element minOccurs="0" maxOccurs="1" name="TO_TP"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="FROM_TP"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="TO_HUB"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="FROM_HUB"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="UID"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="APIKEY"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="ROUTING"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="MESSAGE"
> > > type="s:string" />
> > >         </s:sequence>
> > >       </s:complexType>
> > >     </s:schema>
> > >     <s:schema elementFormDefault="qualified">
> > >       <s:element name="Hub_Response" nillable="true"
> > > type="tns:MSG_RECPT" />
> > >       <s:complexType name="MSG_RECPT">
> > >         <s:sequence>
> > >           <s:element minOccurs="0" maxOccurs="1" name="UID"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="TO_TP"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="FROM_TP"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="STATUS"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="STATUS_MSG"
> > > type="s:string" />
> > >           <s:element minOccurs="0" maxOccurs="1" name="TIMESTAMP"
> > > type="s:string" />
> > >         </s:sequence>
> > >       </s:complexType>
> > >     </s:schema>
> > >   </wsdl:types>
> > >
> > >   <wsdl:message name="Hub_RequestIn">
> > >
> > >   <wsdl:message name="Hub_RequestIn">
> > >     <wsdl:part name="Hub_Request" element="tns:Hub_Request" />
> > >   </wsdl:message>
> > >   <wsdl:message name="Hub_RequestOut">
> > >     <wsdl:part name="Hub_Response" element="tns:Hub_Response" />
> > >   </wsdl:message>
> > >
> > >   <wsdl:portType name="HUB_TO_HUB">
> > >     <wsdl:operation name="Hub_Request">
> > >       <wsdl:input message="tns:Hub_RequestIn" />
> > >       <wsdl:output message="tns:Hub_RequestOut" />
> > >     </wsdl:operation>
> > >   </wsdl:portType>
> > >
> > >   <wsdl:binding name="HUB_TO_HUBSoap" type="tns:HUB_TO_HUB">
> > >     <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> > > style="document" />
> > >     <wsdl:operation name="Hub_Request">
> > >       <soap:operation soapAction="HUB_TO_HUB#Hub_Request"
> > > style="document" />
> > >       <wsdl:input>
> > >         <soap:body use="literal" />
> > >       </wsdl:input>
> > >       <wsdl:output>
> > >         <soap:body use="literal" />
> > >       </wsdl:output>
> > >     </wsdl:operation>
> > >   </wsdl:binding>
> > >
> > >   <wsdl:service name="HUB_TO_HUB">
> > >     <wsdl:port name="HUB_TO_HUB" binding="tns:HUB_TO_HUBSoap">
> > >       <soap:address location="http://localhost/axis/HUB_TO_HUB" />
> > >     </wsdl:port>
> > >   </wsdl:service>
> > > </wsdl:definitions>
> > >
--
Samisa Abeysinghe <[hidden email]>
Virtusa Corporation
Reply | Threaded
Open this post in threaded view
|

RE: Newbie questions and some weird behavior

Chinthana C. Dinapala
In reply to this post by Samisa Abeysinghe

Hi,

 

I have tested this WSDL and after making some changes in the generated code able to correct the XML tags in server respond.

The generated codes in HUB_TO_HUBWrapper.cpp I have change the followings.

      I have removed MSG_RECPT> part here.

 

 

      pIWSSZ->addOutputParam("UID", (void*)&out0, XSD_STRING);

      pIWSSZ->addOutputParam("TO_TP", (void*)&out1, XSD_STRING);

      pIWSSZ->addOutputParam("FROM_TP", (void*)&out2, XSD_STRING);

      pIWSSZ->addOutputParam("STATUS", (void*)&out3, XSD_STRING);

      pIWSSZ->addOutputParam("STATUS_MSG", (void*)&out4, XSD_STRING);

      pIWSSZ->addOutputParam("TIMESTAMP", (void*)&out5, XSD_STRING);

 

Here following are the SOAP messages after correction.

 

Client request………………………………………………………………………………………………..

 

POST /axis/HUB_TO_HUB HTTP/1.1

Host: 127.0.0.1:8888

Content-Type: text/xml; charset=UTF-8

SOAPAction: "HUB_TO_HUB#Hub_Request"

Content-Length: 608

<?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:Hub_Request xmlns:ns1="http://localhost/axis/HUB_TO_HUB">

<ns1:TO_TP>First</ns1:TO_TP>

<ns1:FROM_TP>Second</ns1:FROM_TP>

<ns1:TO_HUB>Third</ns1:TO_HUB>

<ns1:FROM_HUB>Fourth</ns1:FROM_HUB>

<ns1:UID>Fifth</ns1:UID>

<ns1:APIKEY>Sixth</ns1:APIKEY>

<ns1:ROUTING>Seventh</ns1:ROUTING>

<ns1:MESSAGE>Last</ns1:MESSAGE>

</ns1:Hub_Request>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

Server respond…………………………………………………………………………………………………….

 

HTTP/1.1 200 OK

Date: Fri, 06 May 2005 05:44:10 GMT

Server: Apache/2.0.52 (Win32)

Content-Length: 491

Content-Type: text/xml

<?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:Hub_Response xmlns:ns1="http://localhost/axis/HUB_TO_HUB">

<UID>xø</UID>

<TO_TP>˜ô</TO_TP>

<FROM_TP>`Ž</FROM_TP>

<STATUS>`Ž</STATUS>

<STATUS_MSG> ä</STATUS_MSG>

<TIMESTAMP>˜à’</TIMESTAMP>

</ns1:Hub_Response>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

Thanks

 

Chinthana Dinapala

 

 

 

-----Original Message-----
From: Samisa Abeysinghe [mailto:[hidden email]]
Sent: Friday, May 06, 2005 3:21 PM
To: Apache AXIS C User List
Subject: RE: Newbie questions and some weird behavior

 

Looks to me as if there are serialization problems on the server side.

I guess this is something to do with errors in the manipulation of the

pointer data members of the class being serialized by server for

response.

 

One thing to figure out is to know whether the error is in generated

code or in the user written code. Will have to generate the code and

see.

 

Thanks,

Samisa...

 

On Thu, 2005-05-05 at 19:09, Yampolsky, Robert wrote:

> > Will have a look at you wsdl and see if I could get it working. Please

> > try simple axis server in the mean time.

> >

> > Thanks,

> > Samisa...

> >

>

> Thanks.  I tried simple axis server with gdb, and was able to debug my

> server.  It now is able to log its inputs and outputs, and they look

> basically right.  But the client still gets null pointers for all of the

> results.

>

> Then I used tcpdump to look at the SOAP that was passed back and forth.

> I've included it below.

> It looks like the input is correct, but the response is screwed up.

> Instead of what I expect to get:

>     <MSG_RECPT>

>           <UID>....</UID>

>           <TO_TP>....</TO_TP>

>           etc.

>     </MSG_RECPT>

>

> I'm getting:

>     <MSG_RECPT>UID>....</MSG_RECPT>UID>

>     <MSG_RECPT>TO_TP>....</MSG_RECPT>TO_TP>

>     etc.

>

> Also, the data between the bad XML tags is garbage.  Interestingly, I

> get binary garbage that grows by 4 bytes for each subsequent result

> 'string'.

>

> Anyway, progress.

>

> Here's the TCP dump of the SOAP:

>

> POST /axis/HUB_TO_HUB HTTP/11  Host: 172 1648 246:80

> Content-Type: text/xml; charset=UTF-8

> SOAPAction: "HUB_TO_HUB#Hub_Request"  Content-Length: 571

>

> <?xml version='1 0' encoding='utf-8' ?>

> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas xmlsoap

> org/soap/envelope/"

> xmlns:xsd="http://wwww3 org/2001/XMLSchema"

> xmlns:xsi="http://www w3 org/2001/XMLSchema-instance">

> <SOAP-ENV:Body>

> <ns1:Hub_Request xmlns:ns1="http://localhost/axis/HUB_TO_HUB">

> <ns1:TO_TP>A</ns1:TO_TP>

> <ns1:FROM_TP>B</ns1:FROM_TP>

> <ns1:TO_HUB>C</ns1:TO_HUB>

> <ns1:FROM_HUB>E</ns1:FROM_HUB>

> <ns1:UID>F</ns1:UID>

> <ns1:APIKEY>G</ns1:APIKEY>

> <ns1:ROUTING></ns1:ROUTING>

> <ns1:MESSAGE></ns1:MESSAGE>

> </ns1:Hub_Request>

> </SOAP-ENV:Body>

> </SOAP-ENV:Envelope>

>

> HTTP/1 1 200 OK  Date: Thu, 05 May 2005 18:26:37 GMT

> Server: Apache/2 0 46 (Red Hat)  Content-Length: 689

> Connection: close  Content-Type: text/xml

> <?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:Hub_Response

> xmlns:ns1="http://localhost/axis/HUB_TO_HUB">

> <MSG_RECPT>UID>....</MSG_RECPT>UID>

> <MSG_RECPT>TO_TP>........</MSG_RECPT>TO_TP>

> <MSG_RECPT>FROM_TP>............</MSG_RECPT>FROM_TP>

> <MSG_RECPT>STATUS>&amp................</MSG_RECPT>STATUS>

> <MSG_RECPT>STATUS_MSG>....&amp................</MSG_RECPT>STATUS_MSG>

> <MSG_RECPT>TIMESTAMP>.....&amp...................</MSG_RECPT>TIMESTAMP>

> </ns1:Hub_Response>

> </SOAP-ENV:Body>

> </SOAP-ENV:Envelope>

>

>

> > > ========================

> > >

> > > Here's my server.wsdd entry:

> > >

> > >         <service name="HUB_TO_HUB" provider="CPP:DOCUMENT"

> > > description="TVB Hub-to-Hub Service">

> > >                 <parameter name="allowedMethods" value="Hub_Request

> > > "/>

> > >                 <parameter name="className"

> > > value="/usr/local/axiscpp_deploy/lib/libhub2hub.so" />

> > >         </service>

> > >

> > > Here's the wsdl:

> > >

> > > <?xml version="1.0" encoding="utf-8"?>

> > > <wsdl:definitions

> > >    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"

> > >    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

> > >    xmlns:s="http://www.w3.org/2001/XMLSchema"

> > >    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"

> > >    xmlns:tns="http://localhost/axis/HUB_TO_HUB"

> > >    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"

> > >    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"

> > >    targetNamespace="http://localhost/axis/HUB_TO_HUB"

> > >    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

> > >

> > >   <wsdl:types>

> > >     <s:schema elementFormDefault="qualified"

> > > targetNamespace="http://localhost/axis/HUB_TO_HUB">

> > >       <s:element name="Hub_Request" type="tns:HUB_IN" />

> > >       <s:complexType name="HUB_IN">

> > >         <s:sequence>

> > >           <s:element minOccurs="0" maxOccurs="1" name="TO_TP"

> > > type="s:string" />

Reply | Threaded
Open this post in threaded view
|

RE: Newbie questions and some weird behavior

Samisa Abeysinghe
In reply to this post by Samisa Abeysinghe

Still we get garbage within the XML tags. This means that there is a bug (a serious one) in handling output parameters on the server side.

Looking at the generated code, it looks to me that the bug is in generated code and not the engine.

 

We need to create a Jira on this bug.

 

Thanks,

Samisa…

 

-----Original Message-----
From: Chinthana C. Dinapala [mailto:[hidden email]]
Sent: Friday, May 06, 2005 11:58 AM
To: Apache AXIS C User List
Subject: RE: Newbie questions and some weird behavior

 

Hi,

 

I have tested this WSDL and after making some changes in the generated code able to correct the XML tags in server respond.

The generated codes in HUB_TO_HUBWrapper.cpp I have change the followings.

      I have removed MSG_RECPT> part here.

 

 

      pIWSSZ->addOutputParam("UID", (void*)&out0, XSD_STRING);

      pIWSSZ->addOutputParam("TO_TP", (void*)&out1, XSD_STRING);

      pIWSSZ->addOutputParam("FROM_TP", (void*)&out2, XSD_STRING);

      pIWSSZ->addOutputParam("STATUS", (void*)&out3, XSD_STRING);

      pIWSSZ->addOutputParam("STATUS_MSG", (void*)&out4, XSD_STRING);

      pIWSSZ->addOutputParam("TIMESTAMP", (void*)&out5, XSD_STRING);

 

Here following are the SOAP messages after correction.

 

Client request………………………………………………………………………………………………..

 

POST /axis/HUB_TO_HUB HTTP/1.1

Host: 127.0.0.1:8888

Content-Type: text/xml; charset=UTF-8

SOAPAction: "HUB_TO_HUB#Hub_Request"

Content-Length: 608

 

<?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:Hub_Request xmlns:ns1="http://localhost/axis/HUB_TO_HUB">

<ns1:TO_TP>First</ns1:TO_TP>

<ns1:FROM_TP>Second</ns1:FROM_TP>

<ns1:TO_HUB>Third</ns1:TO_HUB>

<ns1:FROM_HUB>Fourth</ns1:FROM_HUB>

<ns1:UID>Fifth</ns1:UID>

<ns1:APIKEY>Sixth</ns1:APIKEY>

<ns1:ROUTING>Seventh</ns1:ROUTING>

<ns1:MESSAGE>Last</ns1:MESSAGE>

</ns1:Hub_Request>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

Server respond…………………………………………………………………………………………………….

 

HTTP/1.1 200 OK

Date: Fri, 06 May 2005 05:44:10 GMT

Server: Apache/2.0.52 (Win32)

Content-Length: 491

Content-Type: text/xml

 

<?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:Hub_Response xmlns:ns1="http://localhost/axis/HUB_TO_HUB">

<UID>xø</UID>

<TO_TP>˜ô</TO_TP>

<FROM_TP>`Ž</FROM_TP>

<STATUS>`Ž</STATUS>

<STATUS_MSG> ä</STATUS_MSG>

<TIMESTAMP>˜à’</TIMESTAMP>

</ns1:Hub_Response>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

Thanks

 

Chinthana Dinapala

 

 

 

-----Original Message-----
From: Samisa Abeysinghe [mailto:[hidden email]]
Sent: Friday, May 06, 2005 3:21 PM
To: Apache AXIS C User List
Subject: RE: Newbie questions and some weird behavior

 

Looks to me as if there are serialization problems on the server side.

I guess this is something to do with errors in the manipulation of the

pointer data members of the class being serialized by server for

response.

 

One thing to figure out is to know whether the error is in generated

code or in the user written code. Will have to generate the code and

see.

 

Thanks,

Samisa...

 

On Thu, 2005-05-05 at 19:09, Yampolsky, Robert wrote:

> > Will have a look at you wsdl and see if I could get it working. Please

> > try simple axis server in the mean time.

> >

> > Thanks,

> > Samisa...

> >

>

> Thanks.  I tried simple axis server with gdb, and was able to debug my

> server.  It now is able to log its inputs and outputs, and they look

> basically right.  But the client still gets null pointers for all of the

> results.

>

> Then I used tcpdump to look at the SOAP that was passed back and forth.

> I've included it below.

> It looks like the input is correct, but the response is screwed up.

> Instead of what I expect to get:

>     <MSG_RECPT>

>           <UID>....</UID>

>           <TO_TP>....</TO_TP>

>           etc.

>     </MSG_RECPT>

>

> I'm getting:

>     <MSG_RECPT>UID>....</MSG_RECPT>UID>

>     <MSG_RECPT>TO_TP>....</MSG_RECPT>TO_TP>

>     etc.

>

> Also, the data between the bad XML tags is garbage.  Interestingly, I

> get binary garbage that grows by 4 bytes for each subsequent result

> 'string'.

>

> Anyway, progress.

>

> Here's the TCP dump of the SOAP:

>

> POST /axis/HUB_TO_HUB HTTP/11  Host: 172 1648 246:80

> Content-Type: text/xml; charset=UTF-8

> SOAPAction: "HUB_TO_HUB#Hub_Request"  Content-Length: 571

>

> <?xml version='1 0' encoding='utf-8' ?>

> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas xmlsoap

> org/soap/envelope/"

> xmlns:xsd="http://wwww3 org/2001/XMLSchema"

> xmlns:xsi="http://www w3 org/2001/XMLSchema-instance">

> <SOAP-ENV:Body>

> <ns1:Hub_Request xmlns:ns1="http://localhost/axis/HUB_TO_HUB">

> <ns1:TO_TP>A</ns1:TO_TP>

> <ns1:FROM_TP>B</ns1:FROM_TP>

> <ns1:TO_HUB>C</ns1:TO_HUB>

> <ns1:FROM_HUB>E</ns1:FROM_HUB>

> <ns1:UID>F</ns1:UID>

> <ns1:APIKEY>G</ns1:APIKEY>

> <ns1:ROUTING></ns1:ROUTING>

> <ns1:MESSAGE></ns1:MESSAGE>

> </ns1:Hub_Request>

> </SOAP-ENV:Body>

> </SOAP-ENV:Envelope>

>

> HTTP/1 1 200 OK  Date: Thu, 05 May 2005 18:26:37 GMT

> Server: Apache/2 0 46 (Red Hat)  Content-Length: 689

> Connection: close  Content-Type: text/xml

> <?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:Hub_Response

> xmlns:ns1="http://localhost/axis/HUB_TO_HUB">

> <MSG_RECPT>UID>....</MSG_RECPT>UID>

> <MSG_RECPT>TO_TP>........</MSG_RECPT>TO_TP>

> <MSG_RECPT>FROM_TP>............</MSG_RECPT>FROM_TP>

> <MSG_RECPT>STATUS>&amp................</MSG_RECPT>STATUS>

Reply | Threaded
Open this post in threaded view
|

RE: Newbie questions and some weird behavior

Yampolsky, Robert
In reply to this post by Samisa Abeysinghe
>One thing to figure out is to know whether the error is in generated
>code or in the user written code. Will have to generate the code and
>see.

Okay.  There's not much code, though.  This is a trivial test of the
service, and all it does is print out the input to a log file, copy back
the input params as outputs and log them.  The logged stuff looks ok:

Here's the code:

void HUB_TO_HUB::Hub_Request(xsd__string Value0, xsd__string Value1,
xsd__string Value2, xsd__string Value3, xsd__string Value4, xsd__string
Value5, xsd__string Value6, xsd__string Value7, AXIS_OUT_PARAM
xsd__string *OutValue0, AXIS_OUT_PARAM xsd__string *OutValue1,
AXIS_OUT_PARAM xsd__string *OutValue2, AXIS_OUT_PARAM xsd__string
*OutValue3, AXIS_OUT_PARAM xsd__string *OutValue4, AXIS_OUT_PARAM
xsd__string *OutValue5)
{
char    timestamp[100];
time_t  clock;
struct  tm *tm;
FILE    *file;

        file = fopen("/home/rob/hub2hub/server/log", "w+");
        fprintf(file, "Input:\n"
                      "  TO_TP=%s\n"
                      "  FROM_TP=%s\n"
                      "  TO_HUB=%s\n"
                      "  FROM_HUB=%s\n"
                      "  UID=%s\n"
                      "  APIKEY=%s\n"
                      "  ROUTING=%s\n"
                      "  MESSAGE=%s\n",
                      Value0, Value1, Value2, Value3, Value4, Value5,
Value6, Value7);

        // Pass back caller's UID.
        *OutValue0 = Value4;
        // Pass back caller's FROM_TP as TO_TP.
        *OutValue1 = Value0;
        // Pass our hub ID as FROM_TP
        *OutValue2 = "ABCD-EFGH-IJKL-MNOP";
        // Force status code of 0 (SUCCESS) for now
        *OutValue3 = "0";
        *OutValue4 = "SUCCESS";
        // Send timestamp.
        clock = time((time_t *) 0);
        tm = localtime(&clock);
        sprintf(timestamp, "%04d-%02d-%02d %02d-%02d-%02d",
                tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
                tm->tm_hour, tm->tm_min, tm->tm_sec);
        *OutValue5 = timestamp;

        fprintf(file, "Output:\n"
                      "  UID=%s\n"
                      "  TO_TP=%s\n"
                      "  FROM_TP=%s\n"
                      "  STATUS=%s\n"
                      "  STATUS_MSG=%s\n"
                      "  TIMESTAMP=%s\n",
                      *OutValue0, *OutValue1, *OutValue2, *OutValue3,
*OutValue4, *OutValue5);
        fclose(file);
}
                   
Reply | Threaded
Open this post in threaded view
|

RE: Newbie questions and some weird behavior

Yampolsky, Robert
In reply to this post by Samisa Abeysinghe

Actually the MSG_RECPT stuff is not supposed to be there in the SOAP (the wsdl came from the group I'm trying to exchange info with, and they gave me a sample SOAP response which doesn't have it).  For what it's worth, they used .NET tools to generate their wsdl, and it had a bunch of problems.
 
I messed around with the original wsdl file, because it wsdl2ws didn't like it.  I had to prefix my namespace to the type=MSG_RECPT and element=HUB_Response entries to get it to process (see diff below).  I also added the soapAction.  One other thing - the original wsdl had references to HUB_Request and Hub_Request, which confused the hell out of me.  I'm not sure if  the .NET tools are case-insensitive.   Axis seems not to be.  I tried to standardize the spelling, which resulted in several items having the same name.  Maybe my fixes weren't right?
 
In any case, since my partner isn't counting on seeing the MSG_RECPT envelope around the HUB_Response data, is there an easy way to doctor up the wsdl to produce a working service?
 
 
[hidden email] ~/hub2hub$ diff *wsdl.old *wsdl
28c28
<       <s:element name="HUB_Response" nillable="true" type="MSG_RECPT" />
---
>       <s:element name="HUB_Response" nillable="true" type="tns:MSG_RECPT" />
45c45
<     <wsdl:part name="HUB_RequestResult" element="HUB_Response" />
---
>     <wsdl:part name="HUB_RequestResult" element="tns:HUB_Response" />
56c56
<       <soap:operation soapAction="" style="document" />
---
>       <soap:operation soapAction="HUB_TO_HUB#Hub_Request" style="document" />


From: Samisa Abeysinghe [mailto:[hidden email]]
Sent: Friday, May 06, 2005 2:09 AM
To: Apache AXIS C User List
Subject: RE: Newbie questions and some weird behavior

Still we get garbage within the XML tags. This means that there is a bug (a serious one) in handling output parameters on the server side.

Looking at the generated code, it looks to me that the bug is in generated code and not the engine.

 

We need to create a Jira on this bug.

 

Thanks,

Samisa…

 

-----Original Message-----
From: Chinthana C. Dinapala [mailto:[hidden email]]
Sent: Friday, May 06, 2005 11:58 AM
To: Apache AXIS C User List
Subject: RE: Newbie questions and some weird behavior

 

Hi,

 

I have tested this WSDL and after making some changes in the generated code able to correct the XML tags in server respond.

The generated codes in HUB_TO_HUBWrapper.cpp I have change the followings.

      I have removed MSG_RECPT> part here.

 

 

      pIWSSZ->addOutputParam("UID", (void*)&out0, XSD_STRING);

      pIWSSZ->addOutputParam("TO_TP", (void*)&out1, XSD_STRING);

      pIWSSZ->addOutputParam("FROM_TP", (void*)&out2, XSD_STRING);

      pIWSSZ->addOutputParam("STATUS", (void*)&out3, XSD_STRING);

      pIWSSZ->addOutputParam("STATUS_MSG", (void*)&out4, XSD_STRING);

      pIWSSZ->addOutputParam("TIMESTAMP", (void*)&out5, XSD_STRING);

 

Here following are the SOAP messages after correction.

 

Client request………………………………………………………………………………………………..

 

POST /axis/HUB_TO_HUB HTTP/1.1

Host: 127.0.0.1:8888

Content-Type: text/xml; charset=UTF-8

SOAPAction: "HUB_TO_HUB#Hub_Request"

Content-Length: 608

 

<?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:Hub_Request xmlns:ns1="http://localhost/axis/HUB_TO_HUB">

<ns1:TO_TP>First</ns1:TO_TP>

<ns1:FROM_TP>Second</ns1:FROM_TP>

<ns1:TO_HUB>Third</ns1:TO_HUB>

<ns1:FROM_HUB>Fourth</ns1:FROM_HUB>

<ns1:UID>Fifth</ns1:UID>

<ns1:APIKEY>Sixth</ns1:APIKEY>

<ns1:ROUTING>Seventh</ns1:ROUTING>

<ns1:MESSAGE>Last</ns1:MESSAGE>

</ns1:Hub_Request>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

Server respond…………………………………………………………………………………………………….

 

HTTP/1.1 200 OK

Date: Fri, 06 May 2005 05:44:10 GMT

Server: Apache/2.0.52 (Win32)

Content-Length: 491

Content-Type: text/xml

 

<?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:Hub_Response xmlns:ns1="http://localhost/axis/HUB_TO_HUB">

<UID>xø</UID>

<TO_TP>˜ô</TO_TP>

<FROM_TP>`Ž</FROM_TP>

<STATUS>`Ž</STATUS>

<STATUS_MSG> ä</STATUS_MSG>

<TIMESTAMP>˜à’</TIMESTAMP>

</ns1:Hub_Response>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

Thanks

 

Chinthana Dinapala

 

 

 

-----Original Message-----
From: Samisa Abeysinghe [mailto:[hidden email]]
Sent: Friday, May 06, 2005 3:21 PM
To: Apache AXIS C User List
Subject: RE: Newbie questions and some weird behavior

 

Looks to me as if there are serialization problems on the server side.

I guess this is something to do with errors in the manipulation of the

pointer data members of the class being serialized by server for

response.

 

One thing to figure out is to know whether the error is in generated

code or in the user written code. Will have to generate the code and

see.

 

Thanks,

Samisa...

 

On Thu, 2005-05-05 at 19:09, Yampolsky, Robert wrote:

> > Will have a look at you wsdl and see if I could get it working. Please

> > try simple axis server in the mean time.

> >

> > Thanks,

> > Samisa...

> >

>

> Thanks.  I tried simple axis server with gdb, and was able to debug my

> server.  It now is able to log its inputs and outputs, and they look

> basically right.  But the client still gets null pointers for all of the

> results.

>

> Then I used tcpdump to look at the SOAP that was passed back and forth.

> I've included it below.

> It looks like the input is correct, but the response is screwed up.

> Instead of what I expect to get:

>     <MSG_RECPT>

>           <UID>....</UID>

>           <TO_TP>....</TO_TP>

>           etc.

>     </MSG_RECPT>

>

> I'm getting:

>     <MSG_RECPT>UID>....</MSG_RECPT>UID>

>     <MSG_RECPT>TO_TP>....</MSG_RECPT>TO_TP>

>     etc.

>

> Also, the data between the bad XML tags is garbage.  Interestingly, I

> get binary garbage that grows by 4 bytes for each subsequent result

> 'string'.

>

> Anyway, progress.

>

> Here's the TCP dump of the SOAP:

>

> POST /axis/HUB_TO_HUB HTTP/11  Host: 172 1648 246:80

> Content-Type: text/xml; charset=UTF-8

> SOAPAction: "HUB_TO_HUB#Hub_Request"  Content-Length: 571

>

> <?xml version='1 0' encoding='utf-8' ?>

> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas xmlsoap

> org/soap/envelope/"

> xmlns:xsd="http://wwww3 org/2001/XMLSchema"