Actually using WSDL2Java is MUCH easier than that Robert
specifically here are the options that are available-
Usage:  java org.apache.axis.wsdl.WSDL2Java [options] WSDL-URI
Options:
        -h, --help
                print this message and exit
        -v, --verbose
                print informational messages
        -n, --noImports
                only generate code for the immediate WSDL document
        -O, --timeout <argument>
                timeout in seconds (default is 45, specify -1 to disable)
        -D, --Debug
                print debug information
        -W, --noWrapped
                turn off support for "wrapped" document/literal
        -q, --quiet
                do not print any informational or debug messages (except err
                ors)
        -s, --server-side
                emit server-side bindings for web service
        -S, --skeletonDeploy <argument>
                deploy skeleton (true) or implementation (false) in deploy.w
                sdd.  Default is false.  Assumes --server-side.
        -N, --NStoPkg <argument>=<value>
                mapping of namespace to package
        -f, --fileNStoPkg <argument>
                file of NStoPkg mappings (default NStoPkg.properties)
        -p, --package <argument>
                override all namespace to package mappings, use this package
                 name instead
        -o, --output <argument>
                output directory for emitted files
        -d, --deployScope <argument>
                add scope to deploy.wsdd: "Application", "Request", "Session
                "
        -t, --testCase
                emit junit testcase class for web service
        -a, --all
                generate code for all elements, even unreferenced ones
        -T, --typeMappingVersion <argument>
                indicate 1.1 or 1.2.  The default is 1.1 (SOAP 1.1 JAX-RPC c
                ompliant.  1.2 indicates SOAP 1.1 encoded.)
        -F, --factory <argument>
                name of a custom class that implements GeneratorFactory inte
                rface (for extending Java generation functions)
        -H, --helperGen
                emits separate Helper classes for meta data
        -B, --buildFile
                emit Ant Buildfile for web service
        -U, --user <argument>
                username to access the WSDL-URI
        -P, --password <argument>
                password to access the WSDL-URI
        -X, --classpath
                additional classpath elements
        -i, --nsInclude <argument>
                include namespace in generated code
        -x, --nsExclude <argument>
                exclude namespace from generated code
        -c, --implementationClassName <argument>
                custom name of web service implementation
        -u, --allowInvalidURL
                emit file even if WSDL endpoint URL is not a valid URL
        -w, --wrapArrays
                Prefers building beans to straight arrays for wrapped XML ar
                ray types (defaults to off).

A bean is nothing more than a simple class with a noarg constructor e.g. and a few methods to handle what you sih to accomplishe.g. take a look at Calculator.java in samples folder..
 
public class Calculator
{
  public Calculator()
 { }

  public int add(int i1, int i2)
  {
    return i1 + i2;
  }
  public int subtract(int i1, int i2)
  {
    return i1 - i2;
  }
}
rename this to Calculator.jws then place in %TOMCAT_HOME%/webapps/axis
and AxisServlet will create a WebService here http://localhost:8080/axis/Calculator.jws
with characteristics defined in the wsdl illustrated here
 
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://localhost:8080/axis/Calculator.jws" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8080/axis/Calculator.jws" xmlns:intf="http://localhost:8080/axis/Calculator.jws" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <!-- WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
- <wsdl:message name="subtractRequest">
  <wsdl:part name="i1" type="xsd:int" />
  <wsdl:part name="i2" type="xsd:int" />
  </wsdl:message>
- <wsdl:message name="subtractResponse">
  <wsdl:part name="subtractReturn" type="xsd:int" />
  </wsdl:message>
- <wsdl:message name="addResponse">
  <wsdl:part name="addReturn" type="xsd:int" />
  </wsdl:message>
- <wsdl:message name="addRequest">
  <wsdl:part name="i1" type="xsd:int" />
  <wsdl:part name="i2" type="xsd:int" />
  </wsdl:message>
- <wsdl:portType name="Calculator">
- <wsdl:operation name="add" parameterOrder="i1 i2">
  <wsdl:input message="impl:addRequest" name="addRequest" />
  <wsdl:output message="impl:addResponse" name="addResponse" />
  </wsdl:operation>
- <wsdl:operation name="subtract" parameterOrder="i1 i2">
  <wsdl:input message="impl:subtractRequest" name="subtractRequest" />
  <wsdl:output message="impl:subtractResponse" name="subtractResponse" />
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="CalculatorSoapBinding" type="impl:Calculator">
  <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="add">
  <wsdlsoap:operation soapAction="" />
- <wsdl:input name="addRequest">
  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" />
  </wsdl:input>
- <wsdl:output name="addResponse">
  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/Calculator.jws" use="encoded" />
  </wsdl:output>
  </wsdl:operation>
- <wsdl:operation name="subtract">
  <wsdlsoap:operation soapAction="" />
- <wsdl:input name="subtractRequest">
  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" />
  </wsdl:input>
- <wsdl:output name="subtractResponse">
  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/Calculator.jws" use="encoded" />
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="CalculatorService">
- <wsdl:port binding="impl:CalculatorSoapBinding" name="Calculator">
  <wsdlsoap:address location="http://localhost:8080/axis/Calculator.jws" />
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions
 
HTH,
Martin --
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.
----- Original Message -----
Sent: Saturday, May 20, 2006 7:26 AM
Subject: Re: Migrating to Axis 2

To help, I'd need to see your command line / ant options you are passing to wsdl2java.

If you are migrating from axis  1.x , did you take a look at the databinding section in the migration guide?

http://ws.apache.org/axis2/1_0/migration.html

Robert
http://www.braziloutsource.com/

On 5/20/06, Scott McCoy <[EMAIL PROTECTED] > wrote:
Okay, attached is a WSDL that worked fine for generating very simple to use wrapped document/literal services with WSDL2Java.

Now, the code WSDL2Java generates is as though the wrapped document/literal convention is broken.

It accepts a "Request" bean for each argument, and expects a "Response" bean in return.

What the heck?

    Thanks,
    Scott S. McCoy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to