getter & setters wsimport

View: New views
12 Messages — Rating Filter:   Alert me  

getter & setters wsimport

by Felipe Gaucho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

WSIMPORT generates read-only Collections attributes ... but some
frameworks based on reflection requires the setter method to be
present.

question: is there a way to force wsimport to create the setter method ?

any other workaround ?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: getter & setters wsimport

by Glen Mazza :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hmmm...I think that is done by JAXB, not wsimport, and that rule is part is the JAXB standard:
http://www.nabble.com/Re%3A-not-calling-collection-setters-on-unmarshalling-p18354286.html

The below apparently can do this for you, but how to activate it from wsimport?  I don't know.
https://jaxb2-commons.dev.java.net/collection-setter-injector/ 

Glen

Felipe Gaucho wrote:
WSIMPORT generates read-only Collections attributes ... but some
frameworks based on reflection requires the setter method to be
present.

question: is there a way to force wsimport to create the setter method ?

any other workaround ?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net

Re: getter & setters wsimport

by Martin Grebac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can use -B option to pass JAXB related parameters to JAXB compiler
invoked from wsimport.

https://jax-ws.dev.java.net/nonav/2.1.2m1/docs/wsimport.html

 MartinG

Glen Mazza wrote:

> Hmmm...I think that is done by JAXB, not wsimport, and that rule is part is
> the JAXB standard:
> http://www.nabble.com/Re%3A-not-calling-collection-setters-on-unmarshalling-p18354286.html
>
> The below apparently can do this for you, but how to activate it from
> wsimport?  I don't know.
> https://jaxb2-commons.dev.java.net/collection-setter-injector/ 
>
> Glen
>
>
> Felipe Gaucho wrote:
>  
>> WSIMPORT generates read-only Collections attributes ... but some
>> frameworks based on reflection requires the setter method to be
>> present.
>>
>> question: is there a way to force wsimport to create the setter method ?
>>
>> any other workaround ?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>>
>>    
>
>  

--
Martin Grebac, http://blogs.sun.com/mgrebac

Web Technologies & Standards
Sun Microsystems Czech

ICQ: 93478885


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: getter & setters wsimport

by Felipe Gaucho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

humm.. problem is: it is a XJC argument and not JAXB..

If you have the solution, please sed me en example :)

This minor issue is avoiding the integration between FLEX and the
wsimport :( and the workaround splitting my WSDL in several small
documents to run the tools separately seems too much :)


On Mon, Aug 18, 2008 at 11:11 AM, Martin Grebac <Martin.Grebac@...> wrote:

> You can use -B option to pass JAXB related parameters to JAXB compiler
> invoked from wsimport.
>
> https://jax-ws.dev.java.net/nonav/2.1.2m1/docs/wsimport.html
>
> MartinG
>
> Glen Mazza wrote:
>>
>> Hmmm...I think that is done by JAXB, not wsimport, and that rule is part
>> is
>> the JAXB standard:
>>
>> http://www.nabble.com/Re%3A-not-calling-collection-setters-on-unmarshalling-p18354286.html
>>
>> The below apparently can do this for you, but how to activate it from
>> wsimport?  I don't know.
>> https://jaxb2-commons.dev.java.net/collection-setter-injector/
>> Glen
>>
>>
>> Felipe Gaucho wrote:
>>
>>>
>>> WSIMPORT generates read-only Collections attributes ... but some
>>> frameworks based on reflection requires the setter method to be
>>> present.
>>>
>>> question: is there a way to force wsimport to create the setter method ?
>>>
>>> any other workaround ?
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@...
>>> For additional commands, e-mail: users-help@...
>>>
>>>
>>>
>>>
>>
>>
>
> --
> Martin Grebac, http://blogs.sun.com/mgrebac
>
> Web Technologies & Standards
> Sun Microsystems Czech
>
> ICQ: 93478885
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: getter & setters wsimport

by Martin Grebac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I meant XJC compiler of course.
 MartinG

Felipe Gaúcho wrote:

