Resolution: Description: ============ By default when an error occures in the HTTPCA driver for instance, in case of duplicate request or parsing failures, this driver doesn't respond to the north bound application. The HTTPCA framework offers the possibility to redefine some virutal operations in order to send an error response to the HTTP server.
Environment: =========== Solaris 5.10 64 bits platform Linux Redhat 5.0 x86_64
Resolution: ========== To send a response to the northbound application you have to implement a custom ServiceContext where the onFramingFailed and onFrameParsed operations have to be overwritten. Those operation will be used to send your HTTP response.
Here is a default implemetation of those three operations:
[ virtual ] void onFrameParsed( in provca::Parser::Result i_parsingResult, in string i_orderId, in string i_message); };
expose entity ServiceContextImpl with interface ServiceContext;
//---------------------------------------------------------------------- //create its own service context factory interface ServiceContextFactory : httpca::ServiceContextFactory { };
entity ServiceContextFactoryImpl { [ virtual ] void createServiceContext( in string i_serviceContextId, out provca::ServiceContext o_serviceContext); };
expose entity ServiceContextFactoryImpl with interface ServiceContextFactory; };
And now the act file:
//------------------------------------------------------------------------------ // Operation Name // httpcatest::ServiceContextImpl::onFramingFailed // void action httpcatest::ServiceContextImpl::onFramingFailed( in string i_message) {` declare httputil::Message response; declare kablet::Part part;
// Get targetAddress // declare kablet::ServiceContext serviceContext; serviceContext = self.kabletContext;
//in case of duplicate request the status returned by onFrameParsed is Parser::Duplicate if (i_parsingResult == Parser::Duplicate) { SWBuiltIn::traceMsgInfo("httpcatest::ServiceContextImpl::onFrameParsed Duplicate" + soid);
// Get targetAddress // serviceContext = self.kabletContext;
// Add SOAP fault to response create part; part.content = soapFaultStart + "add your error message in case of time out" + soapFaultEnd; response.addPart(part);
// Result serviceContext.response = response; self.kabletContext = serviceContext;
//now send the response self.sendResponse(self.eventOriginator);
`};
//****************************************************************************** // Operation Name // httpcatest::ServiceContextFactoryImpl::createServiceContext // void action httpcatest::ServiceContextFactoryImpl::createServiceContext( in string i_serviceContextId, out provca::ServiceContext o_serviceContext) {` declare ServiceContext sc; create sc values (id : i_serviceContextId); o_serviceContext = sc; `};