You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by qu...@aol.com on 2008/05/02 02:15:48 UTC

Binding to extended wsdl types

I have a type defined in document/literal/wrapped style that extends another type. I was wondering if its possible to communicate to CXF the subtype being used in a way other than via a type attribute in the super type xml tag. 

Heres my type definition:

<complexType abstract="true" name="Person">
? <sequence>
??? <element ...
? </sequence>
</complexType>

<complexType name="User">
? <complexContent>
??? <extension base="Person">
????? <sequence>
??????? <element ...>
????? </sequence>
??? </extension>
? </complexContent>
</complexType>


When send the SOAP over the wire (successfully), it looks like this: 

<Person xsi:type="ns3:User" xmlns:ns3="...">
? ...
</Person>

My question again - is there another way to communicate the type (User) being represented? Is there a way to use a wsdl element called "type" that is used by jaxb for custom binding? Such as:

<simpleType name="PersonType">
? <restriction base="xsd:string">
??? <enumeration value="User"/>
? </restriction>
</simpleType>

<complexType abstract="true" name="Person">

? <sequence>

??? <element ...
??? <element name="type" type="PersonType">

? </sequence>

</complexType>

Thanks

Re: Binding to extended wsdl types

Posted by Daniel Kulp <dk...@apache.org>.
Maybe.  I don't really know.   CXF can use standard jaxb binding 
configuration files at code generation time (providing your code 
generation is done via wsdl2java or other jaxb tools). There might be 
something in the jaxb binding files that allow that.   I'm not really 
sure.   You'd have to check the jaxb spec or maybe ask on the jaxb ri 
mailing lists.

Dan



quakexpert@aol.com wrote:
>  Got it, yeah clearly it was I who didn't understand your response. 
> 
> Does CXF have any configuration (other than annotations) to add custom jaxb binding via xmlTypeAdapter? My project auto-generates our valueObjects, along with their jax-ws annotations, which means I would need to add the @XmlTypeAdapter every time we regenerated our value objects. 
> 
> 
>  
> 
> 
>  
> 
> -----Original Message-----
> From: Benson Margulies <bi...@gmail.com>
> To: users@cxf.apache.org
> Sent: Thu, 1 May 2008 8:46 pm
> Subject: Re: Binding to extended wsdl types
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Yes, I follow the question, and I suspect that an answer might be hiding in
> @XmlTypeAdapter.
> 
> On Thu, May 1, 2008 at 8:44 PM, <qu...@aol.com> wrote:
> 
>>  Well CXF is sending to back just fine. It does indeed, as you suggest,
>> use xsi:type. What I am wondering is - is there any way to setup special
>> binding rules or other configuration on the server side so that I, as a
>> client, can use another way of communicating the type to the server.
>>
>> The use case that motivated the question is that some scripting language
>> frameworks have a hard time sending xsi types. I am wondering if I can get
>> around sending an xsi type by using some alternate method: for example by
>> sending some wsdl "element" that happens to be named "type" and for which I
>> have set up binding rules on the server-side.
>>
>> Does my question make sense?
>>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Benson Margulies <bi...@gmail.com>
>> To: users@cxf.apache.org
>> Sent: Thu, 1 May 2008 8:38 pm
>> Subject: Re: Binding to extended wsdl types
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> What you want is xsi:type. I have no idea how to make JAXB send it, but
>> the
>> Aegis data binding uses it consistently. Perhaps one of my fellow
>> travellers
>> can tell how to do it with JAXB.
>>
>> A quick google seems to suggest that @XmlTypeAdapter might be needed.
>>
>>
>>
>>
>>
>>
> 
> 
> 
>  
> 
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Binding to extended wsdl types

Posted by Benson Margulies <bi...@gmail.com>.
Not to my knowledge, no.

On Fri, May 2, 2008 at 11:11 AM, <qu...@aol.com> wrote:

>
>  Got it, yeah clearly it was I who didn't understand your response.
>
> Does CXF have any configuration (other than annotations) to add custom
> jaxb binding via xmlTypeAdapter? My project auto-generates our valueObjects,
> along with their jax-ws annotations, which means I would need to add the
> @XmlTypeAdapter every time we regenerated our value objects.
>
>
>
>
>
>
>
> -----Original Message-----
> From: Benson Margulies <bi...@gmail.com>
> To: users@cxf.apache.org
> Sent: Thu, 1 May 2008 8:46 pm
> Subject: Re: Binding to extended wsdl types
>
>
>
>
>
>
>
>
>
>
> Yes, I follow the question, and I suspect that an answer might be hiding
> in
> @XmlTypeAdapter.
>
> On Thu, May 1, 2008 at 8:44 PM, <qu...@aol.com> wrote:
>
> >
> >  Well CXF is sending to back just fine. It does indeed, as you suggest,
> > use xsi:type. What I am wondering is - is there any way to setup special
> > binding rules or other configuration on the server side so that I, as a
> > client, can use another way of communicating the type to the server.
> >
> > The use case that motivated the question is that some scripting language
> > frameworks have a hard time sending xsi types. I am wondering if I can
> get
> > around sending an xsi type by using some alternate method: for example
> by
> > sending some wsdl "element" that happens to be named "type" and for
> which I
> > have set up binding rules on the server-side.
> >
> > Does my question make sense?
> >
> >
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Benson Margulies <bi...@gmail.com>
> > To: users@cxf.apache.org
> > Sent: Thu, 1 May 2008 8:38 pm
> > Subject: Re: Binding to extended wsdl types
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > What you want is xsi:type. I have no idea how to make JAXB send it, but
> > the
> > Aegis data binding uses it consistently. Perhaps one of my fellow
> > travellers
> > can tell how to do it with JAXB.
> >
> > A quick google seems to suggest that @XmlTypeAdapter might be needed.
> >
> >
> >
> >
> >
> >
>
>
>
>
>
>

