You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by moraleslos <mo...@hotmail.com> on 2006/12/17 03:16:53 UTC
jsr 181 WSDL generation missing types for enum + others
I've posted a message on the Xfire forums
http://www.nabble.com/jsr181-with-java-enums-as-parameters-tf2829778.html
here about illegal generation of the WSDL for jsr181-annotated POJOs. Not
sure if this is an Xfire or Servicemix issue. Basically I have a method
that includes a Java 5 enum as a parameter and a regular POJO as a return
type. Below is my code:
#################
public enum Music {
ROCK, POP
}
public class Station {
private String stationId;
private String dj;
// appropriate accessors
}
#################
Now I have an annotated service POJO like this:
#################
@WebService(targetNamespace=" http://music.com/station")
public class StationService {
@WebMethod
@WebResult(name="stationResult")
Station searchStation(String text, Music music) {
// return a station
}
}
#################
My xbean configuration looks like this:
###########################
<jsr181:endpoint
pojoClass="com.test.music.service.StationService"
annotations="jsr181"/>
##########################
When deployed onto Servicemix 3.0.1 with an altered version of
servicemix-jsr181-3.0.1-incubating-installer.zip that now includes xfire v.
1.2.3 jars, I still get a WSDL w/o the enum or Station complex type defined.
Any suggestions? Thanks in advanced.
-los
--
View this message in context: http://www.nabble.com/jsr-181-WSDL-generation-missing-types-for-enum-%2B-others-tf2834183s12049.html#a7912608
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: jsr 181 WSDL generation missing types for enum + others
Posted by moraleslos <mo...@hotmail.com>.
Good call Christian!
Downloaded version 3.1 and just deploying the same jar gave me the WSDL with
the complex types defined! Did have one question though. This may be due
to my lack of experience with WS. My jsr181-annotated service throws a
StationException (a basic runtime exception). Looks something like this:
------------
public Station searchStation(Music music) throws StationExeception;
------------
In the generated WSDL, I see the complex (enumerated) type for Music and one
for station. Although I also see a complex type for StationException, it
just looks like this:
#####################
<xsd:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://service.station.test.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="StationException"/>
</xsd:schema>
#####################
Shouldn't there be some more defined for StationException, e.g.
<xsd:restriction base="xsd:string">? Maybe this is already correct for
defining Exceptions in WSDL but I'm not really sure. Thanks in advance.
-los
Christian Schneider-16 wrote:
>
> Hello,
>
> this sounds like the bug I reported recently. (see
> https://issues.apache.org/activemq/browse/SM-739).
> Guillaume has marked this bug as fixed. So I think in V3.1 it should work.
>
> You can work around the bug by temporarily using the same namespace for
> your types and the service itself.
>
> Best regards
>
> Christian
>
> moraleslos schrieb:
>> I've posted a message on the Xfire forums
>> http://www.nabble.com/jsr181-with-java-enums-as-parameters-tf2829778.html
>> here about illegal generation of the WSDL for jsr181-annotated POJOs.
>> Not
>> sure if this is an Xfire or Servicemix issue. Basically I have a method
>> that includes a Java 5 enum as a parameter and a regular POJO as a return
>> type. Below is my code:
>>
>> #################
>> public enum Music {
>> ROCK, POP
>> }
>>
>> public class Station {
>> private String stationId;
>> private String dj;
>>
>> // appropriate accessors
>> }
>> #################
>>
>>
>>
>> Now I have an annotated service POJO like this:
>>
>> #################
>> @WebService(targetNamespace=" http://music.com/station")
>> public class StationService {
>>
>> @WebMethod
>> @WebResult(name="stationResult")
>> Station searchStation(String text, Music music) {
>> // return a station
>> }
>> }
>> #################
>>
>> My xbean configuration looks like this:
>>
>> ###########################
>> <jsr181:endpoint
>> pojoClass="com.test.music.service.StationService"
>> annotations="jsr181"/>
>> ##########################
>>
>> When deployed onto Servicemix 3.0.1 with an altered version of
>> servicemix-jsr181-3.0.1-incubating-installer.zip that now includes xfire
>> v.
>> 1.2.3 jars, I still get a WSDL w/o the enum or Station complex type
>> defined.
>> Any suggestions? Thanks in advanced.
>>
>> -los
>>
>>
>
>
> --
>
> Christian Schneider
> ---
> http://www.liquid-reality.de
>
>
>
--
View this message in context: http://www.nabble.com/jsr-181-WSDL-generation-missing-types-for-enum-%2B-others-tf2834183s12049.html#a7922687
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: jsr 181 WSDL generation missing types for enum + others
Posted by Christian Schneider <ch...@die-schneider.net>.
Hello,
this sounds like the bug I reported recently. (see
https://issues.apache.org/activemq/browse/SM-739).
Guillaume has marked this bug as fixed. So I think in V3.1 it should work.
You can work around the bug by temporarily using the same namespace for
your types and the service itself.
Best regards
Christian
moraleslos schrieb:
> I've posted a message on the Xfire forums
> http://www.nabble.com/jsr181-with-java-enums-as-parameters-tf2829778.html
> here about illegal generation of the WSDL for jsr181-annotated POJOs. Not
> sure if this is an Xfire or Servicemix issue. Basically I have a method
> that includes a Java 5 enum as a parameter and a regular POJO as a return
> type. Below is my code:
>
> #################
> public enum Music {
> ROCK, POP
> }
>
> public class Station {
> private String stationId;
> private String dj;
>
> // appropriate accessors
> }
> #################
>
>
>
> Now I have an annotated service POJO like this:
>
> #################
> @WebService(targetNamespace=" http://music.com/station")
> public class StationService {
>
> @WebMethod
> @WebResult(name="stationResult")
> Station searchStation(String text, Music music) {
> // return a station
> }
> }
> #################
>
> My xbean configuration looks like this:
>
> ###########################
> <jsr181:endpoint
> pojoClass="com.test.music.service.StationService"
> annotations="jsr181"/>
> ##########################
>
> When deployed onto Servicemix 3.0.1 with an altered version of
> servicemix-jsr181-3.0.1-incubating-installer.zip that now includes xfire v.
> 1.2.3 jars, I still get a WSDL w/o the enum or Station complex type defined.
> Any suggestions? Thanks in advanced.
>
> -los
>
>
--
Christian Schneider
---
http://www.liquid-reality.de