WSDL4J is a reference implementation for JSR-110, a spec which is still
under construction, so the interfaces in WSDL4J are quite changeable.
There were a number of changes between WSTK 2.4 and 3.0.  WSTK 3.0 was
built in December.  I don't have the version of wsdl4j.jar that was used in
WSTK 3.0, but I don't believe it's changed much since then.  What you want
to do is:

// Note that you don't import com.ibm.wsdl.xml anymore
import javax.wsdl.*;
import javax.wsdl.factory.*;

public class WSDL4JCreateSample
{
    public static void main(String[] args)
    {
        try
        {
            Definition def = WSDLFactory.newInstance().newDefinition();
        }
        catch (WSDLException ex)
        {
            System.out.println("Exception - fault code : " +
ex.getFaultCode());
        }
    }
}

It looks like you want to create WSDL (rather than manipulate existing
WSDL).  You'll want to look at the source in org.apache.axis.wsdl.fromJava.
The call above is used in Emitter.java.

Russell Butek
[EMAIL PROTECTED]


Li Bing <[EMAIL PROTECTED]> on 03/22/2002 01:58:07 AM

To:    Russell Butek/Austin/IBM@IBMUS
cc:    AXIS-USER <[EMAIL PROTECTED]>
Subject:    WSDL4J Versions and Its Environment on Linux



Dear Mr. Butek,

I am trying to use wsdl4j.jar. I specify $WSTK_HOME/lib/wsdl4j.jar in the
$CLASSPATH. The version of my WSTK Toolkit is 3.0. I am reading a book,
Professional Java Web Services. In the book, there are some samples shown
how to use APIs in wsdl4j.jar. But when I compiling the first one, I got an
error that DefinitionFactory can not be resolved. I check .jars in the
$WSTK_HOME and can't find the class, DefinitionFactory. The book is about
IBM Web Services Toolkit2.4. So I wonder in the latest version, the class,
DefinitionFactory is not available?

import com.ibm.wsdl.xml.*;
import javax.wsdl.*;
import javax.wsdl.factory.*;

public class WSDL4JCreateSample
{
    public static void main(String[] args)
    {
        try
        {
            Definition def =
DefinitionFactory.newInstance().newDefinition();
        }
        catch (WSDLException ex)
        {
            System.out.println("Exception - fault code : " +
ex.getFaultCode());
        }
    }
}

When I compile the following code, WSDLReader and InputSource can not be
resolved. I found that WSDLReader was in javax.wsdl.xml.*. So I added a new
import, "import javax.wsdl.xml.*;", into the code. Although WSDLReader can
be resolved, InputSource is still not resolved. So I wonder the wsdl4j.jar
in the book is different from the one on my linux box. Do you think so?

import com.ibm.wsdl.xml.*;
import javax.wsdl.*;
import javax.wsdl.factory.*;

public class WSDL4JReadSample
{
    public static void main(String[] args)
    {
        try
        {
            Definition def = WSDLReader.readWSDL(null, new
InputSource("http://localhost:8080/wrox/wsdl/AddressBook-service.wsdl";));
        }
        catch (WSDLException ex)
        {
            System.out.println("Exception - fault code : " +
ex.getFaultCode());
        }
    }
}

By the way, could you please provide me with some samples on how to use
APIs
in wsdl4j.jar?

Thanks so much,
Li Bing

----- Original Message -----
From: "Russell Butek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 19, 2002 6:20 AM
Subject: Re: WSDL4J


AXIS uses WSDL4J, particularly Java2WSDL and WSDL2Java.  Take a look at the
source in org/apache/axis/wsdl/toJava and .../fromJava and see if that
helps.

If you have any particular questions, I can try to answer them.

Russell Butek
[EMAIL PROTECTED]


Li Bing <[EMAIL PROTECTED]> on 03/19/2002 02:12:56 AM

Please respond to [EMAIL PROTECTED]

To:    AXIS-USER <[EMAIL PROTECTED]>
cc:
Subject:    WSDL4J




Dear all,

Anyone familar with WSDL4J? I can  hardly find any resources that can
provide me some examples to use  WSDL4J.

Thanks so much in  advance!
Li Bing

  _.--"""--._
  .' '-.  `.
  __/__ (-. `\
  /o `o \ \ \
  _\__.__/ )) | |
  .--;"   | |
  (   `)   | |
_|`---'  .' _, _|   | `\
'`_\   \ '_,.-';_.-`\|   \ \_
  .' '--'---;` / / |\   |_..--'
  \'-'.' .--'.__/   __.-;
  `"` (___...---''`
  _/_
  /ASU\ [EMAIL PROTECTED]
  \___/ 480-965-9038(L),  602-743-9767(C)
  http://www.public.asu.edu/~libing





Reply via email to