I'm writing a SOAP client. I'm using gSOAP version 2.7.17 and I have to stick to that version as the server is using this one and I cannot modify it as it is already running in the field.
When I do my SOAP call, I always receive empty answer! However, when I sniff the network, the XML answer seems correct:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:Supervisor="urn:Supervisor"
xmlns:ActiveLogin="urn:ActiveLogin" xmlns:TechLogin="urn:TechLogin"
xmlns:UMSLogin="urn:UMSLogin">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<unitCallResponse>
<szServerName>UMS_DEV_LANCC2 (2)</szServerName>
<dResponse>cUNITRETURNCODE_RESTARTIMMEDIATE</dResponse>
<dDetail>cBla</dDetail>
</unitCallResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here is a simplified code snippet about how I perform the SOAP call with the proxy generated with soapcpp2:
UMSLogin::unitCallResponse response; // Response from SOAP
UMSLogin::UMSLoginProxy* m_soapProxy = // The SOAP proxy
new UMSLogin::UMSLoginProxy(SOAP_IO_KEEPALIVE, SOAP_IO_KEEPALIVE);
callRes = m_soapProxy->unitCall(m_eUnitType, serial, m_dInterfaceVersion,
xl2CallTypeToUmsLoginCallType(m_pSoapEndPoint->getCallType()),
xl2CommTypeToUmsLoginCommType(m_pSoapEndPoint->getComType()),
response);
logDebug(LOG_COM_DEVICE, "SOAP call done to %s, SOAP code %i, central code %i",
response.szServerName.c_str(), callRes, response.dResponse);
m_soapProxy->soap_close_socket();
m_soapProxy->destroy();
delete m_soapProxy;
The actual output:
SOAP call done to , SOAP code 0, central code 0
When I expect
SOAP call done to UMS_DEV_LANCC2 (2), SOAP code 0, central code 5
/* 5 -> cUNITRETURNCODE_RESTARTIMMEDIATE */
There was an old implementation that was working previously, this must be working! Where am I wrong? Did anyone has already had this kind of problem? Any pointer is strongly appreciated!
EDIT:
Problem was "solved" by using an earlier version of SOAP (2.7.14) without changing a single line of code from the original version of my program. However, I have the feeling I miss something important again! I should probably tweak a little my header file giving the SOAP "definitions" to make things working ...