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.
javax.xml.soap.SOAPElement
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");
((XMLElement)soapElement).print(System.out);
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
Search This Blog
Wednesday, 20 June 2007
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.
http://buttso.blogspot.com/2007/04/start-oc4j-in-remote-debug-mode.html
I used this today to remote debug web services deployed to OC4J 10.1.3.1 stand alone from JDeveloper 10.1.3.1 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.
http://buttso.blogspot.com/2007/04/start-oc4j-in-remote-debug-mode.html
I used this today to remote debug web services deployed to OC4J 10.1.3.1 stand alone from JDeveloper 10.1.3.1 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 10.1.3.1 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.
java.rmi.ServerException:
start fault message:
Internal Server Error (serialization error: no serializer is
registered for (class pas.jdbc.Dept, null)) :end fault message
at
oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java
:560)
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()
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.
java.rmi.ServerException:
start fault message:
Internal Server Error (serialization error: no serializer is
registered for (class pas.jdbc.Dept, null)) :end fault message
at
oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java
:560)
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:
http://buttso.blogspot.com/2005/11/dumping-system-properties-with-oc4j.html
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
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:
http://buttso.blogspot.com/2005/11/dumping-system-properties-with-oc4j.html
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
Wednesday, 30 May 2007
How to import external ejb3 components in JDeveloper for code development
When creating EJB3 components in JDeveloper 10.1.3.x the application navigator shows a nice little icon for the EJB component as a single entity. The problem is when you create your EJB3 components outside of JDeveloper and import them into the project source directory doing a refresh on the navigator will show the newly added components to the IDE but fails to visually show it as an EJB component. His how to enable this.
Note: Assuming the EJB3 component added to the project source path and are shown as Java classes in the project once a refresh is done.
1. Double click on the project to invoke the "Project Properties" dialog
2. Select the "Libraries" label on the left hand side of the dialog
3. Ensure you have the following libraries in your project, if you already had EJB3 components they will be there if not you will need them for the project to compile.
5. Press the "Refresh List" button
6. Press "OK" to dismiss the dialog
7. Now refresh the application navigator for the project and you EJB3 component will be displayed with a nice little icon as though you originally created it in JDeveloper
Note: Assuming the EJB3 component added to the project source path and are shown as Java classes in the project once a refresh is done.
1. Double click on the project to invoke the "Project Properties" dialog
2. Select the "Libraries" label on the left hand side of the dialog
3. Ensure you have the following libraries in your project, if you already had EJB3 components they will be there if not you will need them for the project to compile.
- EJB 3.0
- Toplink Essentials JPA
5. Press the "Refresh List" button
6. Press "OK" to dismiss the dialog
7. Now refresh the application navigator for the project and you EJB3 component will be displayed with a nice little icon as though you originally created it in JDeveloper
Pas Has Landed
A product manager in the oc4j team lead me to his blog and now I have created my own. I am constantly asked questions on Jdeveloper, JDBC and OC4J so now I have landed I will share some of those here as I find time.
Subscribe to:
Posts (Atom)