I write a client and a Server using WSF cpp, and they worked well.
I create a proxy for the service on wso2 ESB, and the service can get the request when i use soapUI.
But the WSF cpp client can't send the messge to the proxy, I monitor the message, the error is below:
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: application/soap+xml; action="urn:#PlaceOutageRecord";charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 14 Apr 2011 03:35:21 GMT
Connection: close
1da
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Fault><soapenv:Code><soapenv:Value>soapenv:Receiver</soapenv:Value></soapenv:Code><soapenv:Reason><soapenv:Text xml:lang="en-US">javax.xml.stream.XMLStreamException: Trying to read events from a parser that already reported an error before</soapenv:Text></soapenv:Reason><soapenv:Detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
0
My code is below:
std::string endpointUri = "http://172.20.41.40:8888/esb/services/OutageRecord.OutageRecordHttpSoap12Endpoint";
if(argc > 1)
{
endpointUri = argv[1];
}
Environment::initialize("stockquote.log",AXIS2_LOG_LEVEL_DEBUG);
std::string clientHome = AXIS2_GETENV("WSFCPP_HOME");
//SimpleStockQuoteServiceStub *stub = new SimpleStockQuoteServiceStub(clientHome,endpointUri);
OutageRecordServiceStub *stub = new OutageRecordServiceStub(clientHome,endpointUri);
ServiceClient *client = stub->getServiceClient();
//client->engageModule(AXIS2_MODULE_ADDRESSING);
Options *options = client->getOptions();
axis2_options_t *axis2options = options->getAxis2Options();
axis2_options_set_action(axis2options, Environment::getEnv(), "urn:#PlaceOutageRecord");
options->setSoapVersion(AXIOM_SOAP12);
axutil_date_time_t* element = axutil_date_time_create(Environment::getEnv());
ConductingEquipmentRoles_type0* conductingEquipmentRoles = new ConductingEquipmentRoles_type0("Klz2211Cb");
std::vector<com_dongfang_china::ConductingEquipmentRoles_type0*>* arg_ConductingEquipmentRoles = new std::vector<com_dongfang_china::ConductingEquipmentRoles_type0*>;
arg_ConductingEquipmentRoles->push_back(conductingEquipmentRoles);
NoPowerInterval_type0* noPowerInterval = new NoPowerInterval_type0(element,element);
OutageSteps_type0* outageSteps = new OutageSteps_type0(2,"***",false,"1","1","1",5,15,arg_ConductingEquipmentRoles,noPowerInterval);
std::vector<com_dongfang_china::OutageSteps_type0*>* arg_OutageSteps = new std::vector<com_dongfang_china::OutageSteps_type0*>;
arg_OutageSteps->push_back(outageSteps);
OutageRecord* outageRecord = new OutageRecord("broken","****",element,false,"StopACLlz2","emergency","StopACLlz2","StopACLlz2","StopACLlz2",arg_OutageSteps);
//OutageRecord* outageRecord = new OutageRecord("test","test","test","test","test","test");
//OutageRecord* outageRecord = new OutageRecord();
//outageRecord->setDescription("test");
OutageRecords* outageRecords = new OutageRecords(outageRecord);