*/
public class RequestUtils
{
public static XmlObject sendRequest(XmlObject requestDoc, String action, EndpointReference epr)
{
EnvelopeDocument requestEnvelopeDoc = createEnvelope();
Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
addAddressingHeaders(requestEnvelope.getHeader(), action, epr);
XmlBeanUtils.addChildElement(requestEnvelope.getBody(), requestDoc);
try
{
URL endpointURL = new URL(epr.getAddress());
System.out.println("Sending Request to " + endpointURL.toString());
URI actionURI = new URI(action);
String response = SoapClient.sendRequest(endpointURL, requestEnvelopeDoc.newInputStream(), actionURI);
EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse(response);
Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements(responseEnvelope.getBody());
System.out.println("Received response from " + endpointURL.toString());
System.out.println(responseBodyElems[0].toString());
if (responseBodyElems.length == 0)
{