RE: Newbie questions - workaround and some additional questions

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

RE: Newbie questions - workaround and some additional questions

Yampolsky, Robert

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:[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'.

>

Reply | Threaded
Open this post in threaded view
|

RE: Newbie questions - workaround and some additional questions

Samisa Abeysinghe

Please see my comments below:

> 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.

 

This is a wsdl2ws bug, and not something wrong with your WSDL. As you have found the solution, we would be able to fix this soon and put the solution in CVS.

 

Re: ?wsdl

 

When you put the wsdl in $AXISCPP_DEPLOY/wsdl it should work. http://localhost/axis/calculator?wsdl works on windows. (Please try to access from the URL you get when u access http://localhost/axis/ page.)

 

Re: SOAPAction

 

Yes, Axis C++ server mandates SOAPAction and this is a problem, against which we have a Jira and it is yet to be fixed. I am not sure about the “junk SOAPAction”. If that is the case, then we would be able to fix this easily. Need to have a look into the engine to figure out this. However, my earlier understanding was that it uses this to locate the service and the method name – because, when I have some wrong method name in SOAPAction, service would complain to me.

 

Thanks,

Samisa…

 

 

 

-----Original Message-----
From: Yampolsky, Robert [mailto:[hidden email]]
Sent:
Monday, May 09, 2005 10:55 PM
To: Apache AXIS C User List
Subject: 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:[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>