Wednesday, 20 June 2007

Printing the SOAPElement JAX-RPC 1.4 type to standard out

I am constantly consuming web services which have a service class with methods using org.w3c.dom.Element

The web service stub proxy within JDeveloper 10.1.3.x will then use the JAX-RPC 1.4 client interface as follows for clients to consume the web service methods with parameters of this type.


In order to print out the XML you can easily just use this piece of code to display the XML to standard out for testing purposes.

SOAPElement soapElement =
myPort.executeQuery("select empno, ename, hiredate, deptno from emp");

Note: XMLElement is fully defined as oracle.xml.parser.v2.XMLElement part of oracle's XML parser V2 which is the JAR file xmlparserv2.jar

Tuesday, 19 June 2007

Remote Debug JAX-RPC 1.4 Web Services in OC4J

Steve, added a blog entry showing how to set OC4J in remote debug mode.

I used this today to remote debug web services deployed to OC4J stand alone from JDeveloper and it worked well. You easily set up remote debugging from the project properties dialog and then start the remote debugger directly from JDeveloper.

Thanks steve saved me a bit time here.

Friday, 15 June 2007

JAX-RPC 1.4 Java Web Services in JDeveloper fails to handle List<Dept> return type at runtime

I am working on developing some internal web services training to the BPEL team and came across what I thought should work within JAX-RPC 1.4 java web services. I had a service class with a method as follows

public List<Dept> showAllDeps()

I quickly generated a web service using the web service wizard and then generated a client via the proxy wizard and found at runtime I was not able to return a List of Dept records and ended up with an error as follows at runtime.

start fault message:
Internal Server Error (serialization error: no serializer is
registered for (class pas.jdbc.Dept, null)) :end fault message

It turns out that this use case should actually work and was a bug which I filed internally, but it turns out there is an easy workaround to enable this to work so that the correct WSDL is generated for the proxy client to successfully run. In the JAX-RPC wizard there is a page called "Additional Classes". You can use this to make sure that classes such as "Dept" have schema mappings, once that is added , the WSDL gets created with what's required for the client to correctly run.

Thanks to the web service developers for this information so now my demos are written with signature method as follows and can be successfully invoked from clients.

public List<Dept> showAllDeps()

Wednesday, 13 June 2007

Dumping System Properties with OC4J 10.1.3.x

I worked with steve on identifying a third party application issue within OC4J , during that he showed me an easy way to view/dump the system properties for the container in 10.1.3.x for OC4J.

In his blog he shows it with a JSP page which was how it was done pre OC4J 10.1.3, of course that still works in OC4J 10.1.3 but you can now use Application Server Control (ASC) in 10.1.3.x which is very handy.

His steve's blog entry showing the JSP page way:

His how you can do this with ASC now in 10.1.3.x:

1. Log into ASC.
2. Click on the OC4J instance you wish to see the system properties for.
3. Click on the "Administration" link.
4. Click on "Go To Task Icon" for System MBean Browser.
5. On the left panel click the + symbol for "ClassLoading".
6. Click on link for "singleton".
7. Click on "Operations" link on main window.
8. Click on the 3rd link for "executeQuery", make sure you click on the 3rd one in the list.
9. Enter the following for the value text field -> SystemProperties
10. Click on "Invoke Operation".
11. You should get the output under "Return Value" for the current system properties