axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anne Thomas Manes" <atma...@gmail.com>
Subject Re: AXIS 1.3: Unable to generate client code using wsdl2java ant task
Date Sat, 06 May 2006 13:24:00 GMT
Joshua,

I suggest that rather than attempting to write a WSDD by hand, write your
Java class, compiled with debugging on, then run java2wsdl on that class
specifying the WRAPPED option, then run wsdl2java to generate your WSDD.

Anne

On 5/6/06, Anne Thomas Manes <atmanes@gmail.com> wrote:
>
> Joshua,
>
> A beanMapping specifies a one-to-one mapping of an XML element (defined by
> its qualified name) to its associated JavaBean. You should have only one
> beanMapping statement for each XML qname.
>
> For example, if you have the following XML element:
>
> <foo:foobar xmlns:foo="urn:foo.bar">
>     <foo:baz>some string</foo:baz>
> </foo:foobar>
>
> And you want to map it to a bean in the package
>
> com.bar.foo.foobar
>
> then you would define a beanMapping like so:
>
> <beanMapping
> xmlns:foo="urn: foo.bar"
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
> qname="foo:foobar"
> languageSpecificType="java:com.bar.foo.foobar"/>
>
> Note that the namespace declarations must match the prefixes that you use
> in the referenced qnames ("foo:foobar" requires that I declare the "foo"
> namespace and "java:com.bar.foo.foobar " requires that I declare the
> "java" namespace). These namespace declarations can (and typically are)
> declared in the <service> element rather than in each <beanmapping>.
>
>
> Anne
>
> On 5/5/06, Joshua.White@hartfordlife.com <Joshua.White@hartfordlife.com >
> wrote:
> >
> >
> > Anne,
> >
> > I was able to get the generator to generate a client by playing around
> > with the bean mappings.  If it is not obvious to you already, I am new at
> > this.  What should my bean mappings look like?  This is what I have now:
> >
> >         <beanMapping qname="java:Address" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.Address "/>
> >         <beanMapping qname="java:BaseDomainObject" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.BaseDomainObject "/>
> >         <beanMapping qname="java:BaseDomainObjectWithHistory"
> > xmlns:ns="java:mycompany.consumer.webservice.dto"
> > languageSpecificType="java:
> > mycompany.consumer.webservice.dto.BaseDomainObjectWithHistory "/>
> >         <beanMapping qname="java:Case" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.Case"/>
> >         <beanMapping qname="java:Consumer" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.Consumer "/>
> >         <beanMapping qname="java:ContactLocation" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.ContactLocation "/>
> >         <beanMapping qname="java:ContactLocationPreference"
> > xmlns:ns="java:mycompany.consumer.webservice.dto"
> > languageSpecificType="java:
> > mycompany.consumer.webservice.dto.ContactLocationPreference "/>
> >         <beanMapping qname="java:ContactLocationType" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.ContactLocationType "/>
> >         <beanMapping qname="java:ContactMethod" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.ContactMethod "/>
> >         <beanMapping qname="java:DomainObject" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.DomainObject "/>
> >         <beanMapping qname="java:EligibilityProfile" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.EligibilityProfile "/>
> >         <beanMapping qname="java:Email" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.Email "/>
> >         <beanMapping qname="java:ExternalSystemKey" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.ExternalSystemKey "/>
> >         <beanMapping qname="java:GbdOccupation" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.GbdOccupation "/>
> >         <beanMapping qname="java:Gender" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.Gender "/>
> >         <beanMapping qname="java:Party" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.Party "/>
> >         <beanMapping qname="java:Phone" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.Phone "/>
> >         <beanMapping qname="java:PhoneType" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.PhoneType "/>
> >         <beanMapping qname="java:ReferenceObject" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.ReferenceObject "/>
> >         <beanMapping qname="java:SourceSystem" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.SourceSystem "/>
> >         <beanMapping qname="java:State" xmlns:ns="java:
> > mycompany.consumer.webservice.dto" languageSpecificType="java:
> > mycompany.consumer.webservice.dto.State "/>
> >
> >
> >
> >
> >
> >
> > *"Anne Thomas Manes" <atmanes@gmail.com>*
> >
> > 05/05/2006 11:32 AM
> > Please respond to axis-user
> >
> >         To:        axis-user@ws.apache.org
> >         cc:
> >         Subject:        Re: AXIS 1.3: Unable to generate client code
> > using wsdl2java ant task
> >
> >
> > Joshua,
> >
> > This is not a valid schema construct:
> >
> >    <complexType name="local">
> >    <complexContent>
> >     <extension base="tns2:local">
> >
> > Just how did you generate this WSDL?
> >
> > Anne
> >
> > On 5/5/06, *Joshua.White@hartfordlife.com*<Joshua.White@hartfordlife.com><
> > *Joshua.White@hartfordlife.com* <Joshua.White@hartfordlife.com>> wrote:
> >
> > Anne,
> >
> > Here you go!
> >
> > Thanks,
> >
> > Joshua
> >
> >
> >
> >
> >
> >
> >
> >
> > *"Anne Thomas Manes" <* *atmanes@gmail.com* <atmanes@gmail.com>*>*
> >
> > 05/05/2006 10:57 AM
> >
> >
> > Please respond to axis-user
> >
> >        To:        *axis-user@ws.apache.org* <axis-user@ws.apache.org>
> >        cc:
> >         Subject:        Re: AXIS 1.3: Unable to generate client code
> > using wsdl2java ant task
> >
> >
> >
> > Can you provide the wsdl/schema that's causing the error please?
> >
> > On 5/5/06, *Joshua.White@hartfordlife.com *<Joshua.White@hartfordlife.com>
> > * *< * Joshua.White@hartfordlife.com* <Joshua.White@hartfordlife.com>>
> > wrote:
> >
> > More coffee...  This error is caused by Axis 1.3.
> >
> > -Joshua
> >
> >
> >
> >
> > *Joshua.White@hartfordlife.com * <Joshua.White@hartfordlife.com>
> >
> > 05/05/2006 10:24 AM
> > Please respond to axis-user
> >
> >       To:        *axis-user@ws.apache.org* * * <axis-user@ws.apache.org>
> >       cc:
> >       Subject:        AXIS 1.3: Unable to generate client code using
> > wsdl2java ant task
> >
> >
> >
> >
> >
> > All,
> >
> > When i run the wsdl2java ant task, it blows up with a
> > StackOverflowError.    The tool works when my web service only contains
> > simple datatypes, but blows up when I have a complex return type.  When
> > putting together the wsdd file, I had to add several "beanMapping" elements
> > (See below).  Is there a similar construct needed for the wsdl2java tool?
> >  Has anyone run into this problem?
> > *
> >
> >
> > SAMPLE FROM WSDD FILE*
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.Address"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.BaseDomainObject"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.BaseDomainObjectWithHistory"/>
> >       <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.Case"/>
> >       <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.Consumer"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.ContactLocation"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.ContactLocationPreference"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.ContactLocationType"/>
> >       <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.ContactMethod"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.DomainObject"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.EligibilityProfile"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.Email"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.ExternalSystemKey"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.Occupation"/>
> >       <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.Gender"/>
> >       <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.Party"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.Phone"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.PhoneType"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.ReferenceObject"/>
> >       <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.SourceSystem"/>
> >      <beanMapping qname="ns:local" xmlns:ns="java:
> > mycompany.webservice.dto" languageSpecificType="java:
> > mycompany.webservice.dto.State"/>
> > *
> >
> >
> > SAMPLE FROM ANT FILE*
> > <target name="generate" depends="init" description="executes axis
> > wsdl2java">
> >      <axis-wsdl2java
> >          output="${generated.dir}"
> >          testcase="false"
> >          verbose="true"
> >          typemappingversion="1.2"
> >          url="${wsdl.url}"
> >          debug="true">
> >      </axis-wsdl2java>
> >  </target> *
> >
> >
> > SAMPLE ERROR MESSAGE*
> > [axis-wsdl2java] Exception in thread "Thread-0"
> > java.lang.StackOverflowError
> > [axis-wsdl2java]        at
> > org.apache.axis.wsdl.symbolTable.SchemaUtils.getComplexElementExtensionBase
> > (SchemaUtils.java:1067)
> > [axis-wsdl2java]        at
> > org.apache.axis.wsdl.symbolTable.SchemaUtils.getBaseType(
> > SchemaUtils.java:2051)
> > [axis-wsdl2java]        at
> > org.apache.axis.wsdl.toJava.JavaGeneratorFactory.javifyTypeEntryName(
> > JavaGeneratorFactory.java:529)
> >
> >
> > *************************************************************************
> > This communication, including attachments, is
> > for the exclusive use of addressee and may contain proprietary,
> > confidential and/or privileged information. If you are not the intended
> > recipient, any use, copying, disclosure, dissemination or distribution
> > is
> > strictly prohibited. If you are not the intended recipient, please
> > notify
> > the sender immediately by return e-mail, delete this communication and
> > destroy all copies.
> > *************************************************************************
> >
> >
> >
> >
> >
> >
> >
> >
>

Mime
View raw message