Re: Binding to extended wsdl types

Posted by qu...@aol.com.
 Got it, yeah clearly it was I who didn't understand your response. 

Does CXF have any configuration (other than annotations) to add custom jaxb binding via xmlTypeAdapter? My project auto-generates our valueObjects, along with their jax-ws annotations, which means I would need to add the @XmlTypeAdapter every time we regenerated our value objects. 


 


 

-----Original Message-----
From: Benson Margulies <bi...@gmail.com>
To: users@cxf.apache.org
Sent: Thu, 1 May 2008 8:46 pm
Subject: Re: Binding to extended wsdl types










Yes, I follow the question, and I suspect that an answer might be hiding in
@XmlTypeAdapter.

On Thu, May 1, 2008 at 8:44 PM, <qu...@aol.com> wrote:

>
>  Well CXF is sending to back just fine. It does indeed, as you suggest,
> use xsi:type. What I am wondering is - is there any way to setup special
> binding rules or other configuration on the server side so that I, as a
> client, can use another way of communicating the type to the server.
>
> The use case that motivated the question is that some scripting language
> frameworks have a hard time sending xsi types. I am wondering if I can get
> around sending an xsi type by using some alternate method: for example by
> sending some wsdl "element" that happens to be named "type" and for which I
> have set up binding rules on the server-side.
>
> Does my question make sense?
>
>
>
>
>
>
>
> -----Original Message-----
> From: Benson Margulies <bi...@gmail.com>
> To: users@cxf.apache.org
> Sent: Thu, 1 May 2008 8:38 pm
> Subject: Re: Binding to extended wsdl types
>
>
>
>
>
>
>
>
>
>
> What you want is xsi:type. I have no idea how to make JAXB send it, but
> the
> Aegis data binding uses it consistently. Perhaps one of my fellow
> travellers
> can tell how to do it with JAXB.
>
> A quick google seems to suggest that @XmlTypeAdapter might be needed.
>
>
>
>
>
>



 


Re: Binding to extended wsdl types

Posted by Benson Margulies <bi...@gmail.com>.
Yes, I follow the question, and I suspect that an answer might be hiding in
@XmlTypeAdapter.

On Thu, May 1, 2008 at 8:44 PM, <qu...@aol.com> wrote:

>
>  Well CXF is sending to back just fine. It does indeed, as you suggest,
> use xsi:type. What I am wondering is - is there any way to setup special
> binding rules or other configuration on the server side so that I, as a
> client, can use another way of communicating the type to the server.
>
> The use case that motivated the question is that some scripting language
> frameworks have a hard time sending xsi types. I am wondering if I can get
> around sending an xsi type by using some alternate method: for example by
> sending some wsdl "element" that happens to be named "type" and for which I
> have set up binding rules on the server-side.
>
> Does my question make sense?
>
>
>
>
>
>
>
> -----Original Message-----
> From: Benson Margulies <bi...@gmail.com>
> To: users@cxf.apache.org
> Sent: Thu, 1 May 2008 8:38 pm
> Subject: Re: Binding to extended wsdl types
>
>
>
>
>
>
>
>
>
>
> What you want is xsi:type. I have no idea how to make JAXB send it, but
> the
> Aegis data binding uses it consistently. Perhaps one of my fellow
> travellers
> can tell how to do it with JAXB.
>
> A quick google seems to suggest that @XmlTypeAdapter might be needed.
>
>
>
>
>
>

Re: Binding to extended wsdl types

Posted by qu...@aol.com.
 Well CXF is sending to back just fine. It does indeed, as you suggest, use xsi:type. What I am wondering is - is there any way to setup special binding rules or other configuration on the server side so that I, as a client, can use another way of communicating the type to the server. 

The use case that motivated the question is that some scripting language frameworks have a hard time sending xsi types. I am wondering if I can get around sending an xsi type by using some alternate method: for example by sending some wsdl "element" that happens to be named "type" and for which I have set up binding rules on the server-side. 

Does my question make sense?


 


 

-----Original Message-----
From: Benson Margulies <bi...@gmail.com>
To: users@cxf.apache.org
Sent: Thu, 1 May 2008 8:38 pm
Subject: Re: Binding to extended wsdl types










What you want is xsi:type. I have no idea how to make JAXB send it, but the
Aegis data binding uses it consistently. Perhaps one of my fellow travellers
can tell how to do it with JAXB.

A quick google seems to suggest that @XmlTypeAdapter might be needed.



 


Re: Binding to extended wsdl types

Posted by Benson Margulies <bi...@gmail.com>.
What you want is xsi:type. I have no idea how to make JAXB send it, but the
Aegis data binding uses it consistently. Perhaps one of my fellow travellers
can tell how to do it with JAXB.

A quick google seems to suggest that @XmlTypeAdapter might be needed.