You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Martin Loeffelholz <ma...@dai-labor.de> on 2010/11/07 16:04:38 UTC

Dynamic Client: Serializable Parameters

Hello all,

I have a new problem using the dynamic Client. I need all created
Datatypes that are used as parameters or results to implement the
interface Serializable. Is there possibly an option to make the
framework just add "implements Serializable" to all created datatypes?

The reason for my problem is: In the framework, I try to integrate
dynamic clients into, all webservices would be invoked from
softwareagents other than the one that manages the clients. So to have
them invoke the services first my agent has to tell them what classes to
use and then receive their messages with the parameters for the actual
invocation of the webservice. 
But for transmitting informations about the Webservices managed with the
dynamic clients and sending parameters and results from one agent to
another they must be Serializable.

Or if there is none such option within the system. Does anyone know how
I would have to extend the dynamicClientFactory to get it to do that?

hopeful greetings
    Martin


Re: Dynamic Client: Serializable Parameters

Posted by loeffelholz <Ma...@dai-labor.de>.
Hello Freeman,

I just tested your suggestion and it worked! 
Thanks very much!! It really now seems that all complex types are indeed
implementing Serializable!

That really drops an avalanche of stones from my heart. :-)
Thank you for that great solution.
  Marty

-- 
View this message in context: http://cxf.547215.n5.nabble.com/Dynamic-Client-Serializable-Parameters-tp3254029p3264697.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Dynamic Client: Serializable Parameters

Posted by Freeman Fang <fr...@gmail.com>.
Hi Marty,

Could you change your Serializable.xml as
<?xml version="1.0" encoding="UTF-8"?>
<bindings xmlns="http://java.sun.com/xml/ns/jaxb"
             xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
             xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
             xsi:schemaLocation="
http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd 
"
version="2.1">
   <globalBindings>
     <serializable uid="1" />
   </globalBindings>
</bindings>
and try it again?

Freeman
On 2010-11-11, at 下午8:00, Martin Loeffelholz wrote:

> Hello Dan,
>
> thanks for the advice. I searched for possible jaxb customizations.  
> What
> I found was this schema:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
>        xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
> elementFormDefault="qualified" attributeFormDefault="unqualified"
>        jaxb:extensionBindingPrefixes="xjc"
> jaxb:version="1.0">
>        <xs:annotation>
>                <xs:appinfo>
>                        <jaxb:globalBindings>
>                                <xjc:serializable/>
>                        </jaxb:globalBindings>
>                </xs:appinfo>
>        </xs:annotation>
> </xs:schema>
>
> I put it into a file, named it Serializable.xml and as my test service
> was just down, tried it with the wsdl2java tool instead, passing it  
> via
> the -b parameter.
>
> Which doesn't seem to do the trick. All complex datatypes generated
> where still without the needed interface. There were no error messages
> or exceptions though and all classes were generated as before.
>
> I found other "solutions" too, like that from your correspondence with
> daniel.mfreitas. But they are binding the needed interfaces on
> explicitly stated wsdls and schemes. (And didn't seem to work  
> either) I
> just want to inject this java.io.Serializable interface on every non
> primitive type, that ever will be created using the dynamic-client
> and/or wsdl2java.
>
> I know it's probable more like a jaxb problem than one of cxf but as
> also others within the community seem or seemed to have similar  
> issues,
> do you perhaps have an Idea or a hint how it could be done?
>
> hopeful greetings
>    Marty
>
>
>
>
> Am Montag, den 08.11.2010, 21:51 +0100 schrieb Daniel Kulp:
>> With 2.3.0 (likely for 2.2.11 as well), we added a parameter to the
>> createClient methods on the DynamicClient to specify binding files  
>> to pass to
>> jaxb.    There is a jaxb binding customization to have it set the  
>> generated
>> beans as serializable which would be applicable to this.
>>
>> Dan
>>
>>
>> On Sunday 07 November 2010 10:04:38 am Martin Loeffelholz wrote:
>>> Hello all,
>>>
>>> I have a new problem using the dynamic Client. I need all created
>>> Datatypes that are used as parameters or results to implement the
>>> interface Serializable. Is there possibly an option to make the
>>> framework just add "implements Serializable" to all created  
>>> datatypes?
>>>
>>> The reason for my problem is: In the framework, I try to integrate
>>> dynamic clients into, all webservices would be invoked from
>>> softwareagents other than the one that manages the clients. So to  
>>> have
>>> them invoke the services first my agent has to tell them what  
>>> classes to
>>> use and then receive their messages with the parameters for the  
>>> actual
>>> invocation of the webservice.
>>> But for transmitting informations about the Webservices managed  
>>> with the
>>> dynamic clients and sending parameters and results from one agent to
>>> another they must be Serializable.
>>>
>>> Or if there is none such option within the system. Does anyone  
>>> know how
>>> I would have to extend the dynamicClientFactory to get it to do  
>>> that?
>>>
>>> hopeful greetings
>>>    Martin
>>
>
>
>


