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/EchoCaps";);
}

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", "");    
}



















Reply via email to