Posting Data to External Sites

You use the HTTPAdapterService to post XML data to external sites. You create the HTTPPostRequest object first. HTTPPostRequest contains the XML data to be posted as well as the URL where data is to be posted. Then, depending on whether you are using HTTP or HTTPS, the appropriate method from HTTPAdapterService is invoked to post the data. This example code shows how to use HTTPAdapterService to post XML data to external sites.

//Make HTTP Call
HTTPAdapterService service = context.getHTTPAdapterService();      
HTTPPOSTRequest req = new HTTPPOSTRequest(internalVO.getSzPayloadIn());
HTTPPOSTResponse res = null;       

req.setUrl(internalVO.getSzURL());           

res = service.postMessage(req, HTTPAdapterService.CORRELATION_IN_HEADER_WITH_ NON_⇒
SECURE_CALLBACK);