|
WebLogic Server 7.0 Code Examples, BEA Systems, Inc. | |||||
http://www.xmethods.com:9090/soap
The Main client application uses the javax.xml.rpc.Call
JAX-RPC class to dynamically discover the operations of the Web
service, as well as its parameters, and then call it with the appropriate
values. The client application does not use the WSDL of the Web service to
find this information.
The build.xml file sets the runtime property
weblogic.webservice.verbose to true to provide additional information,
useful for debugging.
| Additional Resources for examples.webservices.client.dynamic_no_wsdl | |
| build.xml | The Java Ant build script that runs the client application. |
| Main.java | The client application that invokes the Web service. |
The following sections describe how to build and run the example.
Before you run this example, you need:
prompt> ant
prompt> ant run
NOTE: You do not need to start WebLogic Server because the application invokes a Web service from a different vendor rather than one running on WebLogic Server.
Buildfile: build.xml
run:
[java]
[java] <!--REQUEST.................-->
[java] <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
[java] xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
[java] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
[java] <env:Header>
[java] </env:Header>
[java] <env:Body>
[java] <m:getQuote env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
[java] xmlns:m="urn:xmethods-delayed-quotes">
[java] <symbol>BEAS</symbol>
[java] </m:getQuote>
[java] </env:Body>
[java] </env:Envelope>
[java] <!--RESPONSE.................-->
[java] <soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
[java] xmlns:xsd="http://www.w3.org/2001/XMLSchema"
[java] xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
[java] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
[java] xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
[java] <soap:Body>
[java] <n:getQuoteResponse xmlns:n="urn:xmethods-delayed-quotes">
[java] <Result xsi:type="xsd:float">12.46</Result>
[java] </n:getQuoteResponse>
[java] </soap:Body>
[java] </soap:Envelope>
[java]
[java] This example shows how to create a dynamic client application that invokes a non-WebLogic Web service.
[java] The webservice used was: http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote
[java] The quote for BEAS is:
[java] 12.46
BUILD SUCCESSFUL
NOTE: The value of 12.46 is a sample output; because the example
is executing a real Web service, you will see the true current stock price for
BEA Systems.
|
Documentation is available at http://e-docs.bea.com/wls/docs70/ |
|||||