Java Reference
In-Depth Information
"xs:int");
// Add appropriate namespaces and an encoding style
to the envelope.
SOAPEnvelope
env
=
re-
quest.getSOAPPart().getEnvelope();
env.addNamespaceDeclaration("env",
"ht-
tp://schemas.xmlsoap.org/soap/envelop/");
env.addNamespaceDeclaration("enc",
"ht-
tp://schemas.xmlsoap.org/soap/encoding/");
env.setEncodingStyle(SOAPConstants.URI_NS_SOAP_ENCODING);
env.addNamespaceDeclaration("xs",
"ht-
tp://www.w3.org/2001/xmlschema");
env.addNamespaceDeclaration("xsi",
"http://www.w3.org/2001/
xmlschema-instance");
// Output the request just built to standard output,
to see what the
// SOAP message looks like (which is useful for de-
bugging).
System.out.println("\nsoap request:\n");
try
{
request.writeTo(System.out);
}
catch (IOException ioe)
{
JOptionPane.showMessageDialog(RomanNumerals.this,
ioe.getMessage());
}
System.out.println();
// Prepare to send message by obtaining a connection
factory and creating
// a connection.
SOAPConnectionFactory factory = SOAPConnectionFact-
Search WWH ::




Custom Search