> humm.. problem is: it is a XJC argument and not JAXB..
>
> If you have the solution, please sed me en example :)
>
> This minor issue is avoiding the integration between FLEX and the
> wsimport :( and the workaround splitting my WSDL in several small
> documents to run the tools separately seems too much :)
>
>
> On Mon, Aug 18, 2008 at 11:11 AM, Martin Grebac <Martin.Grebac@...> wrote:
>  
>> You can use -B option to pass JAXB related parameters to JAXB compiler
>> invoked from wsimport.
>>
>> https://jax-ws.dev.java.net/nonav/2.1.2m1/docs/wsimport.html
>>
>> MartinG
>>
>> Glen Mazza wrote:
>>    
>>> Hmmm...I think that is done by JAXB, not wsimport, and that rule is part
>>> is
>>> the JAXB standard:
>>>
>>> http://www.nabble.com/Re%3A-not-calling-collection-setters-on-unmarshalling-p18354286.html
>>>
>>> The below apparently can do this for you, but how to activate it from
>>> wsimport?  I don't know.
>>> https://jaxb2-commons.dev.java.net/collection-setter-injector/
>>> Glen
>>>
>>>
>>> Felipe Gaucho wrote:
>>>
>>>      
>>>> WSIMPORT generates read-only Collections attributes ... but some
>>>> frameworks based on reflection requires the setter method to be
>>>> present.
>>>>
>>>> question: is there a way to force wsimport to create the setter method ?
>>>>
>>>> any other workaround ?
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>> For additional commands, e-mail: users-help@...
>>>>
>>>>
>>>>
>>>>
>>>>        
>>>      
>> --
>> Martin Grebac, http://blogs.sun.com/mgrebac
>>
>> Web Technologies & Standards
>> Sun Microsystems Czech
>>
>> ICQ: 93478885
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>>    
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>  

--
Martin Grebac, http://blogs.sun.com/mgrebac

Web Technologies & Standards
Sun Microsystems Czech

ICQ: 93478885


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: getter & setters wsimport

by Felipe Gaucho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

my current ANT task:

    <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
        <classpath refid="jaxws.classpath" />
    </taskdef>

    <target name="build-server-wsdl">
        <wsimport debug="true" verbose="${verbose}" keep="true"
extension="false" destdir="${generated.dir}"
wsdl="${service.admin.wsdl}"
wsdllocation="${service.admin.wsdllocation}">
            <produces dir="${generated.dir}"
includes="${generated.dir}/**/*.java" />
        </wsimport>
        ..... * other lines here
    </target>


So, if you can point how can I include the -B param here, please do that :)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: getter & setters wsimport

by Martin Grebac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Oh, I see, it's the ant task. Not sure if wsimport ant task allows you
to pass JAXB options, but you can still replace it with invoking the
commandline wsimport (I understand it's quite a complication). Filing a
RFE might be worth it.
 MartinG

Felipe Gaúcho wrote:

> my current ANT task:
>
>     <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
>         <classpath refid="jaxws.classpath" />
>     </taskdef>
>
>     <target name="build-server-wsdl">
>         <wsimport debug="true" verbose="${verbose}" keep="true"
> extension="false" destdir="${generated.dir}"
> wsdl="${service.admin.wsdl}"
> wsdllocation="${service.admin.wsdllocation}">
>             <produces dir="${generated.dir}"
> includes="${generated.dir}/**/*.java" />
>         </wsimport>
>         ..... * other lines here
>     </target>
>
>
> So, if you can point how can I include the -B param here, please do that :)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>  

--
Martin Grebac, http://blogs.sun.com/mgrebac

Web Technologies & Standards
Sun Microsystems Czech

ICQ: 93478885


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: getter & setters wsimport

by Lukas Jungmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Martin Grebac wrote:
> Oh, I see, it's the ant task. Not sure if wsimport ant task allows you
> to pass JAXB options, but you can still replace it with invoking the
> commandline wsimport (I understand it's quite a complication). Filing a
> RFE might be worth it.

Isn't it already there? I mean isn't "-B" on the command line equal to
"<xjcarg>" in the Ant task?

just looking at the last example at
https://jax-ws.dev.java.net/nonav/2.1.3/docs/wsimportant.html

--lj


> MartinG
>
> Felipe Gaúcho wrote:
>> my current ANT task:
>>
>>     <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
>>         <classpath refid="jaxws.classpath" />
>>     </taskdef>
>>
>>     <target name="build-server-wsdl">
>>         <wsimport debug="true" verbose="${verbose}" keep="true"
>> extension="false" destdir="${generated.dir}"
>> wsdl="${service.admin.wsdl}"
>> wsdllocation="${service.admin.wsdllocation}">
>>             <produces dir="${generated.dir}"
>> includes="${generated.dir}/**/*.java" />
>>         </wsimport>
>>         ..... * other lines here
>>     </target>
>>
>>
>> So, if you can point how can I include the -B param here, please do
>> that :)
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: getter & setters wsimport

by Felipe Gaucho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks a lot Jungmann,

it finally worked:

        <wsimport debug="true" verbose="${verbose}" keep="true"
extension="false" destdir="${generated.dir}"
wsdl="${service.admin.wsdl}"
wsdllocation="${service.admin.wsdllocation}">
            <produces dir="${generated.dir}"
includes="${generated.dir}/**/*.java" />
            <xjcarg value="-Xcollection-setter-injector"/>
        </wsimport>

Now I have to decide whatever it is correct or not, but at least I can
release the FLEX developers to consume my service..

* I believe the strategy of do not expose setters for collection is
sound and much more elegant than the classical get/set pattern, but
unfortunately some other technologies don't think like that :( and
interoperability is one of our best goals :)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: getter & setters wsimport

