Crash编写简单的WSO2 / C ++ Web服务客户端

有没有能够使用WSO2 / C ++ Web服务包成功运行客户端?我已经尝试过几乎所有我能想到的东西,但每当我尝试运行一个非常简单的客户端时,我都会遇到崩溃。这是他们的一个示例程序的一些示例代码......
#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的源代码构建并逐步执行崩溃的代码,但我希望有人之前遇到过这个问题并且有一些即时反馈。     
已邀请:
您是否考虑过在WRESTClient对象构造周围放置一个try / catch-all块?如果你在这条线上进行核心转储,则可能会抛出异常,如果你抓住了它,那么你可能会从该异常中获得更多有用的错误信息。 除此之外,是时候按照你的建议打破调试器了。     

要回复问题请先登录注册