WSO2/C++ Webサービス パッケージを使用してクライアントで正常に実行できたものはありますか? 考えられることはすべて試しましたが、非常に単純なクライアントを実行しようとするたびにクラッシュします。サンプルプログラムの1つからのサンプルコードを次に示します...
#include <stdio.h>
#include <WSRESTClient.h>
#include <OMElement.h>
#include <iostream>
#include <AxisFault.h>
using namespace std;
using namespace wso2wsf;
int _tmain(int argc, _TCHAR* argv[])
{
WSRESTClient * sc = new WSRESTClient("http://localhost:9090/axis2/services/echo/echoString");
try
{
sc->initializeClient("echo_rest.log", AXIS2_LOG_LEVEL_TRACE);
}
catch (AxisFault & e)
{
cout << endl << "Error: " << e << endl;
return 0;
}
Options * op = sc->getOptions();
op->setHTTPMethod(AXIS2_HTTP_GET);
sc->setOptions(op);
{
OMNamespace * ns = new OMNamespace("http://ws.apache.org/axis2/services/echo", "ns1");
OMElement * payload = new OMElement(NULL,"echoString", ns);
OMElement * child = new OMElement(payload,"text", NULL);
child->setText("Hello World!");
cout << endl << "Request: " << payload << endl;
OMElement * response;
try
{
response = sc->request(payload, "http://ws.apache.org/axis2/c/samples/echo/soap_action");
if (response)
{
cout << endl << "Response: " << response << endl;
}
}
catch (AxisFault & e)
{
cout << endl << "Error: " << e << endl;
}
delete payload;
}
delete sc;
return 0;
}
WRESTClient オブジェクトの構築の時点で毎回クラッシュします。WSO2 コードのどこかに問題があるようですが、正確な問題を示すエラー メッセージは表示されません。私の次のステップは、WSO2 のソースに対してビルドし、クラッシュしているコードをステップ実行することですが、誰かが以前にこの問題に遭遇したことがあり、すぐにフィードバックがあることを願っています.