Can u please explain how to go about the option : You can write your own custom ServiceConfiguration class (subclass DefaultServiceConfiguration) and implement the isWrapperPartNillable and getWrapperPartMinOccurs methods to do whatever you want. Then configure that in via spring.
Regards Appykum Daniel Kulp wrote: > > On Monday 12 January 2009 7:28:14 am Ronald Pieterse wrote: >> I have been thinking about this for some time now as well until I came >> across this issue :-) Is there already a solution like you described in >> CXF >> or is a wrapper class still necessary at this moment? > > You can write your own custom ServiceConfiguration class (subclass > DefaultServiceConfiguration) and implement the isWrapperPartNillable and > getWrapperPartMinOccurs methods to do whatever you want. Then configure > that in via spring. > > That said, there is currently a proposal for JAX-WS 2.2 to allow > @XmlElement > annotations on the parameters (will require JAXB 2.2 as well). Thus, > that's probably the longer term solution to this. > > Dan > > >> >> Thnx. >> Ronald >> >> dkulp wrote: >> > In all honesty, the ONLY way to do this with JAX-WS is to write some >> > wrapper classes that specify the required=true flags on the XmlElement >> > annotations. For the most part, you can run the java2wsdl/java2ws >> tool >> > with the -wrapperClasses flag to have it generate prototype .java files >> > that you can hand edit. >> > >> > I keep thinking about creating a special @NotNull or @Required >> annotation >> > or something that could be used to extend the jaxws stuff, just haven't >> > had any time to do it. :-( >> > >> > >> > Dan >> > >> > On Thursday 03 April 2008, cmathrusse wrote: >> >> I've got my WebService defined as follows: >> >> >> >> @WebService(targetNamespace = "http://cosmos.it.sybase.com", name = >> >> "CosmosBroker") >> >> @SOAPBinding(parameterStyle = ParameterStyle.WRAPPED, style = >> >> Style.DOCUMENT, use = Use.LITERAL) >> >> public interface CosmosBroker { ... >> >> >> >> And I have a method defined: >> >> @WebMethod(operationName = "isCustomerActive", action = "") >> >> @WebResult(name = "isCustomerActiveReturn") >> >> Boolean isCustomerActive( >> >> @WebParam(name = "customerId") >> >> String customerId) ; >> >> >> >> But when the wsdl is generated my complex type looks as follows: >> >> <xs:complexType name="isCustomerActive"> >> >> <xs:sequence> >> >> <xs:element minOccurs="0" name="customerId" type="xs:string"/> >> >> </xs:sequence> >> >> </xs:complexType> >> >> >> >> So what do I need to do to make my customerId parameter required? >> >> (minOccurs="1") or is there even a way to accomplish this? >> >> >> >> Thanks for the help... >> > >> > -- >> > J. Daniel Kulp >> > Principal Engineer, IONA >> > [email protected] >> > http://www.dankulp.com/blog > > > > -- > Daniel Kulp > [email protected] > http://dankulp.com/blog > > -- View this message in context: http://cxf.547215.n5.nabble.com/How-to-make-paramters-on-WebMethod-required-tp561693p3330563.html Sent from the cxf-user mailing list archive at Nabble.com.