-- 
Freeman Fang

------------------------

FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: Dynamic Client: Serializable Parameters

Posted by Martin Loeffelholz <ma...@dai-labor.de>.
Hello Dan,

thanks for the advice. I searched for possible jaxb customizations. What
I found was this schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
        xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" 
elementFormDefault="qualified" attributeFormDefault="unqualified"
        jaxb:extensionBindingPrefixes="xjc" 
jaxb:version="1.0">
        <xs:annotation>
                <xs:appinfo>
                        <jaxb:globalBindings>
                                <xjc:serializable/>
                        </jaxb:globalBindings>
                </xs:appinfo>
        </xs:annotation>
</xs:schema> 

I put it into a file, named it Serializable.xml and as my test service
was just down, tried it with the wsdl2java tool instead, passing it via
the -b parameter. 

Which doesn't seem to do the trick. All complex datatypes generated
where still without the needed interface. There were no error messages
or exceptions though and all classes were generated as before.

I found other "solutions" too, like that from your correspondence with
daniel.mfreitas. But they are binding the needed interfaces on
explicitly stated wsdls and schemes. (And didn't seem to work either) I
just want to inject this java.io.Serializable interface on every non
primitive type, that ever will be created using the dynamic-client
and/or wsdl2java.

I know it's probable more like a jaxb problem than one of cxf but as
also others within the community seem or seemed to have similar issues,
do you perhaps have an Idea or a hint how it could be done?

hopeful greetings
    Marty




Am Montag, den 08.11.2010, 21:51 +0100 schrieb Daniel Kulp: 
> With 2.3.0 (likely for 2.2.11 as well), we added a parameter to the 
> createClient methods on the DynamicClient to specify binding files to pass to 
> jaxb.    There is a jaxb binding customization to have it set the generated 
> beans as serializable which would be applicable to this.
> 
> Dan
> 
> 
> On Sunday 07 November 2010 10:04:38 am Martin Loeffelholz wrote:
> > Hello all,
> > 
> > I have a new problem using the dynamic Client. I need all created
> > Datatypes that are used as parameters or results to implement the
> > interface Serializable. Is there possibly an option to make the
> > framework just add "implements Serializable" to all created datatypes?
> > 
> > The reason for my problem is: In the framework, I try to integrate
> > dynamic clients into, all webservices would be invoked from
> > softwareagents other than the one that manages the clients. So to have
> > them invoke the services first my agent has to tell them what classes to
> > use and then receive their messages with the parameters for the actual
> > invocation of the webservice.
> > But for transmitting informations about the Webservices managed with the
> > dynamic clients and sending parameters and results from one agent to
> > another they must be Serializable.
> > 
> > Or if there is none such option within the system. Does anyone know how
> > I would have to extend the dynamicClientFactory to get it to do that?
> > 
> > hopeful greetings
> >     Martin
> 




Re: Dynamic Client: Serializable Parameters

Posted by Daniel Kulp <dk...@apache.org>.
With 2.3.0 (likely for 2.2.11 as well), we added a parameter to the 
createClient methods on the DynamicClient to specify binding files to pass to 
jaxb.    There is a jaxb binding customization to have it set the generated 
beans as serializable which would be applicable to this.

Dan


On Sunday 07 November 2010 10:04:38 am Martin Loeffelholz wrote:
> Hello all,
> 
> I have a new problem using the dynamic Client. I need all created
> Datatypes that are used as parameters or results to implement the
> interface Serializable. Is there possibly an option to make the
> framework just add "implements Serializable" to all created datatypes?
> 
> The reason for my problem is: In the framework, I try to integrate
> dynamic clients into, all webservices would be invoked from
> softwareagents other than the one that manages the clients. So to have
> them invoke the services first my agent has to tell them what classes to
> use and then receive their messages with the parameters for the actual
> invocation of the webservice.
> But for transmitting informations about the Webservices managed with the
> dynamic clients and sending parameters and results from one agent to
> another they must be Serializable.
> 
> Or if there is none such option within the system. Does anyone know how
> I would have to extend the dynamicClientFactory to get it to do that?
> 
> hopeful greetings
>     Martin

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