You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Nick Komen <ni...@ldschurch.org> on 2013/05/17 23:04:27 UTC

Request Wrapper Rendered as Nillable in WSDL

I recently started using request wrappers on my SOAP service to have more control of how the method parameters are displayed in the WSDL.  However, the method with a request wrapper is getting its wsdl generated in a way that is not friendly to wsdl2java.

My original service method declaration of this:

	@RequestWrapper(localName = "getInterviewList", targetNamespace = NAMESPACE, className = "org.lds.platform.service.wrapper.GetInterviewListRequestWrapper")
	@WebMethod(operationName="getInterviewList")
	public List<InterviewInfo> getInterviewList(
			@WebParam(name=Constants.UNIT_NBR)
			Long unitNbr, 
			@WebParam(name=Constants.NAME_FORMAT) 
			String nameFormat) throws MluValidationException, AvailabilityException;
			
Is getting turned into this wsdl (showing only the part having to do with the wrapper):

<xs:complexType name="getInterviewList">
	<xs:sequence>
		<xs:element minOccurs="0" name="unitNbr" nillable="true" type="xs:long"/>
		<xs:element minOccurs="0" name="nameFormat" nillable="true" type="xs:string"/>
	</xs:sequence>
</xs:complexType>
<xs:element name="getInterviewList" nillable="true" type="tns:getInterviewList"/>
	
The complex type declaration is great, but the following line (with the element declaration) is a problem.  This is making it so that when I run wsdl2java off of this, it generates a method with the Bare parameter style instead of the Wrapped one we would like.  It seems to be caused by the line where the element named getInterviewList is being marked as nillable.  
If I edit that one line manually to 
<xs:element name="getInterviewList" type="tns:getInterviewList"/>
wsdl2java generates the code the way we want (with the wrapper style for the parameters, like in our service declaration).

So my question is: when using a request wrapper, how can I avoid it getting marked as nillable in the wsdl?

-Nick


 NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.


RE: Request Wrapper Rendered as Nillable in WSDL

Posted by Nick Komen <ni...@ldschurch.org>.
Haven't seen any response to this so far.  Any ideas?

BTW- This is using CXF 2.5.8

-Nick

-----Original Message-----
From: Nick Komen [mailto:nick.komen@ldschurch.org] 
Sent: Friday, May 17, 2013 3:04 PM
To: users@cxf.apache.org
Subject: Request Wrapper Rendered as Nillable in WSDL

I recently started using request wrappers on my SOAP service to have more control of how the method parameters are displayed in the WSDL.  However, the method with a request wrapper is getting its wsdl generated in a way that is not friendly to wsdl2java.


My original service method declaration of this:

	@RequestWrapper(localName = "getInterviewList", targetNamespace = NAMESPACE, className = "org.lds.platform.service.wrapper.GetInterviewListRequestWrapper")
	@WebMethod(operationName="getInterviewList")
	public List<InterviewInfo> getInterviewList(
			@WebParam(name=Constants.UNIT_NBR)
			Long unitNbr, 
			@WebParam(name=Constants.NAME_FORMAT) 
			String nameFormat) throws MluValidationException, AvailabilityException;
			
Is getting turned into this wsdl (showing only the part having to do with the wrapper):

<xs:complexType name="getInterviewList">
	<xs:sequence>
		<xs:element minOccurs="0" name="unitNbr" nillable="true" type="xs:long"/>
		<xs:element minOccurs="0" name="nameFormat" nillable="true" type="xs:string"/>
	</xs:sequence>
</xs:complexType>
<xs:element name="getInterviewList" nillable="true" type="tns:getInterviewList"/>
	
The complex type declaration is great, but the following line (with the element declaration) is a problem.  This is making it so that when I run wsdl2java off of this, it generates a method with the Bare parameter style instead of the Wrapped one we would like.  It seems to be caused by the line where the element named getInterviewList is being marked as nillable.  
If I edit that one line manually to
<xs:element name="getInterviewList" type="tns:getInterviewList"/> wsdl2java generates the code the way we want (with the wrapper style for the parameters, like in our service declaration).

So my question is: when using a request wrapper, how can I avoid it getting marked as nillable in the wsdl?

-Nick


 NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.


 NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.