axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steffen Lorscheider">
Subject AW: dynamic invocation
Date Wed, 30 Jun 2004 12:56:13 GMT
Me again ;)

I looked at the provided example-code "Calculator.cpp" and things become
a little clearer now. But I still can't call the WebService described in
the O'Reilly book "Web Service Essentials" in Chapter 3. Calling it from
Java (using ApacheSOAP) works, but using Axis C++ I get now an exception
calling Call::checkMessage(). This exception is thrown in
SoapDeSerializer::checkMessageBody() on the following line:

  if (0 != strcmp(m_pNode->m_pchNameOrValue, pName))
      throw AxisGenException(AXISC_NODE_VALUE_MISMATCH_EXCEPTION);    

The value of m_pNode->m_pchNameOrValue is "Fault"!!!
The value of pName is "sayHelloResponse"... (see below...)

Here is my code (using Jboss with ApacheSOAP at the server):

  const char* pEndpointURI 	=
  const char* pParameterVal = "MyName";

  Call *pCall = new Call ();
  pCall->setProtocol (APTHTTP);
  pCall->setEndpointURI (pEndpointURI);

  if (AXIS_SUCCESS == pCall->initialize (CPP_RPC_PROVIDER,
    pCall->setTransportProperty (SOAPACTION_HEADER,
    pCall->setSOAPVersion (SOAP_VER_1_1);
    pCall->setOperation ("sayHello", pEndpointURI);
    pCall->addParameter ((void*)&pParameter, "strName", XSD_STRING);

    if (AXIS_SUCCESS == pCall->invoke ())
      if (AXIS_SUCCESS == pCall->checkMessage ("sayHelloResponse",
        const char* pszReturn = pCall->getElementAsString
("sayHelloReturn", 0);

  delete pCall;

A difference to the Java-Client-Code is the method 'setTargetObjectURI
("urn:examples:helloservice")' which is missing in C++. And I can't find
an equivalent method...

-----Urspr√ľngliche Nachricht-----
Von: Steffen Lorscheider [] 
Gesendet: Mittwoch, 30. Juni 2004 09:21
Betreff: dynamic invocation


I want to use Apache Axis C++ for dynamic webservice-method invocation.
I found an example how this is done using the Java-version (see below -
also desribed in the 3rd chapter of the O'Reilly book "Web Service
Essentials" from Ethan Cerami using ApacheSOAP), but I can't find the
appropriate methods and classes in the C++ version...

Here is the Java-code:
Service service = new Service (); // can't find this class
Call call = service.createCall (); // no method 'createCall' in the
whole projet call.setEncodingStyle (...); // again no such mehtod ...
call.addParameter (...); call.setReturnType (...); ... call.invoke(new

How can this be done with the C++ version?
Thanks in advance. I'm really stuck...


View raw message