This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Services and the fly likes Weblogic 8.1 WSDL 2 Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Weblogic 8.1 WSDL 2 Java" Watch "Weblogic 8.1 WSDL 2 Java" New topic
Author

Weblogic 8.1 WSDL 2 Java

Brett Daburn
Greenhorn

Joined: Nov 25, 2008
Posts: 10
I am trying to develop a web service client using code generated from weblogic 8.1. I am having trouble getting started in creating the request. (I was able to do it fine with Axis2, but we are unable to use Axis due to in-house standards and other issues.)

In the code, I am getting the stub class as follows:



What I'm not understanding is how to set up and send the request with the generated classes. The operation name is Authenticate. In order to get the Authenticate response, I am provided with the following.:



What I'm not following is parameters is a javax.xml.soap.SOAPElement object. I'm not familiar with SOAPElement, but it seams to me that it is wanting me to manually create the SOAP XML and send it as the parameter. Am I following this correctly? If so, why create all of the classes for all of the types in the WSDL? If not, how do I use the generated classes to create the request?

(The WSDL is https://services.pj1.staging.printable.com/TRANS/0.9/SSO.asmx?WSDL)
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Does version 8 of Weblogic contain a SOAP engine? Is there any documentation that covers how to use the classes generated by Weblogic?
Brett Daburn
Greenhorn

Joined: Nov 25, 2008
Posts: 10
This below link is to the documentation I came across. I could almost follow their example, but my 'operation method' to return the result object is asking for a SOAPElement object as the parameter. That is what I am not following.


http://edocs.beasys.com/wls/docs81/webserv/client.html#1070561
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
How did you generate the following classes with Weblogic?

SingleSignOn_Impl
SingleSignOnSoap
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by Brett Daburn:
but my 'operation method' to return the result object is asking for a SOAPElement object as the parameter. That is what I am not following.


My guess is that the WebLogic clientgen tool did the best it could given that {http://services.printable.com/1.0/sso}Authenticate references {http://www.printable.com/pti}PartnerCredentialsType and other elements in the "http://www.printable.com/pti" namespace

The WSDL doesn't even declare namespace prefixes - I had to guess at

xmlns:tns="http://services.printable.com/1.0/sso"
xmlns:s1="http://www.printable.com/sso"
xmlns:s2="http://www.printable.com/pti"

The WSDL (XML schema) imports "http://www.printable.com/sso" and "http://www.printable.com/pti" - but it doesn't provide a schemaLocation! So clientgen wouldn't know what any of the XML types in the "http://www.printable.com/pti" namespace would look like. So it defaulted to assuming that {http://services.printable.com/1.0/sso}Authenticate is some kind of XML document. JAX-RPC uses javax.xml.soap.SOAPElement for generic XML document parameters.

So you can build the "Authenticate" XML parameter as a javax.xml.soap.SOAPElement. However if you are doing that already then using plain old SAAJ (weblogic 8.1 includes SAAJ 1.1) can become a serious consideration as you are barred from using a more modern web service stack. (SAAJ client "Java Web Services in a Nutshell" Sample: Chapter 3 SAAJ (PDF))

You shouldn't expect too much from WebLogic 8.1 - it is an J2EE 1.3 compliant application server. Web services didn't become part of the Java Enterprise standard until J2EE 1.4. So any web service support in WebLogic 8.1 is vendor specific, non-standard and minimal (i.e. Axis 1.x is even more "standard"). Ultimately that is going to limit to what extent you can coerce clientgen to generate the type of code that you are looking for. clientgen was mainly intended to generate clients for the type of SOAP web services that can be published by a WebLogic 8.1 application server.
Brett Daburn
Greenhorn

Joined: Nov 25, 2008
Posts: 10
For some reason, FireFox 2 doesn't display the entire WSDL. You have to view the source.

<wsdl efinitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://services.printable.com/1.0/sso" xmlns:s1="http://www.printable.com/sso" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s2="http://www.printable.com/pti" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://services.printable.com/1.0/sso" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

I will have to discuss with the 'big guys' on what to do about WebLogic clientgen and this WSDL. Thank you for your assistance!


P.S.
I also came across "the WebLogic
8.1 clientgen tool will not handle the xsd:choice keyword." and this WSDL contains a choice.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Weblogic 8.1 WSDL 2 Java