With XMLBeans, I think you have to use beans that have been generated from
schema using XMLBeans schema compiler things. I don't think the current
XMLBeans databinding supports a pure java first use case.
Dan
On Monday 29 November 2010 1:23:57 pm Sundar Ramamurthy wrote:
> Dan -
>
> This is the Address class
> #------------ Start Address.java-------------
> package com.ntta.integration.dto;
> public class Address {
> public String address1;
> public String address2;
> public String address3;
> public String city;
> public String postalCode;
> public String state;
> public String county;
> public Integer countryCode;
>
> }
> #---End --Address.java
>
> But I am using XMLBeans for the data binding and not JAXB. As you can
> see, I don't have a no-arg constructor.
>
> The exception I see in my server log is:
> [#|2010-11-24T12:11:27.413-0600|SEVERE|sun-appserver2.1|org.apache.cxf.x
> mlbeans.XmlBeansSchemaInitializer|_ThreadID=15;_ThreadName=Thread-236;_R
> equestID=b2b69faf-6bb5-4a64-a8c0-dd2927448686;|com.ntta.integration.dto.
> Address was not found in class map|#
>
>
> Thanks
> Sundar Ramamurthy
>
> -----Original Message-----
> From: Daniel Kulp [mailto:[email protected]]
> Sent: Monday, November 29, 2010 10:51 AM
> To: [email protected]
> Cc: Sundar Ramamurthy
> Subject: Re: need to expose a custom java class as a datatype in the
> wsdl
>
>
> What does the Address class look like? Does it have a public no-arg
> constructor? It sounds like JAXB wasn't able to map the class.
>
> Dan
>
> On Wednesday 24 November 2010 2:19:01 pm Sundar wrote:
> > I am doing a "java-first" approach in exposing a service (i am using
> > jaws:endpoint) .
> > I have a java class with a method that accepts a custom java class as
>
> a
>
> > parameter. After i deploy this code (i am using jax-ws/XMLbeans data
> > binding, cxf 2.2.8), I don't see any type attribute for the input
>
> parameter
>
> > The method is:
> > @WebMethod(operationName= "sayHi2")
> > public String sayHi2(
> > @WebParam(name = "addressInfo",
> >
> > targetNamespace = "java:com.ntta.integration.dto")
> > Address inputXML
> >
> > ) {
> >
> > System.out.println("getPerson called :");
> > return "Snundar";
> >
> > }
> >
> > where "Address" is a java class (in a package
>
> com.ntta.integration.dto)
>
> > and the wsdl generated says:
> >
> > <xsd:element name="sayHi2" type="tns:sayHi2"></xsd:element>
> >
> > <xsd:complexType name="sayHi2">
> >
> > <xsd:sequence>
> >
> > <xsd:element form="qualified" minOccurs="0"
> >
> > name="addressInfo"></xsd:element>
> >
> > </xsd:sequence>
> >
> > </xsd:complexType>
> > <xsd:element name="sayHi2Response"
> >
> > type="tns:sayHi2Response"></xsd:element>
> >
> > <xsd:complexType name="sayHi2Response">
> >
> > <xsd:sequence>
> >
> > <xsd:element minOccurs="0" name="return"
> >
> > type="xsd:string"></xsd:element>
> >
> > </xsd:sequence>
> >
> > </xsd:complexType>
> >
> > It does not generate the "type" attribute for the "addressInfo"
>
> element nor
>
> > is there any import for the namespace "com.ntta.integration.dto" . How
>
> do i
>
> > expose the java class as a Complex DataType ? I tried to put
>
> @XmlType() in
>
> > the java bean (Address.java), but this did not make any difference.
> >
> > Thanks
> > Sundar Ramamurthy
--
Daniel Kulp
[email protected]
http://dankulp.com/blog