Hi,
I am trying to
communicate with a J2EE webservice running on Bea Weblogic webserver 8.1
SP3. The client side has Axis C++. I am getting error while reading the
SOAP response sent by the webservice. The exception occurs on calling
getElementAsString function
(after checkMessage return successful, line 3105: at m_pNode = m_pParser->next ()).
The code is exactly
similar to the one provided with C++ samples.
if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER))
return *Ret;if (NULL==m_pCall->getTransportProperty("SOAPAction",false))
{
m_pCall->setTransportProperty(SOAPACTION_HEADER , "ProductLookupService#lookupProduct");
}
m_pCall->setSOAPVersion(SOAP_VER_1_1);setUsername("user");
setPassword("password");m_pCall->setOperation("lookupProduct", "http://localhost/distribution/webservices");
applyUserPreferences();
m_pCall->addParameter((void*)lpParam, "xmlRequest", XSD_STRING);
if (AXIS_SUCCESS == m_pCall->invoke()){if(AXIS_SUCCESS==m_pCall->checkMessage("lookupProductResponse", "http://www.cardinal.com/distribution/webservices"))
{
char sTemp[1024]="";
sprintf(sTemp, m_pCall->getElementAsString("result", 0)); //**** EXCEPTION THROWN HERE***
}
The response
received is as below (Trapped using Mindreef SOAPScope).
Request sent (It
sends an XML string in parameter "xmlRequest") -
<?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:lookupProduct xmlns:ns1="http://www.cardinal.com/distribution/webservices">
<xmlRequest xsi:type="xsd:string"></xmlRequest>
</ns1:lookupProduct>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Rsposne received
(Output parameter name is "result")-
<env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<env:Body>
<n1:lookupProductResponse
xmlns:n1="http://www.cardinal.com/distribution/webservices">
<result
xsi:type="xsd:string">TEST</result>
</n1:lookupProductResponse>
</env:Body>
</env:Envelope>
Thanks & regards,
Linesh
Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. |