O'Reilly - Java Web Services

Page 115

Java Web Services ///// // Version in examples has XML pretty printing logic here. ////

}

} catch(Exception e) { e.printStackTrace( }

);

// // NOTE: the remainder of this deals with reading arguments // /** Main program entry point. */ public static void main(String args[]) { // Not Relevant }

}

This code is similar to the code presented in the SOAP chapters, with a couple of exceptions. First, Systinet WASP UDDI uses different servlets to implement the inquiry and publisher ports. When Systinet WASP UDDI is first installed, the URL of the inquiry port is http://localhost:8080/wasp/uddi/inquiry. In the program, this URL is assigned to the constant DEFAULT_HOST_URL: private static final String DEFAULT_HOST_URL = "http://localhost:8080/wasp/uddi/inquiry/";

Second, UDDI SOAP messages don't require the use of a SOAP header. Thus, all of the code used to create a SOAP header and fill it with values, such as mustUnderstand, is not needed. Next, UDDI and Systinet WASP UDDI SOAP envelopes require the addition of several different namespaces that they have defined. These namespaces are required at the envelope level of the message, not the SOAP header or body. In the Apache SOAP API, the Envelope interface has a method called declareNamespace( ) that adds these additional namespaces: // Create the SOAP envelope org.apache.soap.Envelope envelope = new org.apache.soap.Envelope(

);

// Add the Systinet namespaces. envelope.declareNamespace("idoox", "http://idoox.com/uddiface"); envelope.declareNamespace("ua", "http://idoox.com/uddiface/account"); envelope.declareNamespace("config", "http://idoox.com/uddiface/config"); envelope.declareNamespace("attr", "http://idoox.com/uddiface/attr"); envelope.declareNamespace("fxml", "http://idoox.com/uddiface/formxml"); envelope.declareNamespace("inner", "http://idoox.com/uddiface/inner"); // Add the default namespace envelope.declareNamespace("", "http://idoox.com/uddiface/inner"); // Include the standard UDDI namespace. // This URN contains all of the UDDI XML data structures and messages. envelope.declareNamespace("uddi", "urn:uddi-org:api_v2");

111


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.