You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by "Yampolsky, Robert" <ry...@harris.com> on 2005/05/09 18:55:15 UTC

RE: Newbie questions - workaround and some additional questions

I was able to get it to generate good SOAP by changing 2 things in the Wrapper module.
 
1. Removing the MSG_RECPT> from the output param names.  This fixes the result element name literals.
2. Removing the & from the out... variables.  This fixes the garbage data.  The out#'s are already pointers, and addOutputParam doesn't want pointers to pointers here.
 
So...
    pIWSSZ->addOutputParam("MSG_RECPT>UID", (void*)&out0, XSD_STRING);
becomes
    pIWSSZ->addOutputParam("UID", (void*)out0, XSD_STRING);
 
 
I guess I can go live with the manually fixed generated code.  Don't know if this is being caused by a problem with my wsdl file or a bug in the wsdl2ws utility, though.
 
Other stuff I haven't resolved yet.
 
1) ?wsdl URL's don't seem to work.  http://localhost/axis/calculator?wsdl causes a segfault.  The calculator.wsdl is in $AXISCPP_DEPLOY/wsdls.  Should that be enough to get this to work?  Should I be able to put my wsdl there to get ?wsdl to work for my service?
 
2) The original wsdl had a null SoapAction.  I had to fill it in and rebuild the client to get the Axis server to process my client requests.  I'm guessing that that's going to mean that any clients that want to access my service are going to need to specify a SoapAction.  That might be problematic, because this is a peer-to-peer service that was defined in terms of the underlying SOAP.  Each implementation is free to use whatever wsdl it wants (I may not be able to force everyone to set SoapAction, or even standardize on the name of the service).  One hopeful thing is that I tried putting junk in the SoapAction instead of my service and method names, and it still works.  Axis seems to just require *something* there - it doesn't seem to have to correctly reference your service or method.  Is that right?
 
 

________________________________

From: Samisa Abeysinghe [mailto:SAbeysinghe@virtusa.com] 
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:CDinapala@virtusa.com] 
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:sabeysinghe@virtusa.com] 
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" />
> > >           <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 <sa...@virtusa.com>
Virtusa Corporation