java - Generated WSDL has nillable="true" for @RequestWrapper -
my question is: how can setup cxf system service method signature same client signature? when using @requestwrapper? see question beeing asked 2 years ago: old question
when using @requestwrapper on @webmethod results in nillable="true" in generated wsdl. wsdl generate java maven (cxf-codegen-plugin) , when nillable set arguments of method wrapped.
@webmethod(action = "getavailablemoments") @requestwrapper(classname = "webservice.wrappers.getavailablemomentswrapper") public list<moment> getavailablemoments(localdate selecteddate) { }
the wrapper looks this:
@xmlaccessortype(xmlaccesstype.field) public class getavailablemomentswrapper implements serializable { private static final long serialversionuid = 1l; @xmlelement(required = true) @xmljavatypeadapter(value = localdateadapter.class, type = localdate.class) @xmlschematype(name = "date") private localdate selecteddate; }
then part of wsdl looks this:
... <xs:element name="getavailablemoments" nillable="true" type="tns:getavailablemomentswrapper"/> ...
and generated java code looks this:
@webmethod(action = "getavailablemoments") @soapbinding(parameterstyle = soapbinding.parameterstyle.bare) @webresult(name = "getavailablemomentsresponse", targetnamespace = "calendar.service.vetsware.nl", partname = "parameters") public getavailablemomentsresponse getavailablemoments( @webparam(partname = "parameters", name = "getavailablemoments", targetnamespace = "calendar.service.vetsware.nl") getavailablemomentswrapper parameters );
but when set nillable="false", java code looks like have:
@webmethod(action = "getavailablemoments") @requestwrapper(localname = "getavailablemoments", targetnamespace = "calendar.service.vetsware.nl", classname = "nl.vetsware.service.calendar.getavailablemomentswrapper") @responsewrapper(localname = "getavailablemomentsresponse", targetnamespace = "calendar.service.vetsware.nl", classname = "nl.vetsware.service.calendar.getavailablemomentsresponse") @webresult(name = "return", targetnamespace = "") public java.util.list<nl.vetsware.service.calendar.moment> getavailablemoments( @webparam(name = "selecteddate", targetnamespace = "") java.time.localdate selecteddate );
Comments
Post a Comment