OOW Demo3 - .NET/J2EE interop by examples

Last week, I have been presenting at Oracle Open World on the subject of Web services interoperability between .NET and J2EE, with a focus on Oracle's implementation of JAX-RPC that is available in our latest developer preview.

Today, I have a very simple example of 'tweaking a local copy of the original WSDL'.

Here is the WSDL : http://www.tilisoft.com/ws/LocInfo/ZipCode.asmx?WSDL

C:\ow2005\Demo3>java -jar /oc4j/webservices/lib/wsa.jar genProxy output ./gen_src wsdl http://www.tilisoft.com/ws/LocInfo/ZipCode.asmx?WSDL
SEVERE: WSDL validation failed. The wsdl contains a mixture of styles - "document" and "rpc". Only "rpc" OR "document" is supported in a wsdl, not both.

work around:
- make a local copy
- edit the WSDL, and replace the instances of rpc with document.
- re-run the genProxy command

For some reason, the publisher of this service has been using 'rpc' at the service level, then 'document' at the operation level (or method level in C#).
<wsdl:binding name="ZipCodeSoap" type="tns:ZipCodeSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
<wsdl:operation name="GetDistance">
<soap:operation soapAction="http://www.tilisoft.com/ws/LocInfo/GetDistance" style="document" />

There is just one line to modify to get going.
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />

Done deal, you can generate the code with the local copy.

C:\ow2005\Demo3>java -jar /oc4j/webservices/lib/wsa.jar genProxy output ./gen_src wsdl ./etc/ZipCodeV2.wsdl

To test the generated code, edit
C:\ow2005\Demo3\gen_src\com\tilisoft\www\locinfo\ZipCodeSoapClient.java

Just add those 3 lines to the main method:
    // Add your own code here
Element res = (Element)myPort.getInfo("94403");

System.out.println("info for 94403 :");
((XMLElement)res).print(System.out);

The output will be looking like this (truncated for preserving space here) :
     [java] calling http://www.tilisoft.com/ws/LocInfo/ZipCode.asmx
[java] info for 94403 :
[java] <GetInfoResult xmlns="http://www.tilisoft.com/ws/LocInfo/literalTypes">
...


Now, you have access to the raw data from the ADO.NET dataset, and you can start to write your own XSLT to extract the data.

-ecco

Comments

Popular posts from this blog

Changing the version of JDK used by JDeveloper

Connection reset from a WCF Web Service

unexpected null value for literal data