You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Eric J. Van der Velden" <er...@gmail.com> on 2017/10/25 13:46:46 UTC
In the java_first_jaxws sample of cxf there are no SayHi and
SayHiResponse types.
In the java_first_jaxws sample of cxf there are for example no SayHi and
SayHiResponse types.
Why not? Aren't they needed for (de)serialization?
In the wsdl_first sample, types like GetCustomersByName and
GetCustomersByNameResponse are there, and in the debugger I saw that they
are used.
When I use java2ws, SayHi and SayHiResponse are there.
Thanks!
RE: In the java_first_jaxws sample of cxf there are no SayHi and
SayHiResponse types.
Posted by Andrei Shakirin <as...@talend.com>.
Hi Eric,
In WSDL first approach, WSDL is a "master" of type definitions for your request and responses. In WSDL first example the GetCustomersByName is declared as complex type in xml schema (inside CustomerService.wsdl), therefore JAXB generates corresponded java class (GetCustomersByName.java).
In contrast, java first hasn't xml schema and WSDL file, the request / response XML types are determined based on arguments and return java types of the method in class annotated with @WebService (HelloWorld.java).
As far as method returns just a string, JAX-WS framework have to wrap it into valid XML. By default the method name ("sayHi") is used as name of wrapper request element and method name + "Reponse" (sayHiResponse) as response wrapper element.
Regards,
Andrei.
> -----Original Message-----
> From: Eric J. Van der Velden [mailto:ericjvandervelden@gmail.com]
> Sent: Donnerstag, 26. Oktober 2017 10:25
> To: users@cxf.apache.org
> Subject: Re: In the java_first_jaxws sample of cxf there are no SayHi and
> SayHiResponse types.
>
> So why is the wrapper type SayHi in java_first_jaxws not needed and in
> wsdl_first the wrapper type GetCustomersByName is needed?
>
> Thanks!
>
> On Thu, Oct 26, 2017 at 9:49 AM, Eric J. Van der Velden <
> ericjvandervelden@gmail.com> wrote:
>
> > Thanks. But I do not understand it 100%. In the wsdl_first sample
> > there are generated: GetCustomersByName (and
> > GetCustomersByNameReponse). I create the WAR with
> > GetCustomersByName.class in WEB-INF/classes, deploy it in Tomcat and
> > it works. Now I remove GetCustomersByName.class and restart Tomcat. Now
> I get an error:
> >
> > </pre><p><b>Root Cause</b></p><pre>java.lang.NoClassDefFoundError:
> > com/example/customerservice/GetCustomersByName
> >
> > So why is this wrapper type in wsdl_first not generated
> >
> > On Wed, Oct 25, 2017 at 10:49 PM, Andrei Shakirin
> > <as...@talend.com>
> > wrote:
> >
> >> Hi,
> >>
> >> The SayHi and SayHiResponse are just wrappers around string
> >> request/response. They are necessary, because only a string cannot be
> >> sent as a valid XML.
> >> The wrapper types are generated by default on the base of method name
> >> (sayHi), so you don't need to define them explicitly in java code.
> >> You can customize the wrapper using javax.xml.ws.RequestWrapper and
> >> javax.xml.ws.ResponseWrapper annotations.
> >> Please refer JAX-WS spec for further details:
> >> https://jcp.org/aboutJava/communityprocess/mrel/jsr224/index3.html
> >>
> >> Regards,
> >> Andrei.
> >>
> >>
> >> > -----Original Message-----
> >> > From: Eric J. Van der Velden [mailto:ericjvandervelden@gmail.com]
> >> > Sent: Mittwoch, 25. Oktober 2017 15:47
> >> > To: users@cxf.apache.org
> >> > Subject: In the java_first_jaxws sample of cxf there are no SayHi
> >> > and SayHiResponse types.
> >> >
> >> > In the java_first_jaxws sample of cxf there are for example no
> >> > SayHi and SayHiResponse types.
> >> >
> >> > Why not? Aren't they needed for (de)serialization?
> >> >
> >> > In the wsdl_first sample, types like GetCustomersByName and
> >> > GetCustomersByNameResponse are there, and in the debugger I saw
> >> > that
> >> they
> >> > are used.
> >> >
> >> > When I use java2ws, SayHi and SayHiResponse are there.
> >> >
> >> > Thanks!
> >>
> >
> >
Re: In the java_first_jaxws sample of cxf there are no SayHi and
SayHiResponse types.
Posted by "Eric J. Van der Velden" <er...@gmail.com>.
So why is the wrapper type SayHi in java_first_jaxws not needed and in
wsdl_first the wrapper type GetCustomersByName is needed?
Thanks!
On Thu, Oct 26, 2017 at 9:49 AM, Eric J. Van der Velden <
ericjvandervelden@gmail.com> wrote:
> Thanks. But I do not understand it 100%. In the wsdl_first sample there
> are generated: GetCustomersByName (and GetCustomersByNameReponse). I create
> the WAR with GetCustomersByName.class in WEB-INF/classes, deploy it in
> Tomcat and it works. Now I remove GetCustomersByName.class and restart
> Tomcat. Now I get an error:
>
> </pre><p><b>Root Cause</b></p><pre>java.lang.NoClassDefFoundError:
> com/example/customerservice/GetCustomersByName
>
> So why is this wrapper type in wsdl_first not generated
>
> On Wed, Oct 25, 2017 at 10:49 PM, Andrei Shakirin <as...@talend.com>
> wrote:
>
>> Hi,
>>
>> The SayHi and SayHiResponse are just wrappers around string
>> request/response. They are necessary, because only a string cannot be sent
>> as a valid XML.
>> The wrapper types are generated by default on the base of method name
>> (sayHi), so you don't need to define them explicitly in java code.
>> You can customize the wrapper using javax.xml.ws.RequestWrapper and
>> javax.xml.ws.ResponseWrapper annotations.
>> Please refer JAX-WS spec for further details:
>> https://jcp.org/aboutJava/communityprocess/mrel/jsr224/index3.html
>>
>> Regards,
>> Andrei.
>>
>>
>> > -----Original Message-----
>> > From: Eric J. Van der Velden [mailto:ericjvandervelden@gmail.com]
>> > Sent: Mittwoch, 25. Oktober 2017 15:47
>> > To: users@cxf.apache.org
>> > Subject: In the java_first_jaxws sample of cxf there are no SayHi and
>> > SayHiResponse types.
>> >
>> > In the java_first_jaxws sample of cxf there are for example no SayHi and
>> > SayHiResponse types.
>> >
>> > Why not? Aren't they needed for (de)serialization?
>> >
>> > In the wsdl_first sample, types like GetCustomersByName and
>> > GetCustomersByNameResponse are there, and in the debugger I saw that
>> they
>> > are used.
>> >
>> > When I use java2ws, SayHi and SayHiResponse are there.
>> >
>> > Thanks!
>>
>
>
Re: In the java_first_jaxws sample of cxf there are no SayHi and
SayHiResponse types.
Posted by "Eric J. Van der Velden" <er...@gmail.com>.
Thanks. But I do not understand it 100%. In the wsdl_first sample there are
generated: GetCustomersByName (and GetCustomersByNameReponse). I create the
WAR with GetCustomersByName.class in WEB-INF/classes, deploy it in Tomcat
and it works. Now I remove GetCustomersByName.class and restart Tomcat. Now
I get an error:
</pre><p><b>Root Cause</b></p><pre>java.lang.NoClassDefFoundError:
com/example/customerservice/GetCustomersByName
So why is this wrapper type in wsdl_first not generated
On Wed, Oct 25, 2017 at 10:49 PM, Andrei Shakirin <as...@talend.com>
wrote:
> Hi,
>
> The SayHi and SayHiResponse are just wrappers around string
> request/response. They are necessary, because only a string cannot be sent
> as a valid XML.
> The wrapper types are generated by default on the base of method name
> (sayHi), so you don't need to define them explicitly in java code.
> You can customize the wrapper using javax.xml.ws.RequestWrapper and
> javax.xml.ws.ResponseWrapper annotations.
> Please refer JAX-WS spec for further details: https://jcp.org/aboutJava/
> communityprocess/mrel/jsr224/index3.html
>
> Regards,
> Andrei.
>
>
> > -----Original Message-----
> > From: Eric J. Van der Velden [mailto:ericjvandervelden@gmail.com]
> > Sent: Mittwoch, 25. Oktober 2017 15:47
> > To: users@cxf.apache.org
> > Subject: In the java_first_jaxws sample of cxf there are no SayHi and
> > SayHiResponse types.
> >
> > In the java_first_jaxws sample of cxf there are for example no SayHi and
> > SayHiResponse types.
> >
> > Why not? Aren't they needed for (de)serialization?
> >
> > In the wsdl_first sample, types like GetCustomersByName and
> > GetCustomersByNameResponse are there, and in the debugger I saw that they
> > are used.
> >
> > When I use java2ws, SayHi and SayHiResponse are there.
> >
> > Thanks!
>
RE: In the java_first_jaxws sample of cxf there are no SayHi and
SayHiResponse types.
Posted by Andrei Shakirin <as...@talend.com>.
Hi,
The SayHi and SayHiResponse are just wrappers around string request/response. They are necessary, because only a string cannot be sent as a valid XML.
The wrapper types are generated by default on the base of method name (sayHi), so you don't need to define them explicitly in java code.
You can customize the wrapper using javax.xml.ws.RequestWrapper and javax.xml.ws.ResponseWrapper annotations.
Please refer JAX-WS spec for further details: https://jcp.org/aboutJava/communityprocess/mrel/jsr224/index3.html
Regards,
Andrei.
> -----Original Message-----
> From: Eric J. Van der Velden [mailto:ericjvandervelden@gmail.com]
> Sent: Mittwoch, 25. Oktober 2017 15:47
> To: users@cxf.apache.org
> Subject: In the java_first_jaxws sample of cxf there are no SayHi and
> SayHiResponse types.
>
> In the java_first_jaxws sample of cxf there are for example no SayHi and
> SayHiResponse types.
>
> Why not? Aren't they needed for (de)serialization?
>
> In the wsdl_first sample, types like GetCustomersByName and
> GetCustomersByNameResponse are there, and in the debugger I saw that they
> are used.
>
> When I use java2ws, SayHi and SayHiResponse are there.
>
> Thanks!