I solved my own problem. I wanted to send the code so that if anyone else
has the question they find what I did.
This specifies the entire envelope.
(Thanks to Google and some examples I found. This is not 100% my own code.)
try
{
//convert XML String to XML DOC
//Convert String into inputFile for parser.
StringReader sr = new StringReader(XML);
InputSource inputFile = new InputSource(sr);
// change or remove this depending on what jaxp implementation your
environment supports
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance();
fac.setNamespaceAware(true);
DocumentBuilder parser = null;
try
{
parser = fac.newDocumentBuilder();
}
catch (Exception e)
{
logger.fatal("parser config error: " + e.getMessage());
}
Document doc = parser.parse(inputFile);
// XML DOC is created
//create new service to be able to use for call
Service service = new Service();
Call call = (Call) service.createCall();
//set the properties for using the SOAPaction
call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
call.setProperty(Call.SOAPACTION_URI_PROPERTY, SOAPaction);
//set the endpoint url
call.setTargetEndpointAddress( new java.net.URL(endpointUrl) );
//add SOAP elements
SOAPBodyElement[] input = new SOAPBodyElement[1];
Element inputQuery = doc.getDocumentElement();
input[0] = new SOAPBodyElement(inputQuery);
result = (String) call.invoke( input );
}
catch (java.rmi.RemoteException e)
{
out.println("<p>Remote Server Exception Message: " + e.getMessage() );
//out.println("<p>Remote Server Exception Cause: "
+e.getCause().toString() );
}
catch (Exception e)
{
//logger.fatal(e.toString() );
out.println("This is an exception: " + e.toString());
}
On 5/23/07, Doug Schaible <[EMAIL PROTECTED]> wrote:
Good Evening All!
Does Axis provide a way for you to specify the entire SOAP body? Or the
entire SOAP Envelope?
Thanks,
Doug
For Example:
POST /SSOEnterprise/webservice/sso.asmx HTTP/1.1
Host: 127.0.0.1
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://WebServices.SSO/Login <http://webservices.sso/Login>"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
////////////////////////////////////////////////////
// //
// Specify everything that is in here! //
// //
//////////////////////////////////////////////////
</soap:Body>
</soap:Envelope