Ben Souther wrote:
the reason is that AXIS C++ client sends HTTP 1.1 request and support in clinet for chunked is then assumed by server (tomcat)::More Data......
Using the tcpmon application, I was able to grab all of the data being swapped between the client and server.
For some reason, Axis (server, java) returns the returns the response "chunked" for the C++ Client but not for the Java client.
POST /file_manager/services/EchoCaps HTTP/1.1
alek
I assume the delay is due to the connection not closing correctly. The C++ app probaly returns after the connection times out???
Again, any help is appreciated -Ben
Here is the data intercepted with tcpmon:.... ================================= FROM THE JAVA CLIENT ================================= Listen Port: 8888 Target Host: 127.0.0.1 Target Port: 8080 ==== Request ==== POST /file_manager/services/EchoCaps HTTP/1.0 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: Axis/1.1RC2 Host: 127.0.0.1 Cache-Control: no-cache Pragma: no-cache SOAPAction: "" Content-Length: 473
<?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>
<ns1:capitalize soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="EchoCaps">
<inputString xsi:type="xsd:string">String from the java client</inputString>
</ns1:capitalize>
</soapenv:Body>
</soapenv:Envelope>
==== Response ==== HTTP/1.1 200 OK Content-Type: text/xml;charset=utf-8 Date: Fri, 28 May 2004 20:17:24 GMT Server: Apache-Coyote/1.1 Connection: close
<?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> <ns1:capitalizeResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="EchoCaps"> <EchoCaps xsi:type="xsd:string">STRING FROM THE JAVA CLIENT</EchoCaps> </ns1:capitalizeResponse> </soapenv:Body> </soapenv:Envelope>
=================== FROM THE C++ CLIENT.......... =================== Listen Port: 8888 Target Host: 127.0.0.1 Target Port: 8080 ==== Request ==== POST /file_manager/services/EchoCaps HTTP/1.1 Host: 127.0.0.1 Content-Type: text/xml; charset=UTF-8 SOAPAction: "EchoCaps#capitalize" Content-Length: 439
<?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:capitalize xmlns:ns1="http://192.168.0.103:8888/file_manager/services/EchoCaps">
<inputString xsi:type="xsd:string">Input from C++ Client</inputString>
</ns1:capitalize>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
==== Response ==== HTTP/1.1 200 OK Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Fri, 28 May 2004 20:20:42 GMT Server: Apache-Coyote/1.1
20d
<?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>
<ns1:capitalizeResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://192.168.0.103:8888/file_manager/services/EchoCaps">
<EchoCaps xsi:type="xsd:string">INPUT FROM C++ CLIENT</EchoCaps>
</ns1:capitalizeResponse>
</soapenv:Body>
</soapenv:Envelope>
0
==============
On Friday 28 May 2004 12:26 pm, Ben Souther wrote:
Hello,
I've used the WSDL2Ws tool that ships with Axis C++ to create a simple client for a java webservice running on axis/tomcat. The webservice method takes a string as it's only argument and returns the same string but in upper case.
The c++ method that gets generated has an extra input parameter, has a return type of void, and doesn't seem to work.
I tried commenting out the line with the second "m_pCall->AddParameter.." statement. This improved things a bit. I can now see that a call is being made. I determined this with a System.out.println statement on the server which shows that the string is being passed from the c++ client to the webservice.
After that, the app just hangs for about 10 seconds and returns with the following message:
execution break m_MsgSize == 0, so return NULL Press any key to continue
Is Axis C++ interoperable with Axis Java?. Do I need to tweak the WSDL to get this to work?
If the WSDL2Ws tool isn't generating the proper c++ code, does anyone know where there is an example of a working c++ client that calls an echoString type of webservice that I can use as a template?
Any help would be greatly appreciated.
Below is a copy of all relevant files:
==================================================== The Java WS Class: ==================================================== package filemanager.service; public class EchoCaps{
public String capitalize(String in){ System.out.println("Value passed in from client: " + in); return in.toUpperCase(); } }
=========================================================== The WSDL generated from that class, from Axis Java running on Tomcat: =========================================================== <wsdl:definitions targetNamespace="http://localhost:8080/file_manager/services/EchoCaps">
<wsdl:message name="capitalizeRequest"> <wsdl:part name="inputString" type="xsd:string"/> </wsdl:message>
<wsdl:message name="capitalizeResponse"> <wsdl:part name="EchoCaps" type="xsd:string"/> </wsdl:message>
<wsdl:portType name="EchoCaps">
<wsdl:operation name="capitalize" parameterOrder="inputString"> <wsdl:input message="impl:capitalizeRequest" name="capitalizeRequest"/> <wsdl:output message="impl:capitalizeResponse" name="capitalizeResponse"/> </wsdl:operation> </wsdl:portType>
<wsdl:binding name="EchoCapsSoapBinding" type="impl:EchoCaps"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="capitalize"> <wsdlsoap:operation soapAction=""/>
<wsdl:input name="capitalizeRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/file_manager/services/EchoCaps" use="encoded"/> </wsdl:input>
<wsdl:output name="capitalizeResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/file_manager/services/EchoCaps" use="encoded"/> </wsdl:output> </wsdl:operation> </wsdl:binding>
<wsdl:service name="EchoCapsService">
<wsdl:port binding="impl:EchoCapsSoapBinding" name="EchoCaps"> <wsdlsoap:address location="http://localhost:8080/file_manager/services/EchoCaps"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
========================================================== The generated cpp file from running WSDL2Ws on the WSDL file above: ========================================================== /* * This is the Client Stub implementation file genarated by WSDL2Ws tool. * EchoCaps.cpp: implemtation for the EchoCaps. * */
#include "EchoCaps.h"
#include <axis/server/AxisWrapperAPI.h>
bool CallBase::bInitialized; CallFunctions CallBase::ms_VFtable; EchoCaps::EchoCaps() { m_pCall = new Call(); m_pCall->SetProtocol(APTHTTP);
m_pCall->SetEndpointURI("http://192.168.0.103:8080/file_manager/services/Ec hoCaps"); }
EchoCaps::~EchoCaps() { delete m_pCall; }
/*Methods corresponding to the web service methods*/
/* * This method wrap the service methodcapitalize */ void EchoCaps::capitalize(xsd__string Value0, xsd__string Value1) { if (AXIS_SUCCESS != m_pCall->Initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) return ; m_pCall->SetTransportProperty(SOAPACTION_HEADER , ""); m_pCall->SetSOAPVersion(SOAP_VER_1_1); m_pCall->SetOperation("capitalize", "http://192.168.0.103:8080/file_manager/services/EchoCaps"); m_pCall->AddParameter((void*)&Value0, "inputString", XSD_STRING);
//******************************************************************* //
After commenting out the following line, the client was able to //
successfully send the string to the webservice.
//m_pCall->AddParameter((void*)&Value1, "EchoCaps", XSD_STRING);
//*******************************************************************
if (AXIS_SUCCESS == m_pCall->Invoke()) { if(AXIS_SUCCESS == m_pCall->CheckMessage("capitalizeResponse", "http://192.168.0.103:8080/file_manager/services/EchoCaps")) { /*not successful*/ }
} m_pCall->UnInitialize(); }
//
// Added by me
//
void main(){
EchoCaps echoCaps;
echoCaps.capitalize("this is a string", "");
}
-- The best way to predict the future is to invent it - Alan Kay