cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: How to make SOAPBinding.ParameterStyle.WRAPPED instead of BARE?
Date Fri, 20 Jun 2008 06:03:11 GMT

How about moving the @SOAPBinding  to the top of  Class ?
Here is the example[1] in the CXF systest.

[1]https://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitBareCodeFirstService.java

Willem


cortlander wrote:
> I am using CXF’s WDSL to Java utility to generate code from a wsdl.  I would
> like to map my wsdl operations to SOAPBinding.ParameterStyle.WRAPPED  so
> that  methods with void return types do not return objects like xxxResponse: 
> /**
>  * This class was generated by Apache CXF 2.1
>  * Thu Jun 19 15:09:17 EDT 2008
>  * Generated source version: 2.1
>  * 
>  */
>
> @WebService(targetNamespace = "urn:idm.openiam.org/ws/org", name =
> "organizationData")
> @XmlSeeAlso({org.openiam.idm.types.metadata.ObjectFactory.class,org.openiam.idm.types.organization.ObjectFactory.class,ObjectFactory.class})
>
> public interface OrganizationData {
>
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebResult(name = "removeAttributeResponse", targetNamespace =
> "urn:idm.openiam.org/ws/org", partName = "removeAttributeResponse")
>     @WebMethod
>     public RemoveAttributeResponse removeAttribute(
>         @WebParam(partName = "removeAttribute", name = "removeAttribute",
> targetNamespace = "urn:idm.openiam.org/ws/org")
>         org.openiam.idm.types.organization.OrganizationAttribute
> removeAttribute
>     );
>
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebResult(name = "addAttributeResponse", targetNamespace =
> "urn:idm.openiam.org/ws/org", partName = "addAttributeResponse")
>     @WebMethod
>     public AddAttributeResponse addAttribute(
>         @WebParam(partName = "addAttribute", name = "addAttribute",
> targetNamespace = "urn:idm.openiam.org/ws/org")
>         org.openiam.idm.types.organization.OrganizationAttribute
> addAttribute
>     );
>
> Etc..
>
>
> Excerpts from the WSDL includes the following:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <wsdl:definitions name="OrganizationData"
> targetNamespace="urn:idm.openiam.org/ws/org"
> 	xmlns:tns="urn:idm.openiam.org/ws/org"
> xmlns:ns1="urn:idm.openiam.org/ws/org"
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:org="urn:idm.openiam.org/types/organization"
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
>
> 	<!-- Types ******************************************************** -->
>
> 	<wsdl:types>
> 		<xsd:schema targetNamespace="urn:idm.openiam.org/ws/org"
> 			xmlns:tns="urn:idm.openiam.org/ws/org"
> xmlns="http://www.w3.org/2001/XMLSchema"
> 			attributeFormDefault="qualified" elementFormDefault="unqualified">
>
> 			<xsd:import namespace="urn:idm.openiam.org/types/organization"
> 				schemaLocation="organization.xsd" />
>
> ...
> 			<xsd:element name="removeAttribute" nillable="true"
> type="org:organizationAttribute" />
>
> 			<xsd:element name="removeAttributeResponse">
> 				<xsd:complexType>
> 					<xsd:sequence />
> 				</xsd:complexType>
> 			</xsd:element>
>
>
> 			<xsd:element name="addAttribute" nillable="true"
> type="org:organizationAttribute" />
>
> 			<xsd:element name="addAttributeResponse">
> 				<xsd:complexType>
> 					<xsd:sequence />
> 				</xsd:complexType>
> 			</xsd:element>
>
>  . . .
> 		</xsd:schema>
> 	</wsdl:types>
>
> <!-- Messages ******************************************************** -->
>
> . . .
>
> 	<wsdl:message name="addAttribute">
> 		<wsdl:part name="addAttribute" element="ns1:addAttribute"></wsdl:part>
> 	</wsdl:message>
> 	<wsdl:message name="addAttributeResponse">
> 		<wsdl:part name="addAttributeResponse"
> element="ns1:addAttributeResponse"></wsdl:part>
> 	</wsdl:message>
>
> 	<wsdl:message name="removeAttribute">
> 		<wsdl:part name="removeAttribute"
> element="ns1:removeAttribute"></wsdl:part>
> 	</wsdl:message>
> 	<wsdl:message name="removeAttributeResponse">
> 		<wsdl:part name="removeAttributeResponse"
> element="ns1:removeAttributeResponse"></wsdl:part>
> 	</wsdl:message>
>
> . . .
>
> <!-- portType ******************************************************** -->
>
> <wsdl:portType name="organizationData">
>
> 		<wsdl:operation name="removeAttribute">
> 			<wsdl:input name="removeAttribute"
> message="tns:removeAttribute"></wsdl:input>
> 			<wsdl:output name="removeAttributeResponse"
> message="tns:removeAttributeResponse">
> 			</wsdl:output>
> 		</wsdl:operation>
>
> 		<wsdl:operation name="addAttribute">
> 			<wsdl:input name="addAttribute" message="tns:addAttribute"></wsdl:input>
> 			<wsdl:output name="addAttributeResponse"
> message="tns:addAttributeResponse">
> 			</wsdl:output>
> 		</wsdl:operation>
>
>
> . . .
>
> </wsdl:portType>
>
> <!-- Binding ******************************************************** -->
>
> 	<wsdl:binding name="OrganizationDataBinding" type="tns:organizationData">
> 		<soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http" />
>
>
> 		<wsdl:operation name="addAttribute">
> 			<soap:operation soapAction="" style="document" />
> 			<wsdl:input name="addAttribute">
> 				<soap:body use="literal" />
> 			</wsdl:input>
> 			<wsdl:output name="addAttributeResponse">
> 				<soap:body use="literal" />
> 			</wsdl:output>
> 		</wsdl:operation>
>
>
> 		<wsdl:operation name="removeAttribute">
> 			<soap:operation soapAction="" style="document" />
> 			<wsdl:input name="removeAttribute">
> 				<soap:body use="literal" />
> 			</wsdl:input>
> 			<wsdl:output name="removeAttributeResponse">
> 				<soap:body use="literal" />
> 			</wsdl:output>
> 		</wsdl:operation>
> . . .
>
> 	</wsdl:binding>
>
> <!-- Service ******************************************************** -->
>
> 	<wsdl:service name="OrganizationDataService">
> 		<wsdl:port name="OrganizationDataPort"
> binding="tns:OrganizationDataBinding">
> 			<soap:address location="http://localhost:9090/OrganizationDataPort" />
> 		</wsdl:port>
> 	</wsdl:service>
> </wsdl:definitions>                                
>
> I saw another post which mentioned the part element name must be the same as
> the operation name, but it seems that I am doing that here. I have also
> tried the following suggestion, but that did not help either.
>
> 	<wsdl:portType name="organizationData">
>     	<jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
>         	<enableWrapperStyle>true</enableWrapperStyle>
>     	</jaxws:bindings>
>
>
> Any help to point me in the right direction would be much appreciated. 
>
> Thank you,
>
> cortlander
>
>   


Mime
View raw message