Hi,
I believe you've found a bug in the generated stubs.
About 7 lines into each web service operation in the generated stubs you
will find something like:
if (NULL==m_pCall->getTransportProperty("SOAPAction",false))
m_pCall->setTransportProperty(SOAPACTION_HEADER ,
"http://tempuri.org/Add");
The test for an existing value is what's causing you the problem. Because
you've already used the stub once, the SOAPaction has already been set, so
the value isn't being reset with the new value, which is why we're seeing
the server respond with the wrong message.
The reason we haven't found this a problem is because the majority of our
testing takes place against Axis C++ and Axis Java, which use the message
element names to determine the operation being invoked, while you appear to
be using a .Net web service which I believe makes use of the soapAction.
Can you try removing the test for an exising value within your generated
stubs and re-run.
If this resolves your problem, can you raise a Jira issue and we will fix
WSDL2Ws so it no longer has this behaviour.
Regards,
Adrian
_______________________________________
Adrian Dick ([EMAIL PROTECTED])
"Cheng, John" <[EMAIL PROTECTED]> wrote on 16/05/2006 21:44:47:
> Adrian,
>
> I got the soap message that exchanged for two function calls (see
> below). I think the soapaction in the http header for the second
> function always uses the previous functions soapacton.
>
> I also attached my wsdl file. Thanks!
>
> John Cheng
>
> ==================================================
>
> For s.HelloWorld();
>
> Send:
>
> - <HTTPHeaders>
> <host>localhost:8080</host>
> <content-type>text/xml; charset=UTF-8</content-type>
> <soapaction>"http://tempuri.org/HelloWorld"</soapaction>
> <content-length>340</content-length>
> </HTTPHeaders>
>
> <?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:HelloWorld xmlns:ns1="http://tempuri.org/" />
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
>
>
> Return:
>
> - <HTTPHeaders>
> <server>Microsoft-IIS/5.1</server>
> <date>Tue, 16 May 2006 20:20:54 GMT</date>
> <x-powered-by>ASP.NET</x-powered-by>
> <x-aspnet-version>2.0.50727</x-aspnet-version>
> <cache-control>private, max-age=0</cache-control>
> <content-type>text/xml; charset=utf-8</content-type>
> <content-length>363</content-length>
> </HTTPHeaders>
>
> <?xml version="1.0" encoding="utf-8" ?>
> - <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> - <soap:Body>
> - <HelloWorldResponse xmlns="http://tempuri.org/">
> <HelloWorldResult>Hello World</HelloWorldResult>
> </HelloWorldResponse>
> </soap:Body>
> </soap:Envelope>
>
> ------------------------------------------------------------------------
> ----
> s.Add(12, 24);
>
> Send:
>
> - <HTTPHeaders>
> <host>localhost:8080</host>
> <content-type>text/xml; charset=UTF-8</content-type>
> <soapaction>"http://tempuri.org/HelloWorld"</soapaction>
> <content-length>362</content-length>
> </HTTPHeaders>
>
> <?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:Add xmlns:ns1="http://tempuri.org/">
> <ns1:a>12</ns1:a>
> <ns1:b>24</ns1:b>
> </ns1:Add>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
>
> Return:
>
> - <HTTPHeaders>
> <server>Microsoft-IIS/5.1</server>
> <date>Tue, 16 May 2006 20:21:07 GMT</date>
> <x-powered-by>ASP.NET</x-powered-by>
> <x-aspnet-version>2.0.50727</x-aspnet-version>
> <cache-control>private, max-age=0</cache-control>
> <content-type>text/xml; charset=utf-8</content-type>
> <content-length>363</content-length>
> </HTTPHeaders>
>
>
> <?xml version="1.0" encoding="utf-8" ?>
> - <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> - <soap:Body>
> - <HelloWorldResponse xmlns="http://tempuri.org/">
> <HelloWorldResult>Hello World</HelloWorldResult>
> </HelloWorldResponse>
> </soap:Body>
> </soap:Envelope>
>
> -----Original Message-----
> From: Adrian Dick [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 16, 2006 3:51 AM
> To: Apache AXIS C User List
> Subject: RE: AxisEngineException
>
> Hi,
>
> I'm surprised you're having problems using the same stub twice. We have
> numerous testcases which re-use the same stub object, including mixed
> operations.
>
> Looking at the trace, it would appear the second call didn't receive the
> expected SOAP message.
>
> Can you use TCPmon, or similiar, to capture the "on-the-wire" messages
> when
> making these two subsequent calls?
> A copy of your WSDL would also be helpful, so we can ensure the correct
> names and values are being used throughout.
>
> Regards,
> Adrian
> _______________________________________
> Adrian Dick ([EMAIL PROTECTED])
>
>
> "Cheng, John" <[EMAIL PROTECTED]> wrote on 15/05/2006 16:26:36:
>
> > Adrian,
> >
> > Thanks for the help! I found the problem after enable the trace. It
> was
> > due to my searching path did not include the directory where
> > AxisXMLParserXerces.dll is located. My testing sample is working now.
> > But I found another interesting problem with the library, though. I
> have
> > a piece of code looks like this:
> >
> > ServiceSoap
> > s("http://localhost/WebService1/service.asmx");
> > xsd__string str = s.HelloWorld();
> > int x = s.Add(12, 24);
> >
> > My experience with other web service client code told me the two
> > sequential calls should work. But it's not working here. Only the
> first
> > call works. The second one will give an AxisGenException. After I
> switch
> > my calling sequence, it's the same. The second one doesn't work. Why
> is
> > there such limitation? I attached my log file this time.
> >
> > Thanks!
> >
> > John Cheng
> >
> >
> > -----Original Message-----
> > From: Adrian Dick [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, May 10, 2006 3:06 AM
> > To: Apache AXIS C User List
> > Subject: Re: AxisEngineException
> >
> > Hi,
> >
> > Have you tried turning on trace? ( See
> > http://ws.apache.org/axis/cpp/TraceGuide.html#enablingRuntimeTrace and
> > possibly also
> > http://ws.apache.org/axis/cpp/TraceGuide.html#enablingStartupTrace )
> > This may give you some pointers to the problem, if there's nothing
> > obvious
> > you can post your tracefile here so we can look for any problems.
> >
> > As for project files, see my response to another recent question here:
> > http://marc.theaimsgroup.com/?l=axis-c-user&m=114724798004149&w=2
> >
> > Regards,
> > Adrian
> > _______________________________________
> > Adrian Dick ([EMAIL PROTECTED])
> >
> >
> > "Cheng, John" <[EMAIL PROTECTED]> wrote on 09/05/2006 19:10:32:
> >
> > > Hi,
> > > I am having a problem to make a C++ app to call a .NET C# web
> > > service, using Axis C++. The service was implemented and tested
> > > separately. I generated the client side code using WSDL2Ws and
> > > included it with my application (on windows platform). But when
> > > running the application I get AxisEngineException while
> > > instantiating the generated class. There is no other information,
> > > and I could not figure it out base on the document. I also tried to
> > compile
> > > the distributed project vc\Distribution.sln and vc\AxisDevelopment.
> > > sln, hope to get a debug version of axis_client.lib. But it
> > > complains some files can not be found, for example:
> > > src\common\AxisException.cpp is not in the package. Any help?
> > > Thanks!
> > > John Cheng
> > [attachment "AxisClientLog.my.zip" deleted by Adrian Dick/UK/IBM]
> [attachment "service.wsdl" deleted by Adrian Dick/UK/IBM]