Dan,

On Wednesday September 27 2006 10:17 am, Dan Diephouse wrote:
> You're telling me JAXB can do that? How? It can't read the JSR181
> annotations, so how would it know what they're named? Obviously it must
> be possible as Celtix does java2wsdl, but I'm a bit confused as to how.
> Can you maybe shed some more light on this?

An interesting coincidence....    a similar topic came up on the JSR-224 
expert group list yesterday as well.     There is a proposed "clarification" 
to be added for JAX-WS 2.1 to use the JAXB @XmlJavaTypeAdapter annotation in 
the SEI class.    I've included the text of the proposed clarification below.   
(keep in mind, it's a proposal, subject to change at any time, may not be 
accepted,  blah blah blah)

Enjoy!
Dan




Add the following to section 2.3.1 Message and Port

When generating an SEI from WSDL and XML schema, occasionally
ambiguities occur on what XML infoset should be used to represent a
method's return value or parameters.  In order to remove these
ambiguities, JAXB annotations may need to be generated on methods and
method parameters to assure that the return value and the parameters are
marshalled with the proper XML infoset. A JAXB annotation on the method
is used to specify the binding of a methods return type while an
annotation on the parameter specifies the binding of that parameter.
If the default XML infoset for the return type or parameters correctly
represents the XML infoset, no JAXB annotations are needed.

Conformance: (use of JAXB annotations) An SEI method/parameters MUST
contain the appropriate JAXB annotations to assure that the proper XML
infoset is used when marshalling/unmarshalling the return type or
parameters of the method.

Add the following to section 3.6 Method Parameters and Return Type

Since JAX-WS uses JAXB for it databinding, JAXB annotations on methods
and method parameters must be honored.  A JAXB annotation on the method
is used to specify the binding of a methods return type while an
annotation on the parameter specifies the binding of that parameter.

Conformance: (use of JAXB annotations) An implemenation MUST honor any
JAXB annotation that exists on an SEI method or parameter to assure that
the proper XML infoset is used when marshalling/unmarshalling the the
return value or parameters of the method.



On Wednesday September 27 2006 10:17 am, Dan Diephouse wrote:
> So lets say we have a service with the method:
>
> @WebResult(name="outText")  String echo(@WebParam(name="inText") String
> inText);
>
> Somehow we need to translate this into:
> <schema>
>   <element name="inText" type="xsd:string"/>
>   <element name="outText" type="xsd:string"/>
> </schema>
>
> You're telling me JAXB can do that? How? It can't read the JSR181
> annotations, so how would it know what they're named? Obviously it must
> be possible as Celtix does java2wsdl, but I'm a bit confused as to how.
> Can you maybe shed some more light on this?
>
> - Dan
>
> Jim Ma wrote:
> > Hi Dan,
> >
> > I have not found there is an api can get the schema type in the JAXB .
> > Celtix do not need the schema type information for every class.
> >
> > Celtix tool use JAXB to generate schema file first , then include this
> > schema file in the generated wsdl .
> >
> > Jim
> >
> >> -----Original Message-----
> >> From: Dan Diephouse [mailto:[EMAIL PROTECTED]
> >> Sent: Wednesday, September 27, 2006 4:53 AM
> >> To: Daniel Kulp
> >> Cc: [email protected]
> >> Subject: Re: Get schema types from JAXB?
> >>
> >> Daniel Kulp wrote:
> >>> Dan,
> >>>
> >>>> Anyone know if there is a way to get the schema type names
> >>
> >> from JAXB for
> >>
> >>>> a particular class? In XFire we always used Aegis for non JAXB
> >>
> >> types and
> >>
> >>>> we wrote some code to read the xml type names from the annotations
> >>>> too. I don't see anything that covers all the bases in the JAXB
> >>
> >> apis - so I'm
> >>
> >>>> wondering what Celtix did.
> >>>
> >>> I don't think we have anything cause I don't think Celtix ever
> >>
> >> NEEDED that
> >>
> >>> functionality/information.   What's the use case?
> >>>
> >>>> Basically I'm looking for something that
> >>>> returns "xsd:string" when I give it a String.class.
> >>>
> >>> Well, the problem is, String.class can also map to
> >>
> >> xsd:normalizedString or
> >>
> >>> some of the SimpleType restrictions.   Thus, that's not reliable.
> >>
> >> Use case is we're taking a class and generating a WSDL for it. To do
> >> this you have to figure out what the schema types are of the operation
> >> parameters.
> >>
> >> - Dan
> >>
> >> --
> >> Dan Diephouse
> >> Envoi Solutions
> >> http://envoisolutions.com
> >> http://netzooid.com/blog

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194   F:781-902-8001
[EMAIL PROTECTED]

Reply via email to