axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gavin M. Bell" <>
Subject Hello Word from C++ client to Java service returns "(null)", huh??
Date Wed, 24 Aug 2005 16:17:34 GMT
Hello Gentle-people,

I have been going through the exercise of getting axis-c++ to work.
I am using the axis-c-1.5.0-linux-bin distribution.  I have created a 
Java 'helloworld' echo service.
A simple service, you pass it a string and it returns to you the same 
string prepended with an ack string.

I used axis to build the stub and header files for my serice.  I then 
run my serice.... the java axis service gets the string (as evidenced by 
the log output) and then returns.  The client returns "(null)".

Why is that?  Why does it not return the echo string sent by the service?
I have been reading the list and have set multiRef to false in the axis 
service-config.wsdd file:

  <parameter name="adminPassword" value="admin"/>
  <parameter name="attachments.implementation" 
  <parameter name="sendXsiTypes" value="true"/>
  <parameter name="sendMultiRefs" value="false"/>
  <parameter name="sendXMLDeclaration" value="true"/>
   <handler type="java:org.apache.axis.handlers.JWSHandler">
    <parameter name="scope" value="session"/>
   <handler type="java:org.apache.axis.handlers.JWSHandler">
    <parameter name="scope" value="request"/>
    <parameter name="extension" value=".jwr"/>

I am using resin-3.0.14 as my service container...

My service side code (java) is:
    public java.lang.String request( java.lang.String msg ) {
        if(msg == null) msg = "<noname>";
        System.out.println("some thing: "+msg);
        return "This is the hello world! - \""+msg+"\"";

My client side code (c++) is:
main (int argc, char *argv[])
  char endpoint[256];
  char original[256];
  const char *server = "localhost";
  const char *port = "1595";
  const char *inputString = "<test-echo-string>";
  const char *resultString = "<no-result>";
  // Set default service URL
  sprintf (endpoint, "http://localhost:1595/NaracWS/services/HelloModel");
  sprintf (original, endpoint);
      if (argc < 1)
      usage (argv[0], endpoint);
      return 2;
      cout << endl << " Using service at " << endpoint << endl <<
      cout << "Instantiating remote endpoint stub... ";
      HelloModel ws(endpoint);
      cout << "[OK]" << endl;
      cout << "attempting to send the string [cpp test]" <<endl;
      printf ("Before remote call - Result: %s\n", resultString);
      resultString = ws.request("cpp test");
      printf ("After  remote call - Result: %s\n", resultString);
  catch (AxisException & e){printf ("\nException : %s\n", e.what ());}
  catch (exception & e){printf ("\nUnknown exception has occured\n");}
  catch (...) { printf ("\nUnknown exception has occured\n");}
  return 0;

C++ client output:

 Using service at http://localhost:1595/NaracWS/services/HelloModel

Instantiating remote endpoint stub... Warning - The WSDDFilePath file 
(/home/obj/etc/server.wsdd) in the AXISCPP.CONF file does not exist.
attempting to send the string [cpp test]
Before remote call - Result: <no-result>
After  remote call - Result: (null)

To build it:
 g++ *.cpp -I/home/cue/workbench/axis-c-1.5.0-linux-bin/include 
-L/home/cue/workbench/axis-c-1.5.0-linux-bin/lib/ -ldl -l axis_client 

I am at my wit's end.  Please, any help would be appreciated.
(I have attached the generated stub and header file)


   Gavin M. Bell
   Computer Science Research Scientist
   Computing Applications and Research Dept.
   Lawrence Livermore National Labs

"I'm trying real hard to be the shepherd."
				-Samuel Jackson (Pulp Fiction)

View raw message