You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Scott Oster (JIRA)" <ji...@apache.org> on 2009/07/23 19:31:14 UTC

[jira] Commented: (CXF-1079) wsdl2java fails to genrate wrapped style

    [ https://issues.apache.org/jira/browse/CXF-1079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12734654#action_12734654 ] 

Scott Oster commented on CXF-1079:
----------------------------------

I agree this is a bug, via a misinterpretation of a poorly written specification rule.  As Ralf indicated, this (using element references) is an extremely common practice.  If you want to create several services which want to use an existing XML schema standard, you want to use the global elements it provides, not recreate your own in your services' namespace; that would create a syntactic incompatibility.

There is nothing about element references that should create ambiguity in wrapping/unwrapping, where substitutions are a much more complex issue.  I believe the specification is trying to disallow use of substitutions, and is asserting you can't just element ref to something that uses a substitution to get around that.

Please see the related TUSCANY bug where they agreed with this interpretation:
https://issues.apache.org/jira/browse/TUSCANY-1938
That bug also indicates the JAX-WS RI implementation interprets it that way as well.

I vote strongly for changing this behavior to using wrapped because A) I don't believe the intention of the specification was to disallow any use of element ref B) its what other tool kits do, and C) the current implementation promotes poor WSDL design (element refs should be preferred over the syntactic "sugar" of a new element declaration when an existing one would suffice).

Scott


