return envelopeDoc;
}
public XmlObject sendRequest( XmlObject requestDoc, String action ,String type )
{
EnvelopeDocument requestEnvelopeDoc = createEnvelope();
Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
addAddressingHeaders( requestEnvelope.getHeader(), action );
XmlBeanUtils.addChildElement( requestEnvelope.getBody(), requestDoc );
try
{
URL endpointURL = new URL( m_epr.getAddress() );
URI actionURI = new URI( action );
if ( DEBUG ) { System.out.println( "Sending request: \n" + requestEnvelopeDoc ); }
String response = SoapClient.sendRequest( endpointURL, requestEnvelopeDoc.newInputStream(), actionURI );
setChanged();
XmlOptions xmlOpts = new XmlOptions().setSaveOuter();
xmlOpts.setSavePrettyPrint();
notifyObservers(new WcmMessage(requestDoc.xmlText(xmlOpts), response,type));
EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse( response );
if (DEBUG ) { System.out.println( "Received response: \n" + responseEnvelopeDoc ); }
Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements( responseEnvelope.getBody() );
if ( responseBodyElems.length == 0 )
{
return null;
}