by Lukas Jungmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Felipe Gaúcho wrote:
> Thanks a lot Jungmann,
>
> it finally worked:

happy to help,

regards,
--lj

>
>         <wsimport debug="true" verbose="${verbose}" keep="true"
> extension="false" destdir="${generated.dir}"
> wsdl="${service.admin.wsdl}"
> wsdllocation="${service.admin.wsdllocation}">
>             <produces dir="${generated.dir}"
> includes="${generated.dir}/**/*.java" />
>             <xjcarg value="-Xcollection-setter-injector"/>
>         </wsimport>
>
> Now I have to decide whatever it is correct or not, but at least I can
> release the FLEX developers to consume my service..
>
> * I believe the strategy of do not expose setters for collection is
> sound and much more elegant than the classical get/set pattern, but
> unfortunately some other technologies don't think like that :( and
> interoperability is one of our best goals :)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: getter & setters wsimport

by Martin Grebac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Right, that's exactly it. Thanks,
 MartinG

Lukas Jungmann wrote:

> Martin Grebac wrote:
>> Oh, I see, it's the ant task. Not sure if wsimport ant task allows
>> you to pass JAXB options, but you can still replace it with invoking
>> the commandline wsimport (I understand it's quite a complication).
>> Filing a RFE might be worth it.
>
> Isn't it already there? I mean isn't "-B" on the command line equal to
> "<xjcarg>" in the Ant task?
>
> just looking at the last example at
> https://jax-ws.dev.java.net/nonav/2.1.3/docs/wsimportant.html
>
> --lj
>
>
>> MartinG
>>
>> Felipe Gaúcho wrote:
>>> my current ANT task:
>>>
>>>     <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
>>>         <classpath refid="jaxws.classpath" />
>>>     </taskdef>
>>>
>>>     <target name="build-server-wsdl">
>>>         <wsimport debug="true" verbose="${verbose}" keep="true"
>>> extension="false" destdir="${generated.dir}"
>>> wsdl="${service.admin.wsdl}"
>>> wsdllocation="${service.admin.wsdllocation}">
>>>             <produces dir="${generated.dir}"
>>> includes="${generated.dir}/**/*.java" />
>>>         </wsimport>
>>>         ..... * other lines here
>>>     </target>
>>>
>>>
>>> So, if you can point how can I include the -B param here, please do
>>> that :)
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@...
>>> For additional commands, e-mail: users-help@...
>>>
>>>  
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>

--
Martin Grebac, http://blogs.sun.com/mgrebac

Web Technologies & Standards
Sun Microsystems Czech

ICQ: 93478885


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: getter & setters wsimport

by Felipe Gaucho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

humm.. we celebrated too early :)

It works fantastically well with Lists (maxOccurs='unbounded'), but
fail to generate setter on Maps (choice XSD elements)   :(

I guess a next version of wsimport can give us an easy parameter to
switch on/off the generation of the setters without the need of
extensions..  I will open a RFE as "enhancement"

But I will wait few days to see if another good ideas comes to help :)





On Mon, Aug 18, 2008 at 1:35 PM, Martin Grebac <Martin.Grebac@...> wrote:

> Right, that's exactly it. Thanks,
> MartinG
>
> Lukas Jungmann wrote:
>>
>> Martin Grebac wrote:
>>>
>>> Oh, I see, it's the ant task. Not sure if wsimport ant task allows you to
>>> pass JAXB options, but you can still replace it with invoking the
>>> commandline wsimport (I understand it's quite a complication). Filing a RFE
>>> might be worth it.
>>
>> Isn't it already there? I mean isn't "-B" on the command line equal to
>> "<xjcarg>" in the Ant task?
>>
>> just looking at the last example at
>> https://jax-ws.dev.java.net/nonav/2.1.3/docs/wsimportant.html
>>
>> --lj
>>
>>
>>> MartinG
>>>
>>> Felipe Gaúcho wrote:
>>>>
>>>> my current ANT task:
>>>>
>>>>    <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
>>>>        <classpath refid="jaxws.classpath" />
>>>>    </taskdef>
>>>>
>>>>    <target name="build-server-wsdl">
>>>>        <wsimport debug="true" verbose="${verbose}" keep="true"
>>>> extension="false" destdir="${generated.dir}"
>>>> wsdl="${service.admin.wsdl}"
>>>> wsdllocation="${service.admin.wsdllocation}">
>>>>            <produces dir="${generated.dir}"
>>>> includes="${generated.dir}/**/*.java" />
>>>>        </wsimport>
>>>>        ..... * other lines here
>>>>    </target>
>>>>
>>>>
>>>> So, if you can point how can I include the -B param here, please do that
>>>> :)
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>> For additional commands, e-mail: users-help@...
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>
> --
> Martin Grebac, http://blogs.sun.com/mgrebac
>
> Web Technologies & Standards
> Sun Microsystems Czech
>
> ICQ: 93478885
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>