Sunday, December 07, 2003 | |
Web Services Tip: JDeveloper Doc/Lit Common question ... how do I publish doc/literal Web services in JDeveloper 9.0.3/9.0.4. The OC4J 10.0.3 JAX-RPC preview tutorial showing the Web services extension for JDeveloper 10.0.3 showed it as a one click option not available in JDeveloper 9.0.3/9.0.4. The Oracle Application Server 10g 9.0.3/9.0.4 Web Services Assembler (see chapter 6) gives a set of options to do this from the command line but they too are not available in JDeveloper 9.0.3/9.0.4. So how does it work? First, build your class to accept and return an XML Element - here is a trivial example to show the concept: package com.doc; Run it through the JDeveloper Web Services wizard as normal (see full tutorial on this for "Hello World"), publishing the echoElement() method as a Web service.
You will get a generated web.xml file, configuring the Oracle Application Server Web Services runtime servlet as follows: <servlet> Correspondingly, you will get a WSDL generated, with the following binding and operation section: <binding name="EchoBinding" type="tns:EchoPortType"> So even though you have built something that implementation wise really looks like doc/literal (i.e. inbound and outbound XML document), what came out the otherside of the Web services wizard in JDeveloper is rpc/literal. The steps to turn this into doc/literal are turn out to be trivial:
Copy the Web service endpoint URL (in the JDeveloper Web service wizard, this is normally found in the third step/tab, "File Locations", in the field labelled "Web Service Endpoint") to an IE/Mozzilla browser and add a ?WSDL suffix on it. In my case that is: http://127.0.0.1:8888/ws/EchoService?WSDL You will notice that the WSDL now reports that your previously generated rpc/literal Web service is now doc/literal: </binding> AAnd with that, you are done. One doc/literal Web service, served up. More tips coming up this week. comment [] 8:54:19 PM |