Creating SOAP Entities
The portal includes an AbstractSOAPProviderEntity class that implements all required methods of IProviderEntity and ITransformationProviderEntity interfaces in order to make SOAP requests.
You need, however, to implement the createRequestMessage() method, which returns the SOAP message as defined in the content provider’s WSDL.
...
1. Create a class that extends AbstractSOAPProviderEntity.
2. Implement the createMessage() method, which should return a SOAP message for retrieving the XML source. The following is an example:
protected SOAPMessage createRequestMessage()
throws ContentProviderException, SOAPException
{
// Create SOAP Envelope
SOAPMessage msg = createBasicEnvelope();
SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
SOAPBody body = env.getBody();
// Create GetNewsstandHeadlines Element
SOAPElement getNewsStandHlElement =
body.addChildElement(
env.createName("GetNewsstandHeadlines","",
ICPService.CP_NS_DEV2_1_PARSERS));
// Create sectionIDs Element
SOAPElement sectionIdsElm =
getNewsStandHlElement.addChildElement(
env.createName("sectionIDs","",
ICPService.CP_NS_DEV2_1_PARSERS));
// Create sectionID Element
SOAPElement sectionIDElm
= sectionIdsElm.addChildElement(
env.createName("sectionID","",
ICPService.CP_NS_DEV2_1_PARSERS));
// Create Section Code
sectionIDElm.addTextNode(
m_sourcePropertiesHandler.getParameterValue(
m_request,"sectionCode"));
return msg;
}
3. If necessary, override the doInit() method.
4. If necessary, override the getGeneralParameters() method. This method defines parameters that are passed to all the transformers associated with this entity.
5. If necessary, override the getEntityTransformerParams() method. This method can be used to pass different key-value pairs to different transformers associated with this entity. You can determine the current transformer by examining the ITransformerInformation object passed into the method.