> wsdl2java fails to genrate wrapped style
> ----------------------------------------
>
>                 Key: CXF-1079
>                 URL: https://issues.apache.org/jira/browse/CXF-1079
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.0.2
>         Environment: cxf 2.02
>            Reporter: Ralf Sigmund
>         Attachments: barewrapped.7z
>
>
> use a wsdl conforming to the jax-ws rules for document literal wrapped style.
> wsdl2java generates BARE port type. jax-ws ri generates WRAPPED with the same wsdl.
> Wsdl:
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.kba.de/pass-service" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:hinweis="http://www.kba.de/hinweis" xmlns:pass="http://www.kba.de/pass" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.kba.de/pass-service">
> 	<wsdl:types>
> 		<xsd:schema targetNamespace="http://www.kba.de/pass" elementFormDefault="qualified">
> 			<xsd:import namespace="http://www.kba.de/hinweis" schemaLocation="xsd/Hinweis.xsd"/>
> 			<xsd:element name="Passwort">
> 				<xsd:complexType>
> 					<xsd:sequence>
> 						<xsd:element name="Kennung"/>
> 						<xsd:element name="Passwort"/>
> 						<xsd:element name="PasswortNeu" minOccurs="0"/>
> 					</xsd:sequence>
> 				</xsd:complexType>
> 			</xsd:element>
> 			<xsd:element name="info">
> 				<xsd:complexType>
> 					<xsd:sequence>
> 						<xsd:element ref="pass:Passwort"/>
> 					</xsd:sequence>
> 				</xsd:complexType>
> 			</xsd:element>
> 			<xsd:element name="infoResponse">
> 				<xsd:complexType>
> 					<xsd:sequence>
> 						<xsd:element ref="hinweis:Hinweis"/>
> 					</xsd:sequence>
> 				</xsd:complexType>
> 			</xsd:element>
> 			<xsd:element name="passwortAenderung">
> 				<xsd:complexType>
> 					<xsd:sequence>
> 						<xsd:element ref="pass:Passwort"/>
> 					</xsd:sequence>
> 				</xsd:complexType>
> 			</xsd:element>
> 			<xsd:element name="passwortAenderungResponse">
> 				<xsd:complexType>
> 					<xsd:sequence>
> 						<xsd:element ref="hinweis:Hinweis"/>
> 					</xsd:sequence>
> 				</xsd:complexType>
> 			</xsd:element>
> 		</xsd:schema>
> 	</wsdl:types>
> 	<wsdl:message name="Hinweis">
> 		<wsdl:part name="parameters" element="hinweis:FaultHinweis"/>
> 	</wsdl:message>
> 	<wsdl:message name="InfoRequest">
> 		<wsdl:part name="parametersInfo" element="pass:info"/>
> 	</wsdl:message>
> 	<wsdl:message name="InfoResponse">
> 		<wsdl:part name="parametersInfoResponse" element="pass:infoResponse"/>
> 	</wsdl:message>
> 	<wsdl:message name="PassRequest">
> 		<wsdl:part name="parametersRequest" element="pass:passwortAenderung"/>
> 	</wsdl:message>
> 	<wsdl:message name="PassResponse">
> 		<wsdl:part name="parametersRequestResponse" element="pass:passwortAenderungResponse"/>
> 	</wsdl:message>
> 	<wsdl:portType name="passPortType">
> 		<wsdl:operation name="info">
> 			<wsdl:input name="infoRequest" message="tns:InfoRequest"/>
> 			<wsdl:output name="infoResponse" message="tns:InfoResponse"/>
> 			<wsdl:fault name="hinweis" message="tns:Hinweis"/>
> 		</wsdl:operation>
> 		<wsdl:operation name="passwortAenderung">
> 			<wsdl:input name="PassRequest" message="tns:PassRequest"/>
> 			<wsdl:output name="PassResponse" message="tns:PassResponse"/>
> 			<wsdl:fault name="hinweis" message="tns:Hinweis"/>
> 		</wsdl:operation>
> 	</wsdl:portType>
> 	<wsdl:binding name="passSOAP" type="tns:passPortType">
> 		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<wsdl:operation name="info">
> 			<soap:operation soapAction="http://www.kba.de/info" style="document"/>
> 			<wsdl:input name="infoRequest">
> 				<soap:body use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output name="infoResponse">
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 			<wsdl:fault name="hinweis">
> 				<soap:fault name="hinweis" use="literal"/>
> 			</wsdl:fault>
> 		</wsdl:operation>
> 		<wsdl:operation name="passwortAenderung">
> 			<soap:operation soapAction="http://www.kba.de/PasswortAenderung" style="document"/>
> 			<wsdl:input name="PassRequest">
> 				<soap:body use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output name="PassResponse">
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 			<wsdl:fault name="hinweis">
> 				<soap:fault name="hinweis" use="literal"/>
> 			</wsdl:fault>
> 		</wsdl:operation>
> 	</wsdl:binding>
> 	<wsdl:service name="passService">
> 		<wsdl:port name="passSOAP" binding="tns:passSOAP">
> 			<soap:address location="http://localhost:8191/passService"/>
> 		</wsdl:port>
> 	</wsdl:service>
> </wsdl:definitions>
> cxf generated java:
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebResult(targetNamespace = "http://www.kba.de/pass", partName = "parametersInfoResponse", name = "infoResponse")
>     @WebMethod(action = "http://www.kba.de/info")
>     public de.kba.pass.InfoResponse info(
>         @WebParam(targetNamespace = "http://www.kba.de/pass", partName = "parametersInfo", name = "info")
>         de.kba.pass.Info parametersInfo
>     ) throws Hinweis;
> jax-ws ri generated java:
> /**
>      * 
>      * @param passwort
>      * @return
>      *     returns de.kba.hinweis.HinweisTyp
>      */
>     @WebMethod(action = "http://www.kba.de/Info")
>     @WebResult(name = "Hinweis", targetNamespace = "http://www.kba.de/hinweis")
>     @RequestWrapper(localName = "info", targetNamespace = "http://www.kba.de/pass", className = "de.kba.pass.Info")
>     @ResponseWrapper(localName = "infoResponse", targetNamespace = "http://www.kba.de/pass", className = "de.kba.pass.InfoResponse")
>     public HinweisTyp info(
>         @WebParam(name = "Passwort", targetNamespace = "http://www.kba.de/pass")
>         Passwort passwort);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.