You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by "Gavin M. Bell" <cu...@llnl.gov> on 2005/09/12 11:00:31 UTC

Hello Again... (null) return value for Hello World. Xerces C?

Hello,

I have gone from attempting to use the axis-c binary distribution to the 
axis-c source distribution to the cvs tree that I have built myself and 
they all lead me back to getting a "(null)" back when processing my Java 
web service response.  I changed the build scripts to build with '-g' 
and have been stepping through the code.   I have stepped through enough 
to know that the message is getting to the axis-c client and there is 
some amount of parsing happening, however, the end result is getting the 
pesky "(null)" as my ultimate return value.  I am using xerces-c-2_2_0 
as my parser.
Is there a know issue with axis-c 1.5 and xerces-c 2.2.0 ?

Has anyone faced this issue?

Thus far I have gdb'd my way into the generated stub code and the 
problem is in this call:
xsd__string HelloModel::request(xsd__string Value0)
{
   xsd__string Ret;
   memset(&Ret,0,sizeof(xsd__string));
   const char* pcCmplxFaultName;
   try
   {
       if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER))
           return Ret;
   if (NULL==m_pCall->getTransportProperty("SOAPAction",false))
   {
       m_pCall->setTransportProperty(SOAPACTION_HEADER , "");
   }
       m_pCall->setSOAPVersion(SOAP_VER_1_1);
       m_pCall->setOperation("request", 
"http://localhost:1595/NaracWS/services/HelloModel");
       applyUserPreferences();
       m_pCall->addParameter((void*)Value0, "msg", XSD_STRING);
       if (AXIS_SUCCESS == m_pCall->invoke())
       {
           if(AXIS_SUCCESS == m_pCall->checkMessage("requestResponse", 
"http://localhost:1595/NaracWS/services/HelloModel"))
           {

//************ HELP **************************
//********************************************
//users list mavens... here is the issue... Ret get set to null
//the above invoke() call is run and successfully communicates with the 
service.
//********************************************
               Ret = m_pCall->getElementAsString("requestReturn", 0);
           }
       }
   m_pCall->unInitialize();
       return Ret;
   }
   catch(AxisException& e)
...

Digging deeper into the code I get to here: (using gdb where command)

#0  0x00c2951c in XMLParserXerces::next () from 
/home/cue/obj/bin/libaxis_xerces.so
#1  0x00e5746e in axiscpp::SoapDeSerializer::getElement (this=0x9b8b310, 
pName=0x804998a "requestReturn",
   pNamespace=0x0, pSimpleType=0xbfff8f70) at 
/home/cue/workbench/ws-axis/c/src/soap/SoapDeSerializer.cpp:1884
#2  0x00e57ca8 in axiscpp::SoapDeSerializer::getElementAsString 
(this=0x9b8b310,
   pName=0x804998a "requestReturn", pNamespace=0x0)
   at /home/cue/workbench/ws-axis/c/src/soap/SoapDeSerializer.cpp:2214
#3  0x00e2d7de in axiscpp::Call::getElementAsString (this=0x9b8b310, 
pName=0x804998a "requestReturn",
   pNamespace=0x0) at 
/home/cue/workbench/ws-axis/c/src/engine/client/Call.cpp:500
#4  0x080494e7 in HelloModel::request (this=0xbfff9040, Value0=0x80498aa 
"cpp test") at HelloModel.cpp:55
#5  0x08048fe8 in main (argc=1, argv=0xbfff9334) at Client.cpp:56
(gdb)

So.... the next step...

(gdb) step
Single stepping until exit from function _ZN15XMLParserXerces4nextEb,
which has no line number information.
axiscpp::SoapDeSerializer::getElement (this=0x9b8b310, pName=0x804998a 
"requestReturn", pNamespace=0x0,
   pSimpleType=0xbfff8f70) at 
/home/cue/workbench/ws-axis/c/src/soap/SoapDeSerializer.cpp:1886
(gdb)

So I can't look into the xerces library built, I am assuming since it 
talks to xerces-c (which I have not compiled with debugging on).

*Question: What is the relationship between the libaxis_xerces.so and 
the libxerces-c.so that I built when installing xercesc???  Could this 
be where the ball is being dropped???

I have also attached the tcp monitor trace showing the request and 
response SOAP messages.

HELP PLEASE, I DON'T KNOW WHAT ELSE TO DO. IT DOESN'T LOOK LIKE IT IS 
ANY CODE THAT I HAVE WRITTEN!  HELP... :-\





-- 


------
  Gavin M. Bell
  Computer Science Research Scientist
  Computing Applications and Research Dept.
  Lawrence Livermore National Labs
  L-103
  cue@llnl.gov
-------

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

------------------------------------------------------------------------


==============
Listen Port: 1596
Target Host: localhost
Target Port: 1595
==== Request ====
POST /NaracWS/services/HelloModel HTTP/1.1
Host: localhost:1596
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Length: 406

<?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:request xmlns:ns1="http://localhost:1595/NaracWS/services/HelloModel">
            <msg xsi:type="xsd:string">cpp test</msg>
         </ns1:request>
      </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>
==== Response ====
HTTP/1.1 200 OK
Server: Resin/3.0.14
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Date: Wed, 07 Sep 2005 06:22:27 GMT

0253
<?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:requestResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://localhost:1595/NaracWS/services/HelloModel">
            <requestReturn xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">This is the hello world! - &quot;cpp test&quot;]</requestReturn>
         </ns1:requestResponse>
      </soapenv:Body>
   </soapenv:Envelope>0

==============

-- 


------
   Gavin M. Bell
   Computer Science Research Scientist
   Computing Applications and Research Dept.
   Lawrence Livermore National Labs
   L-103
   cue@llnl.gov
-------

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