Ciao a tutti,
voglio realizzare un webservice con Axis C++ su Linux (Ubuntu 9).
Ho seguito come riferimento il tutorial di esempio Calculator.
Ho utilizzato:
- Axis C++: axis-c-linux-current-bin.
- Xerces (parser xml): xerces-c2_2_0-linux8.0gcc32
- Apache 2: httpd-2.0.64.
e ho utilizzato Eclipse per creare la libreria libCalculator.so e il client di test.
#include "Calculator.hpp"
#include <stdio.h>
int main() {
Calculator c;
int result = c.add(20,40);
printf("result is = %d\n", result);
return 0;
}
Il problema appare lato server. Dopo che compilo viene visualizzato il seguente messaggio di errore:
"terminate called after throwing an instance of 'axiscpp::SoapFaultException'
what(): Cannot deserialize the requested element"
Inoltre visualizza anche il seguente messaggio di warning:
"/usr/bin/ld: warning: libstdc++.so.5, needed by /usr/lib/gcc/i486-linux-gnu/4.
4.1/../../../../lib/libaxis_client.so, may conflict with libstdc++.so.6"
Esaminando il file di log...
<?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:add xmlns:ns1="http://localhost/axis/Calculator">
<in0 xsi:type="xsd:int">20</in0>
<in1 xsi:type="xsd:int">40</in1>
</ns1:add>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
....
....
<?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>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Library loading failed</faultstring>
<faultactor>server name:listen port</faultactor>
<detail><appSpecific>AxisEngineException:Library loading failed</appSpecific>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
visualizza come messaggio di errore "AxisEngineException:Library loading failed"
Per quanto riguarda i file di configurazione,
server.wsdd:
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:C="http://xml.apache.org/axis/wsdd/providers/C" xmlns:CPP="http://xml.apache.org/axis/wsdd/providers/CPP">
<service name="Calculator" provider="CPP:RPC" description="Simple Calculator Axis C++ Service ">
<parameter name="className" value="/usr/local/axiscpp_deploy/webservices/libCalculator.so" />
<parameter name="allowedMethods" value="add sub mul div "/>
<parameter name="operationRequestMap" value="add:addRequest sub:subRequest mul:mulRequest div:divRequest "/>
</service>
</deployment>
axiscpp.conf:
Transport_http:/usr/local/axiscpp_deploy/lib/libhttp_transport.so
Channel_HTTP:/usr/local/axiscpp_deploy/lib/libhttp_channel.so
XMLParser:/usr/local/axiscpp_deploy/lib/libaxis_xmlparser.so
WSDDFilePath:/usr/local/axiscpp_deploy/etc/server.wsdd
LogPath:/usr/local/axiscpp_deploy/log/AxisLog
ClientLogPath:/usr/local/axiscpp_deploy/log/AxisClientLog
Non capisco come mai non va... Potete darmi un consiglio?
Vi ringrazio in anticipo.
Betty