You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Marc Logemann <ml...@logemann.org> on 2008/06/24 02:22:41 UTC
complex webservice parameter and resulting wsdl
Hi,
i just created a more complicated webservice, means, receiving a
complex "order" class. This order class has many nested classes in it
as you can imagine.
I always thought that the class stucture is exposed via the wsdl but
it isnt. But when i create a more simple class (no nested classes,
only primitive attributes) and use this as method signature of my
webservice, the generated wsdl exposes the structure of the expected
parameter.
All i get is:
<xs:complexType name="order">
<xs:sequence/>
</xs:complexType>
What does this mean? Does it mean that i will have to distribute the
domain objects which are part of the contract so that the caller can
create a client? I always thought the wsdl tells everything about my
services and expected structures.... Currently no one should be able
to create an apropriate client for my webservice, especially not my
primary testing tool SoapUI.
Note: i just used the java-ws annotations for webservices classes and
methods. I also named the parameters via @WebParam.
--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org
Re: complex webservice parameter and resulting wsdl
Posted by Marc Logemann <ml...@logemann.org>.
Hi Dan,
thx for the hints. I will check them.
Update: oh boy. I forgot to generate getter/setter on my top level
class .... :) Sorry to waste maillist time for you guys. After
creating them, my wsdl structure looks as it should be... with all
nested classes and stuff. Thanks for telling me the constructor
thingy, even though its not necessary as you said, it made me looking
into the class again :)
This is so embarrassing.....
--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org
Am 24.06.2008 um 03:03 schrieb Daniel Kulp:
>
> On Jun 23, 2008, at 8:59 PM, Marc Logemann wrote:
>
>> Hi,
>>
>> sorry to be less informative on the first run, here is what i have:
>>
>> - CXF 2.1
>> - JAXB (default mapping)
>> - all classes are public (not static)
>
> That's COULD be the issue if some of them are inner classes. The
> inner classes need to be static. Otherwise, the "default"
> constructor really takes an argument (the parent pointer).
>
>> - no default constructor on the nested classes (do i really have to
>> manually create it?)
>
> Only if you also have a non-default constructor.
>
>> - no JAXB annotations
>>
>> As i am writing this, i have the feeling that i am missing
>> everything i shouldnt miss. I thought that even without the JAXB
>> annotations, there would be sensible defaults how to map my classes.
>>
>> So whats the best route to take from here?
>
> I would start by making any inner classes static. From there, I
> would try adding a @XmlType annotation onto them. The default
> values for the attributes should be fine, but I think JAXB requires
> the XmlType annotation to be there.
>
> Dan
>
>
>>
>> --
>> Marc Logemann
>> blog http://logemannreloaded.blogspot.com
>> privat http://www.logemann.org
>>
>>
>>
>> Am 24.06.2008 um 02:48 schrieb Daniel Kulp:
>>
>>>
>>> We would definitely need to see more details...
>>>
>>> Primarily, are the nested classes "public static" and have the
>>> appropriate default constructor? Everything properly annotated
>>> with JAXB annotations? Etc...
>>>
>>> Dan
>>>
>>>
>>> On Jun 23, 2008, at 8:22 PM, Marc Logemann wrote:
>>>
>>>> Hi,
>>>>
>>>> i just created a more complicated webservice, means, receiving a
>>>> complex "order" class. This order class has many nested classes
>>>> in it as you can imagine.
>>>>
>>>> I always thought that the class stucture is exposed via the wsdl
>>>> but it isnt. But when i create a more simple class (no nested
>>>> classes, only primitive attributes) and use this as method
>>>> signature of my webservice, the generated wsdl exposes the
>>>> structure of the expected parameter.
>>>>
>>>> All i get is:
>>>>
>>>> <xs:complexType name="order">
>>>> <xs:sequence/>
>>>> </xs:complexType>
>>>>
>>>> What does this mean? Does it mean that i will have to distribute
>>>> the domain objects which are part of the contract so that the
>>>> caller can create a client? I always thought the wsdl tells
>>>> everything about my services and expected structures....
>>>> Currently no one should be able to create an apropriate client
>>>> for my webservice, especially not my primary testing tool SoapUI.
>>>>
>>>> Note: i just used the java-ws annotations for webservices classes
>>>> and methods. I also named the parameters via @WebParam.
>>>>
>>>> --
>>>> Marc Logemann
>>>> blog http://logemannreloaded.blogspot.com
>>>> privat http://www.logemann.org
>>>>
>>>>
>>>>
>>>
>>> ---
>>> Daniel Kulp
>>> dkulp@apache.org
>>> http://www.dankulp.com/blog
>>>
>>>
>>>
>>>
>>
>
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
>
>
Re: complex webservice parameter and resulting wsdl
Posted by Daniel Kulp <dk...@apache.org>.
On Jun 23, 2008, at 8:59 PM, Marc Logemann wrote:
> Hi,
>
> sorry to be less informative on the first run, here is what i have:
>
> - CXF 2.1
> - JAXB (default mapping)
> - all classes are public (not static)
That's COULD be the issue if some of them are inner classes. The inner
classes need to be static. Otherwise, the "default" constructor
really takes an argument (the parent pointer).
> - no default constructor on the nested classes (do i really have to
> manually create it?)
Only if you also have a non-default constructor.
> - no JAXB annotations
>
> As i am writing this, i have the feeling that i am missing
> everything i shouldnt miss. I thought that even without the JAXB
> annotations, there would be sensible defaults how to map my classes.
>
> So whats the best route to take from here?
I would start by making any inner classes static. From there, I
would try adding a @XmlType annotation onto them. The default values
for the attributes should be fine, but I think JAXB requires the
XmlType annotation to be there.
Dan
>
> --
> Marc Logemann
> blog http://logemannreloaded.blogspot.com
> privat http://www.logemann.org
>
>
>
> Am 24.06.2008 um 02:48 schrieb Daniel Kulp:
>
>>
>> We would definitely need to see more details...
>>
>> Primarily, are the nested classes "public static" and have the
>> appropriate default constructor? Everything properly annotated
>> with JAXB annotations? Etc...
>>
>> Dan
>>
>>
>> On Jun 23, 2008, at 8:22 PM, Marc Logemann wrote:
>>
>>> Hi,
>>>
>>> i just created a more complicated webservice, means, receiving a
>>> complex "order" class. This order class has many nested classes in
>>> it as you can imagine.
>>>
>>> I always thought that the class stucture is exposed via the wsdl
>>> but it isnt. But when i create a more simple class (no nested
>>> classes, only primitive attributes) and use this as method
>>> signature of my webservice, the generated wsdl exposes the
>>> structure of the expected parameter.
>>>
>>> All i get is:
>>>
>>> <xs:complexType name="order">
>>> <xs:sequence/>
>>> </xs:complexType>
>>>
>>> What does this mean? Does it mean that i will have to distribute
>>> the domain objects which are part of the contract so that the
>>> caller can create a client? I always thought the wsdl tells
>>> everything about my services and expected structures.... Currently
>>> no one should be able to create an apropriate client for my
>>> webservice, especially not my primary testing tool SoapUI.
>>>
>>> Note: i just used the java-ws annotations for webservices classes
>>> and methods. I also named the parameters via @WebParam.
>>>
>>> --
>>> Marc Logemann
>>> blog http://logemannreloaded.blogspot.com
>>> privat http://www.logemann.org
>>>
>>>
>>>
>>
>> ---
>> Daniel Kulp
>> dkulp@apache.org
>> http://www.dankulp.com/blog
>>
>>
>>
>>
>
---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: complex webservice parameter and resulting wsdl
Posted by Marc Logemann <ml...@logemann.org>.
Hi,
sorry to be less informative on the first run, here is what i have:
- CXF 2.1
- JAXB (default mapping)
- all classes are public (not static)
- no default constructor on the nested classes (do i really have to
manually create it?)
- no JAXB annotations
As i am writing this, i have the feeling that i am missing everything
i shouldnt miss. I thought that even without the JAXB annotations,
there would be sensible defaults how to map my classes.
So whats the best route to take from here?
--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org
Am 24.06.2008 um 02:48 schrieb Daniel Kulp:
>
> We would definitely need to see more details...
>
> Primarily, are the nested classes "public static" and have the
> appropriate default constructor? Everything properly annotated
> with JAXB annotations? Etc...
>
> Dan
>
>
> On Jun 23, 2008, at 8:22 PM, Marc Logemann wrote:
>
>> Hi,
>>
>> i just created a more complicated webservice, means, receiving a
>> complex "order" class. This order class has many nested classes in
>> it as you can imagine.
>>
>> I always thought that the class stucture is exposed via the wsdl
>> but it isnt. But when i create a more simple class (no nested
>> classes, only primitive attributes) and use this as method
>> signature of my webservice, the generated wsdl exposes the
>> structure of the expected parameter.
>>
>> All i get is:
>>
>> <xs:complexType name="order">
>> <xs:sequence/>
>> </xs:complexType>
>>
>> What does this mean? Does it mean that i will have to distribute
>> the domain objects which are part of the contract so that the
>> caller can create a client? I always thought the wsdl tells
>> everything about my services and expected structures.... Currently
>> no one should be able to create an apropriate client for my
>> webservice, especially not my primary testing tool SoapUI.
>>
>> Note: i just used the java-ws annotations for webservices classes
>> and methods. I also named the parameters via @WebParam.
>>
>> --
>> Marc Logemann
>> blog http://logemannreloaded.blogspot.com
>> privat http://www.logemann.org
>>
>>
>>
>
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
>
>
Re: complex webservice parameter and resulting wsdl
Posted by Daniel Kulp <dk...@apache.org>.
We would definitely need to see more details...
Primarily, are the nested classes "public static" and have the
appropriate default constructor? Everything properly annotated with
JAXB annotations? Etc...
Dan
On Jun 23, 2008, at 8:22 PM, Marc Logemann wrote:
> Hi,
>
> i just created a more complicated webservice, means, receiving a
> complex "order" class. This order class has many nested classes in
> it as you can imagine.
>
> I always thought that the class stucture is exposed via the wsdl but
> it isnt. But when i create a more simple class (no nested classes,
> only primitive attributes) and use this as method signature of my
> webservice, the generated wsdl exposes the structure of the expected
> parameter.
>
> All i get is:
>
> <xs:complexType name="order">
> <xs:sequence/>
> </xs:complexType>
>
> What does this mean? Does it mean that i will have to distribute the
> domain objects which are part of the contract so that the caller can
> create a client? I always thought the wsdl tells everything about my
> services and expected structures.... Currently no one should be able
> to create an apropriate client for my webservice, especially not my
> primary testing tool SoapUI.
>
> Note: i just used the java-ws annotations for webservices classes
> and methods. I also named the parameters via @WebParam.
>
> --
> Marc Logemann
> blog http://logemannreloaded.blogspot.com
> privat http://www.logemann.org
>
>
>
---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: complex webservice parameter and resulting wsdl
Posted by Benson Margulies <bi...@gmail.com>.
I think that we need to know much more about what you did and how you did
it. In general, JAX-WS+JAXB (or JAX-WS+Aegis) will build a complex XML
schema to describe all your types. How did you configure? What version of
CXF are you using?
On Mon, Jun 23, 2008 at 8:22 PM, Marc Logemann <ml...@logemann.org> wrote:
> Hi,
>
> i just created a more complicated webservice, means, receiving a complex
> "order" class. This order class has many nested classes in it as you can
> imagine.
>
> I always thought that the class stucture is exposed via the wsdl but it
> isnt. But when i create a more simple class (no nested classes, only
> primitive attributes) and use this as method signature of my webservice, the
> generated wsdl exposes the structure of the expected parameter.
>
> All i get is:
>
> <xs:complexType name="order">
> <xs:sequence/>
> </xs:complexType>
>
> What does this mean? Does it mean that i will have to distribute the domain
> objects which are part of the contract so that the caller can create a
> client? I always thought the wsdl tells everything about my services and
> expected structures.... Currently no one should be able to create an
> apropriate client for my webservice, especially not my primary testing tool
> SoapUI.
>
> Note: i just used the java-ws annotations for webservices classes and
> methods. I also named the parameters via @WebParam.
>
> --
> Marc Logemann
> blog http://logemannreloaded.blogspot.com
> privat http://www.logemann.org
>
>
>
>