You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Dag Framstad (JIRA)" <ji...@apache.org> on 2008/09/11 15:05:45 UTC

[jira] Created: (CXF-1793) WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical

WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical
-------------------------------------------------------------------------------------------------

                 Key: CXF-1793
                 URL: https://issues.apache.org/jira/browse/CXF-1793
             Project: CXF
          Issue Type: Bug
          Components: Tooling
    Affects Versions: 2.1.2
         Environment: Windows XP,  Java 1.5
            Reporter: Dag Framstad


In my WSDL I have 2 services that have similar names.
If the first 14 characters in the message part name are identical WSDL2Java reports (from ant):

generate:
     [java] Loading FrontEnd jaxws ...
     [java] Loading DataBinding jaxb ...
     [java] wsdl2java -b c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/calendar.xjb.w2j -impl -verbose -validate -c
atalog c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/misc -d c:\ADN\adnfond/src/main/generated c:\ADN\adnfond/src/m
ain/resources/com/edb/adnfond/transport/ws/misc/Misc_v10.wsdl
     [java] wsdl2java - Apache CXF 2.1.2
     [java] 
     [java] 
     [java] WSDLToJava Error: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSalesPersonId ] have the sam
e body block {http://edb.com/ws/WSCommon_v21}AutHeader
     [java] 
     [java] 
     [java] 
     [java] org.apache.cxf.tools.common.ToolException: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSal
esPersonId ] have the same body block {http://edb.com/ws/WSCommon_v21}AutHeader
     [java] 
     [java] 
     [java]     at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:128)
     [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:200
)
     [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:62)
     [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:132)
     [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
     [java]     at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
     [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
     [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)

Example WSDL:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions 
	targetNamespace="http://www.edb.com/adnfond/transport/ws/misc/"
	xmlns:misc="http://www.edb.com/adnfond/transport/ws/misc/misc_v10"
	xmlns:m="http://www.edb.com/adnfond/transport/ws/misc/"
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
	xmlns:edb="http://edb.com/ws/WSCommon_v21">
	<wsdl:documentation/>
	<wsdl:types>
		<schema xmlns="http://www.w3.org/2001/XMLSchema">
			<xsd:import namespace="http://edb.com/ws/WSCommon_v21" schemaLocation="../WSCommon_v21.xsd"/>
			<xsd:import namespace="http://www.edb.com/adnfond/transport/ws/misc/misc_v10" schemaLocation="Misc_v10.xsd"/>
		</schema>
	</wsdl:types>
	
	<wsdl:message name="getSalesOfficeIdReq">
		<wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/>
		<wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/>
	</wsdl:message>
	
	<wsdl:message name="getSalesOfficeIdResp">
		<wsdl:part name="salesOfficeIdBodyResp" element="misc:getSalesOfficeIdResponse" />
	</wsdl:message>

	<wsdl:message name="getSalesOfficeId2Req">
		<wsdl:part name="salesOfficeId2Header" element="edb:AutHeader"/>
		<wsdl:part name="xsalesOfficeId2BodyReq" element="misc:getSalesOfficeId2Request"/>
	</wsdl:message>
	
	<wsdl:message name="getSalesOfficeId2Resp">
		<wsdl:part name="salesOfficeId2BodyResp" element="misc:getSalesOfficeId2Response"/>
	</wsdl:message>

		<!-- 
		wsdl2java fails when part names are xsalesOfficeIdBodyReq and xsalesOfficeId2BodyReq
		but works fine when part names are  salesOfficeIdBodyReq and salesOfficeId2BodyReq 
               -->


	<wsdl:portType name="MiscPort">
		<wsdl:operation name="getSalesOfficeId">
			<wsdl:input message="m:getSalesOfficeIdReq"/>
			<wsdl:output message="m:getSalesOfficeIdResp"/>
		</wsdl:operation>	
		<wsdl:operation name="getSalesOfficeId2">
			<wsdl:input message="m:getSalesOfficeId2Req"/>
			<wsdl:output message="m:getSalesOfficeId2Resp"/>
		</wsdl:operation>
	</wsdl:portType>
	
	
	
	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="getSalesOfficeId">
			<soap:operation soapAction="getSalesOfficeId" style="document"/>
			<wsdl:input>
				<soap:header message="m:getSalesOfficeIdReq" part="salesOfficeIdHeader" use="literal"/>
				<soap:body parts="xsalesOfficeIdBodyReq" use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="getSalesOfficeId2">
			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
			<wsdl:input>
				<soap:header message="m:getSalesOfficeId2Req" part="salesOfficeId2Header" use="literal"/>
				<soap:body parts="xsalesOfficeId2BodyReq" use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	
	
	<wsdl:service name="MiscService">
		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>


This is how I use wsdl2java:
        <target name="generate" depends="prepare" description="generate Java source files from schema and wsdl (only run this if you changed shcema or wsdl)">
                <wsdl2java dir="${wsdl.dir}/misc" file="Misc_v10.wsdl" srcdestdir="${generated.dir}" bindingfile="${wsdl.dir}/calendar.xjb.w2j" />
                <replaceregexp match="wsdlLocation = .* ," replace="" byline="true">
                        <fileset dir="${generated.dir}" includes="**/*.java" />
                </replaceregexp>
                <replaceregexp match=", wsdlLocation = .*\)" replace=")" byline="true">
                        <fileset dir="${generated.dir}" includes="**/*.java" />
                </replaceregexp>
        </target>

        <macrodef name="wsdl2java">
                <attribute name="srcdestdir" default="" />
                <attribute name="destdir" default="" />
                <attribute name="file" />
                <attribute name="servicename.arg" default="" />
                <attribute name="bindingfile" default="" />
                <attribute name="dir" default="" />
                <attribute name="wsdlLocation" default="" />
                <attribute name="package" default="NOT_SPECIFIED" />
                <sequential>
                        <condition property="package.arg.@{file}" value="-p @{package}">
                                <not>
                                        <equals arg1="@{package}" arg2="NOT_SPECIFIED" />
                                </not>
                        </condition>
                        <property name="package.arg.@{file}" value="" />
                        <condition property="binding.arg" value='-b "@{bindingfile}"'>
                                <not>
                                        <equals arg1="@{bindingfile}" arg2="" />
                                </not>
                        </condition>
                        <property name="binding.arg" value="" />
                        <condition property="wsdlLocation.arg" value='-wsdlLocation "@{wsdlLocation}"'>
                                <not>
                                        <equals arg1="@{wsdlLocation}" arg2="" />
                                </not>
                        </condition>
                        <property name="wsdlLocation.arg" value="" />
                        <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
                                <classpath>
                                        <path refid="test.classpath" />
                                </classpath>
                                <sysproperty key="exitOnFinish" value="true" />
                                <arg line="@{servicename.arg}" />
                                <arg line="${package.arg.@{file}}" />
                                <arg line="${binding.arg}" />
                                <arg line="${wsdlLocation.arg}" />
                                <arg value="-impl" />
                                <arg value="-verbose" />
                                <arg value="-validate" />
                                <arg value="-catalog" />
                                <arg value="@{dir}" />
                                <arg value="-d" />
                                <arg value="@{srcdestdir}" />
                                <arg value="@{dir}/@{file}" />
                        </java>
                </sequential>
        </macrodef>

If the specs says that message part names can't be longer than 14 characters then please ignore this issue.

Version 2.0.4 has this problem too, and other versions too I imagine, but I have only tested on 2.0.4 and 2.1.2.



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


[jira] Updated: (CXF-1793) WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical

Posted by "Dag Framstad (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag Framstad updated CXF-1793:
------------------------------

    Attachment: cxf-1793.zip

I have attached a zip file with ant file, wsdl examples and the jar files I needed to get things to work.
My real project has lots more jar files and more complex schemas, but this is enough to reproduce the problem.

There are 3 targets in the ant file:
 headerinownmsg     the headers are in its own message, this works
 headerinreqmsg     the headers are in the request messages with headers first, this fails
 headerinreqrevmsg  the headers are in the request messages with headers last, this fails



> WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical
> -------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1793
>                 URL: https://issues.apache.org/jira/browse/CXF-1793
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.2
>         Environment: Windows XP,  Java 1.5
>            Reporter: Dag Framstad
>         Attachments: cxf-1793.zip, cxf1793_works.wsdl
>
>
> In my WSDL I have 2 services that have similar names.
> If the first 14 characters in the message part name are identical WSDL2Java reports (from ant):
> generate:
>      [java] Loading FrontEnd jaxws ...
>      [java] Loading DataBinding jaxb ...
>      [java] wsdl2java -b c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/calendar.xjb.w2j -impl -verbose -validate -c
> atalog c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/misc -d c:\ADN\adnfond/src/main/generated c:\ADN\adnfond/src/m
> ain/resources/com/edb/adnfond/transport/ws/misc/Misc_v10.wsdl
>      [java] wsdl2java - Apache CXF 2.1.2
>      [java] 
>      [java] 
>      [java] WSDLToJava Error: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSalesPersonId ] have the sam
> e body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java] 
>      [java] org.apache.cxf.tools.common.ToolException: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSal
> esPersonId ] have the same body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java]     at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:128)
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:200
> )
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:62)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:132)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
>      [java]     at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
> Example WSDL:
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions 
> 	targetNamespace="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:misc="http://www.edb.com/adnfond/transport/ws/misc/misc_v10"
> 	xmlns:m="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> 	xmlns:edb="http://edb.com/ws/WSCommon_v21">
> 	<wsdl:documentation/>
> 	<wsdl:types>
> 		<schema xmlns="http://www.w3.org/2001/XMLSchema">
> 			<xsd:import namespace="http://edb.com/ws/WSCommon_v21" schemaLocation="../WSCommon_v21.xsd"/>
> 			<xsd:import namespace="http://www.edb.com/adnfond/transport/ws/misc/misc_v10" schemaLocation="Misc_v10.xsd"/>
> 		</schema>
> 	</wsdl:types>
> 	
> 	<wsdl:message name="getSalesOfficeIdReq">
> 		<wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeIdResp">
> 		<wsdl:part name="salesOfficeIdBodyResp" element="misc:getSalesOfficeIdResponse" />
> 	</wsdl:message>
> 	<wsdl:message name="getSalesOfficeId2Req">
> 		<wsdl:part name="salesOfficeId2Header" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeId2BodyReq" element="misc:getSalesOfficeId2Request"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeId2Resp">
> 		<wsdl:part name="salesOfficeId2BodyResp" element="misc:getSalesOfficeId2Response"/>
> 	</wsdl:message>
> 		<!-- 
> 		wsdl2java fails when part names are xsalesOfficeIdBodyReq and xsalesOfficeId2BodyReq
> 		but works fine when part names are  salesOfficeIdBodyReq and salesOfficeId2BodyReq 
>                -->
> 	<wsdl:portType name="MiscPort">
> 		<wsdl:operation name="getSalesOfficeId">
> 			<wsdl:input message="m:getSalesOfficeIdReq"/>
> 			<wsdl:output message="m:getSalesOfficeIdResp"/>
> 		</wsdl:operation>	
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<wsdl:input message="m:getSalesOfficeId2Req"/>
> 			<wsdl:output message="m:getSalesOfficeId2Resp"/>
> 		</wsdl:operation>
> 	</wsdl:portType>
> 	
> 	
> 	
> 	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
> 		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<wsdl:operation name="getSalesOfficeId">
> 			<soap:operation soapAction="getSalesOfficeId" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeIdReq" part="salesOfficeIdHeader" use="literal"/>
> 				<soap:body parts="xsalesOfficeIdBodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeId2Req" part="salesOfficeId2Header" use="literal"/>
> 				<soap:body parts="xsalesOfficeId2BodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 	</wsdl:binding>
> 	
> 	
> 	<wsdl:service name="MiscService">
> 		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
> 			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>
> 		</wsdl:port>
> 	</wsdl:service>
> </wsdl:definitions>
> This is how I use wsdl2java:
>         <target name="generate" depends="prepare" description="generate Java source files from schema and wsdl (only run this if you changed shcema or wsdl)">
>                 <wsdl2java dir="${wsdl.dir}/misc" file="Misc_v10.wsdl" srcdestdir="${generated.dir}" bindingfile="${wsdl.dir}/calendar.xjb.w2j" />
>                 <replaceregexp match="wsdlLocation = .* ," replace="" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>                 <replaceregexp match=", wsdlLocation = .*\)" replace=")" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>         </target>
>         <macrodef name="wsdl2java">
>                 <attribute name="srcdestdir" default="" />
>                 <attribute name="destdir" default="" />
>                 <attribute name="file" />
>                 <attribute name="servicename.arg" default="" />
>                 <attribute name="bindingfile" default="" />
>                 <attribute name="dir" default="" />
>                 <attribute name="wsdlLocation" default="" />
>                 <attribute name="package" default="NOT_SPECIFIED" />
>                 <sequential>
>                         <condition property="package.arg.@{file}" value="-p @{package}">
>                                 <not>
>                                         <equals arg1="@{package}" arg2="NOT_SPECIFIED" />
>                                 </not>
>                         </condition>
>                         <property name="package.arg.@{file}" value="" />
>                         <condition property="binding.arg" value='-b "@{bindingfile}"'>
>                                 <not>
>                                         <equals arg1="@{bindingfile}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="binding.arg" value="" />
>                         <condition property="wsdlLocation.arg" value='-wsdlLocation "@{wsdlLocation}"'>
>                                 <not>
>                                         <equals arg1="@{wsdlLocation}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="wsdlLocation.arg" value="" />
>                         <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
>                                 <classpath>
>                                         <path refid="test.classpath" />
>                                 </classpath>
>                                 <sysproperty key="exitOnFinish" value="true" />
>                                 <arg line="@{servicename.arg}" />
>                                 <arg line="${package.arg.@{file}}" />
>                                 <arg line="${binding.arg}" />
>                                 <arg line="${wsdlLocation.arg}" />
>                                 <arg value="-impl" />
>                                 <arg value="-verbose" />
>                                 <arg value="-validate" />
>                                 <arg value="-catalog" />
>                                 <arg value="@{dir}" />
>                                 <arg value="-d" />
>                                 <arg value="@{srcdestdir}" />
>                                 <arg value="@{dir}/@{file}" />
>                         </java>
>                 </sequential>
>         </macrodef>
> If the specs says that message part names can't be longer than 14 characters then please ignore this issue.
> Version 2.0.4 has this problem too, and other versions too I imagine, but I have only tested on 2.0.4 and 2.1.2.

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


[jira] Updated: (CXF-1793) WSDL2Java reports Non unique body parts if first part in message are soap headers.

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-1793:
-----------------------------

    Summary: WSDL2Java reports Non unique body parts if first part in message are soap headers.  (was: WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical)

> WSDL2Java reports Non unique body parts if first part in message are soap headers.
> ----------------------------------------------------------------------------------
>
>                 Key: CXF-1793
>                 URL: https://issues.apache.org/jira/browse/CXF-1793
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.2
>         Environment: Windows XP,  Java 1.5
>            Reporter: Dag Framstad
>         Attachments: cxf-1793.zip, cxf1793_works.wsdl
>
>
> In my WSDL I have 2 services that have similar names.
> If the first 14 characters in the message part name are identical WSDL2Java reports (from ant):
> generate:
>      [java] Loading FrontEnd jaxws ...
>      [java] Loading DataBinding jaxb ...
>      [java] wsdl2java -b c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/calendar.xjb.w2j -impl -verbose -validate -c
> atalog c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/misc -d c:\ADN\adnfond/src/main/generated c:\ADN\adnfond/src/m
> ain/resources/com/edb/adnfond/transport/ws/misc/Misc_v10.wsdl
>      [java] wsdl2java - Apache CXF 2.1.2
>      [java] 
>      [java] 
>      [java] WSDLToJava Error: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSalesPersonId ] have the sam
> e body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java] 
>      [java] org.apache.cxf.tools.common.ToolException: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSal
> esPersonId ] have the same body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java]     at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:128)
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:200
> )
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:62)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:132)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
>      [java]     at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
> Example WSDL:
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions 
> 	targetNamespace="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:misc="http://www.edb.com/adnfond/transport/ws/misc/misc_v10"
> 	xmlns:m="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> 	xmlns:edb="http://edb.com/ws/WSCommon_v21">
> 	<wsdl:documentation/>
> 	<wsdl:types>
> 		<schema xmlns="http://www.w3.org/2001/XMLSchema">
> 			<xsd:import namespace="http://edb.com/ws/WSCommon_v21" schemaLocation="../WSCommon_v21.xsd"/>
> 			<xsd:import namespace="http://www.edb.com/adnfond/transport/ws/misc/misc_v10" schemaLocation="Misc_v10.xsd"/>
> 		</schema>
> 	</wsdl:types>
> 	
> 	<wsdl:message name="getSalesOfficeIdReq">
> 		<wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeIdResp">
> 		<wsdl:part name="salesOfficeIdBodyResp" element="misc:getSalesOfficeIdResponse" />
> 	</wsdl:message>
> 	<wsdl:message name="getSalesOfficeId2Req">
> 		<wsdl:part name="salesOfficeId2Header" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeId2BodyReq" element="misc:getSalesOfficeId2Request"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeId2Resp">
> 		<wsdl:part name="salesOfficeId2BodyResp" element="misc:getSalesOfficeId2Response"/>
> 	</wsdl:message>
> 		<!-- 
> 		wsdl2java fails when part names are xsalesOfficeIdBodyReq and xsalesOfficeId2BodyReq
> 		but works fine when part names are  salesOfficeIdBodyReq and salesOfficeId2BodyReq 
>                -->
> 	<wsdl:portType name="MiscPort">
> 		<wsdl:operation name="getSalesOfficeId">
> 			<wsdl:input message="m:getSalesOfficeIdReq"/>
> 			<wsdl:output message="m:getSalesOfficeIdResp"/>
> 		</wsdl:operation>	
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<wsdl:input message="m:getSalesOfficeId2Req"/>
> 			<wsdl:output message="m:getSalesOfficeId2Resp"/>
> 		</wsdl:operation>
> 	</wsdl:portType>
> 	
> 	
> 	
> 	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
> 		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<wsdl:operation name="getSalesOfficeId">
> 			<soap:operation soapAction="getSalesOfficeId" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeIdReq" part="salesOfficeIdHeader" use="literal"/>
> 				<soap:body parts="xsalesOfficeIdBodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeId2Req" part="salesOfficeId2Header" use="literal"/>
> 				<soap:body parts="xsalesOfficeId2BodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 	</wsdl:binding>
> 	
> 	
> 	<wsdl:service name="MiscService">
> 		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
> 			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>
> 		</wsdl:port>
> 	</wsdl:service>
> </wsdl:definitions>
> This is how I use wsdl2java:
>         <target name="generate" depends="prepare" description="generate Java source files from schema and wsdl (only run this if you changed shcema or wsdl)">
>                 <wsdl2java dir="${wsdl.dir}/misc" file="Misc_v10.wsdl" srcdestdir="${generated.dir}" bindingfile="${wsdl.dir}/calendar.xjb.w2j" />
>                 <replaceregexp match="wsdlLocation = .* ," replace="" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>                 <replaceregexp match=", wsdlLocation = .*\)" replace=")" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>         </target>
>         <macrodef name="wsdl2java">
>                 <attribute name="srcdestdir" default="" />
>                 <attribute name="destdir" default="" />
>                 <attribute name="file" />
>                 <attribute name="servicename.arg" default="" />
>                 <attribute name="bindingfile" default="" />
>                 <attribute name="dir" default="" />
>                 <attribute name="wsdlLocation" default="" />
>                 <attribute name="package" default="NOT_SPECIFIED" />
>                 <sequential>
>                         <condition property="package.arg.@{file}" value="-p @{package}">
>                                 <not>
>                                         <equals arg1="@{package}" arg2="NOT_SPECIFIED" />
>                                 </not>
>                         </condition>
>                         <property name="package.arg.@{file}" value="" />
>                         <condition property="binding.arg" value='-b "@{bindingfile}"'>
>                                 <not>
>                                         <equals arg1="@{bindingfile}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="binding.arg" value="" />
>                         <condition property="wsdlLocation.arg" value='-wsdlLocation "@{wsdlLocation}"'>
>                                 <not>
>                                         <equals arg1="@{wsdlLocation}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="wsdlLocation.arg" value="" />
>                         <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
>                                 <classpath>
>                                         <path refid="test.classpath" />
>                                 </classpath>
>                                 <sysproperty key="exitOnFinish" value="true" />
>                                 <arg line="@{servicename.arg}" />
>                                 <arg line="${package.arg.@{file}}" />
>                                 <arg line="${binding.arg}" />
>                                 <arg line="${wsdlLocation.arg}" />
>                                 <arg value="-impl" />
>                                 <arg value="-verbose" />
>                                 <arg value="-validate" />
>                                 <arg value="-catalog" />
>                                 <arg value="@{dir}" />
>                                 <arg value="-d" />
>                                 <arg value="@{srcdestdir}" />
>                                 <arg value="@{dir}/@{file}" />
>                         </java>
>                 </sequential>
>         </macrodef>
> If the specs says that message part names can't be longer than 14 characters then please ignore this issue.
> Version 2.0.4 has this problem too, and other versions too I imagine, but I have only tested on 2.0.4 and 2.1.2.

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


[jira] Commented: (CXF-1793) WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical

Posted by "Dag Framstad (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630516#action_12630516 ] 

Dag Framstad commented on CXF-1793:
-----------------------------------

OK,
just adding the -exsh true option didn't work.
Neither did putting the header last.

But moving the header to it's own message and using -exsh true option worked (wsdl2java ignored the header with -exsh set to false).

The tools behavior seems faulty to me, since my original example is valid, but I can live with this workaround.

Thanks for the fast response.

This is my WSDL with headers in separate messages:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions 
	targetNamespace="http://www.edb.com/adnfond/transport/ws/misc/"
	xmlns:misc="http://www.edb.com/adnfond/transport/ws/misc/misc_v10"
	xmlns:m="http://www.edb.com/adnfond/transport/ws/misc/"
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
	xmlns:edb="http://edb.com/ws/WSCommon_v21">
	<wsdl:documentation/>
	<wsdl:types>
		<schema xmlns="http://www.w3.org/2001/XMLSchema">
			<xsd:import namespace="http://edb.com/ws/WSCommon_v21" schemaLocation="../WSCommon_v21.xsd"/>
			<xsd:import namespace="http://www.edb.com/adnfond/transport/ws/misc/misc_v10" schemaLocation="Misc_v10.xsd"/>
		</schema>
	</wsdl:types>
	
	<wsdl:message name="getSalesOfficeIdHeader">
		<wsdl:part name="header" element="edb:AutHeader"/>
	</wsdl:message>

	<wsdl:message name="getSalesOfficeIdReq">
		<wsdl:part name="body" element="misc:getSalesOfficeIdRequest"/>
	</wsdl:message>
	
	<wsdl:message name="getSalesOfficeIdResp">
		<wsdl:part name="body" element="misc:getSalesOfficeIdResponse" />
	</wsdl:message>

	<wsdl:message name="getSalesOfficeId2Header">
		<wsdl:part name="header" element="edb:AutHeader"/>
	</wsdl:message>

	<wsdl:message name="getSalesOfficeId2Req">
		<wsdl:part name="body" element="misc:getSalesOfficeId2Request"/>
	</wsdl:message>
	
	<wsdl:message name="getSalesOfficeId2Resp">
		<wsdl:part name="body" element="misc:getSalesOfficeId2Response"/>
	</wsdl:message>

	<wsdl:portType name="MiscPort">
		<wsdl:operation name="getSalesOfficeId">
			<wsdl:input message="m:getSalesOfficeIdReq" />
			<wsdl:output message="m:getSalesOfficeIdResp"/>
		</wsdl:operation>	
		<wsdl:operation name="getSalesOfficeId2">
			<wsdl:input message="m:getSalesOfficeId2Req"/>
			<wsdl:output message="m:getSalesOfficeId2Resp"/>
		</wsdl:operation>
	</wsdl:portType>
	
	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="getSalesOfficeId">
			<soap:operation soapAction="getSalesOfficeId" style="document"/>
			<wsdl:input>
				<soap:header message="m:getSalesOfficeIdHeader" part="header" use="literal"/>
				<soap:body parts="body" use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="getSalesOfficeId2">
			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
			<wsdl:input>
				<soap:header message="m:getSalesOfficeId2Header" part="header" use="literal"/>
				<soap:body parts="body" use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	
	
	<wsdl:service name="MiscService">
		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>




> WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical
> -------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1793
>                 URL: https://issues.apache.org/jira/browse/CXF-1793
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.2
>         Environment: Windows XP,  Java 1.5
>            Reporter: Dag Framstad
>
> In my WSDL I have 2 services that have similar names.
> If the first 14 characters in the message part name are identical WSDL2Java reports (from ant):
> generate:
>      [java] Loading FrontEnd jaxws ...
>      [java] Loading DataBinding jaxb ...
>      [java] wsdl2java -b c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/calendar.xjb.w2j -impl -verbose -validate -c
> atalog c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/misc -d c:\ADN\adnfond/src/main/generated c:\ADN\adnfond/src/m
> ain/resources/com/edb/adnfond/transport/ws/misc/Misc_v10.wsdl
>      [java] wsdl2java - Apache CXF 2.1.2
>      [java] 
>      [java] 
>      [java] WSDLToJava Error: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSalesPersonId ] have the sam
> e body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java] 
>      [java] org.apache.cxf.tools.common.ToolException: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSal
> esPersonId ] have the same body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java]     at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:128)
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:200
> )
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:62)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:132)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
>      [java]     at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
> Example WSDL:
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions 
> 	targetNamespace="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:misc="http://www.edb.com/adnfond/transport/ws/misc/misc_v10"
> 	xmlns:m="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> 	xmlns:edb="http://edb.com/ws/WSCommon_v21">
> 	<wsdl:documentation/>
> 	<wsdl:types>
> 		<schema xmlns="http://www.w3.org/2001/XMLSchema">
> 			<xsd:import namespace="http://edb.com/ws/WSCommon_v21" schemaLocation="../WSCommon_v21.xsd"/>
> 			<xsd:import namespace="http://www.edb.com/adnfond/transport/ws/misc/misc_v10" schemaLocation="Misc_v10.xsd"/>
> 		</schema>
> 	</wsdl:types>
> 	
> 	<wsdl:message name="getSalesOfficeIdReq">
> 		<wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeIdResp">
> 		<wsdl:part name="salesOfficeIdBodyResp" element="misc:getSalesOfficeIdResponse" />
> 	</wsdl:message>
> 	<wsdl:message name="getSalesOfficeId2Req">
> 		<wsdl:part name="salesOfficeId2Header" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeId2BodyReq" element="misc:getSalesOfficeId2Request"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeId2Resp">
> 		<wsdl:part name="salesOfficeId2BodyResp" element="misc:getSalesOfficeId2Response"/>
> 	</wsdl:message>
> 		<!-- 
> 		wsdl2java fails when part names are xsalesOfficeIdBodyReq and xsalesOfficeId2BodyReq
> 		but works fine when part names are  salesOfficeIdBodyReq and salesOfficeId2BodyReq 
>                -->
> 	<wsdl:portType name="MiscPort">
> 		<wsdl:operation name="getSalesOfficeId">
> 			<wsdl:input message="m:getSalesOfficeIdReq"/>
> 			<wsdl:output message="m:getSalesOfficeIdResp"/>
> 		</wsdl:operation>	
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<wsdl:input message="m:getSalesOfficeId2Req"/>
> 			<wsdl:output message="m:getSalesOfficeId2Resp"/>
> 		</wsdl:operation>
> 	</wsdl:portType>
> 	
> 	
> 	
> 	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
> 		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<wsdl:operation name="getSalesOfficeId">
> 			<soap:operation soapAction="getSalesOfficeId" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeIdReq" part="salesOfficeIdHeader" use="literal"/>
> 				<soap:body parts="xsalesOfficeIdBodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeId2Req" part="salesOfficeId2Header" use="literal"/>
> 				<soap:body parts="xsalesOfficeId2BodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 	</wsdl:binding>
> 	
> 	
> 	<wsdl:service name="MiscService">
> 		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
> 			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>
> 		</wsdl:port>
> 	</wsdl:service>
> </wsdl:definitions>
> This is how I use wsdl2java:
>         <target name="generate" depends="prepare" description="generate Java source files from schema and wsdl (only run this if you changed shcema or wsdl)">
>                 <wsdl2java dir="${wsdl.dir}/misc" file="Misc_v10.wsdl" srcdestdir="${generated.dir}" bindingfile="${wsdl.dir}/calendar.xjb.w2j" />
>                 <replaceregexp match="wsdlLocation = .* ," replace="" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>                 <replaceregexp match=", wsdlLocation = .*\)" replace=")" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>         </target>
>         <macrodef name="wsdl2java">
>                 <attribute name="srcdestdir" default="" />
>                 <attribute name="destdir" default="" />
>                 <attribute name="file" />
>                 <attribute name="servicename.arg" default="" />
>                 <attribute name="bindingfile" default="" />
>                 <attribute name="dir" default="" />
>                 <attribute name="wsdlLocation" default="" />
>                 <attribute name="package" default="NOT_SPECIFIED" />
>                 <sequential>
>                         <condition property="package.arg.@{file}" value="-p @{package}">
>                                 <not>
>                                         <equals arg1="@{package}" arg2="NOT_SPECIFIED" />
>                                 </not>
>                         </condition>
>                         <property name="package.arg.@{file}" value="" />
>                         <condition property="binding.arg" value='-b "@{bindingfile}"'>
>                                 <not>
>                                         <equals arg1="@{bindingfile}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="binding.arg" value="" />
>                         <condition property="wsdlLocation.arg" value='-wsdlLocation "@{wsdlLocation}"'>
>                                 <not>
>                                         <equals arg1="@{wsdlLocation}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="wsdlLocation.arg" value="" />
>                         <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
>                                 <classpath>
>                                         <path refid="test.classpath" />
>                                 </classpath>
>                                 <sysproperty key="exitOnFinish" value="true" />
>                                 <arg line="@{servicename.arg}" />
>                                 <arg line="${package.arg.@{file}}" />
>                                 <arg line="${binding.arg}" />
>                                 <arg line="${wsdlLocation.arg}" />
>                                 <arg value="-impl" />
>                                 <arg value="-verbose" />
>                                 <arg value="-validate" />
>                                 <arg value="-catalog" />
>                                 <arg value="@{dir}" />
>                                 <arg value="-d" />
>                                 <arg value="@{srcdestdir}" />
>                                 <arg value="@{dir}/@{file}" />
>                         </java>
>                 </sequential>
>         </macrodef>
> If the specs says that message part names can't be longer than 14 characters then please ignore this issue.
> Version 2.0.4 has this problem too, and other versions too I imagine, but I have only tested on 2.0.4 and 2.1.2.

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


[jira] Commented: (CXF-1793) WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical

Posted by "Dag Framstad (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630504#action_12630504 ] 

Dag Framstad commented on CXF-1793:
-----------------------------------

Ok,
tried the -exsh true option, it didn't help.
Then I put the header last, and that worked.

I can live with this, even though I think the behavior could be better.
Thanks for fast response.

> WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical
> -------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1793
>                 URL: https://issues.apache.org/jira/browse/CXF-1793
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.2
>         Environment: Windows XP,  Java 1.5
>            Reporter: Dag Framstad
>
> In my WSDL I have 2 services that have similar names.
> If the first 14 characters in the message part name are identical WSDL2Java reports (from ant):
> generate:
>      [java] Loading FrontEnd jaxws ...
>      [java] Loading DataBinding jaxb ...
>      [java] wsdl2java -b c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/calendar.xjb.w2j -impl -verbose -validate -c
> atalog c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/misc -d c:\ADN\adnfond/src/main/generated c:\ADN\adnfond/src/m
> ain/resources/com/edb/adnfond/transport/ws/misc/Misc_v10.wsdl
>      [java] wsdl2java - Apache CXF 2.1.2
>      [java] 
>      [java] 
>      [java] WSDLToJava Error: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSalesPersonId ] have the sam
> e body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java] 
>      [java] org.apache.cxf.tools.common.ToolException: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSal
> esPersonId ] have the same body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java]     at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:128)
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:200
> )
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:62)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:132)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
>      [java]     at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
> Example WSDL:
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions 
> 	targetNamespace="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:misc="http://www.edb.com/adnfond/transport/ws/misc/misc_v10"
> 	xmlns:m="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> 	xmlns:edb="http://edb.com/ws/WSCommon_v21">
> 	<wsdl:documentation/>
> 	<wsdl:types>
> 		<schema xmlns="http://www.w3.org/2001/XMLSchema">
> 			<xsd:import namespace="http://edb.com/ws/WSCommon_v21" schemaLocation="../WSCommon_v21.xsd"/>
> 			<xsd:import namespace="http://www.edb.com/adnfond/transport/ws/misc/misc_v10" schemaLocation="Misc_v10.xsd"/>
> 		</schema>
> 	</wsdl:types>
> 	
> 	<wsdl:message name="getSalesOfficeIdReq">
> 		<wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeIdResp">
> 		<wsdl:part name="salesOfficeIdBodyResp" element="misc:getSalesOfficeIdResponse" />
> 	</wsdl:message>
> 	<wsdl:message name="getSalesOfficeId2Req">
> 		<wsdl:part name="salesOfficeId2Header" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeId2BodyReq" element="misc:getSalesOfficeId2Request"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeId2Resp">
> 		<wsdl:part name="salesOfficeId2BodyResp" element="misc:getSalesOfficeId2Response"/>
> 	</wsdl:message>
> 		<!-- 
> 		wsdl2java fails when part names are xsalesOfficeIdBodyReq and xsalesOfficeId2BodyReq
> 		but works fine when part names are  salesOfficeIdBodyReq and salesOfficeId2BodyReq 
>                -->
> 	<wsdl:portType name="MiscPort">
> 		<wsdl:operation name="getSalesOfficeId">
> 			<wsdl:input message="m:getSalesOfficeIdReq"/>
> 			<wsdl:output message="m:getSalesOfficeIdResp"/>
> 		</wsdl:operation>	
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<wsdl:input message="m:getSalesOfficeId2Req"/>
> 			<wsdl:output message="m:getSalesOfficeId2Resp"/>
> 		</wsdl:operation>
> 	</wsdl:portType>
> 	
> 	
> 	
> 	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
> 		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<wsdl:operation name="getSalesOfficeId">
> 			<soap:operation soapAction="getSalesOfficeId" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeIdReq" part="salesOfficeIdHeader" use="literal"/>
> 				<soap:body parts="xsalesOfficeIdBodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeId2Req" part="salesOfficeId2Header" use="literal"/>
> 				<soap:body parts="xsalesOfficeId2BodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 	</wsdl:binding>
> 	
> 	
> 	<wsdl:service name="MiscService">
> 		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
> 			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>
> 		</wsdl:port>
> 	</wsdl:service>
> </wsdl:definitions>
> This is how I use wsdl2java:
>         <target name="generate" depends="prepare" description="generate Java source files from schema and wsdl (only run this if you changed shcema or wsdl)">
>                 <wsdl2java dir="${wsdl.dir}/misc" file="Misc_v10.wsdl" srcdestdir="${generated.dir}" bindingfile="${wsdl.dir}/calendar.xjb.w2j" />
>                 <replaceregexp match="wsdlLocation = .* ," replace="" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>                 <replaceregexp match=", wsdlLocation = .*\)" replace=")" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>         </target>
>         <macrodef name="wsdl2java">
>                 <attribute name="srcdestdir" default="" />
>                 <attribute name="destdir" default="" />
>                 <attribute name="file" />
>                 <attribute name="servicename.arg" default="" />
>                 <attribute name="bindingfile" default="" />
>                 <attribute name="dir" default="" />
>                 <attribute name="wsdlLocation" default="" />
>                 <attribute name="package" default="NOT_SPECIFIED" />
>                 <sequential>
>                         <condition property="package.arg.@{file}" value="-p @{package}">
>                                 <not>
>                                         <equals arg1="@{package}" arg2="NOT_SPECIFIED" />
>                                 </not>
>                         </condition>
>                         <property name="package.arg.@{file}" value="" />
>                         <condition property="binding.arg" value='-b "@{bindingfile}"'>
>                                 <not>
>                                         <equals arg1="@{bindingfile}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="binding.arg" value="" />
>                         <condition property="wsdlLocation.arg" value='-wsdlLocation "@{wsdlLocation}"'>
>                                 <not>
>                                         <equals arg1="@{wsdlLocation}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="wsdlLocation.arg" value="" />
>                         <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
>                                 <classpath>
>                                         <path refid="test.classpath" />
>                                 </classpath>
>                                 <sysproperty key="exitOnFinish" value="true" />
>                                 <arg line="@{servicename.arg}" />
>                                 <arg line="${package.arg.@{file}}" />
>                                 <arg line="${binding.arg}" />
>                                 <arg line="${wsdlLocation.arg}" />
>                                 <arg value="-impl" />
>                                 <arg value="-verbose" />
>                                 <arg value="-validate" />
>                                 <arg value="-catalog" />
>                                 <arg value="@{dir}" />
>                                 <arg value="-d" />
>                                 <arg value="@{srcdestdir}" />
>                                 <arg value="@{dir}/@{file}" />
>                         </java>
>                 </sequential>
>         </macrodef>
> If the specs says that message part names can't be longer than 14 characters then please ignore this issue.
> Version 2.0.4 has this problem too, and other versions too I imagine, but I have only tested on 2.0.4 and 2.1.2.

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


[jira] Closed: (CXF-1793) WSDL2Java reports Non unique body parts if first part in message are soap headers.

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang closed CXF-1793.
-----------------------------


> WSDL2Java reports Non unique body parts if first part in message are soap headers.
> ----------------------------------------------------------------------------------
>
>                 Key: CXF-1793
>                 URL: https://issues.apache.org/jira/browse/CXF-1793
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.2
>         Environment: Windows XP,  Java 1.5
>            Reporter: Dag Framstad
>            Assignee: Daniel Kulp
>             Fix For: 2.1.3
>
>         Attachments: cxf-1793.zip, cxf1793_works.wsdl
>
>
> In my WSDL I have 2 services that have similar names.
> If the first 14 characters in the message part name are identical WSDL2Java reports (from ant):
> generate:
>      [java] Loading FrontEnd jaxws ...
>      [java] Loading DataBinding jaxb ...
>      [java] wsdl2java -b c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/calendar.xjb.w2j -impl -verbose -validate -c
> atalog c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/misc -d c:\ADN\adnfond/src/main/generated c:\ADN\adnfond/src/m
> ain/resources/com/edb/adnfond/transport/ws/misc/Misc_v10.wsdl
>      [java] wsdl2java - Apache CXF 2.1.2
>      [java] 
>      [java] 
>      [java] WSDLToJava Error: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSalesPersonId ] have the sam
> e body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java] 
>      [java] org.apache.cxf.tools.common.ToolException: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSal
> esPersonId ] have the same body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java]     at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:128)
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:200
> )
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:62)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:132)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
>      [java]     at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
> Example WSDL:
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions 
> 	targetNamespace="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:misc="http://www.edb.com/adnfond/transport/ws/misc/misc_v10"
> 	xmlns:m="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> 	xmlns:edb="http://edb.com/ws/WSCommon_v21">
> 	<wsdl:documentation/>
> 	<wsdl:types>
> 		<schema xmlns="http://www.w3.org/2001/XMLSchema">
> 			<xsd:import namespace="http://edb.com/ws/WSCommon_v21" schemaLocation="../WSCommon_v21.xsd"/>
> 			<xsd:import namespace="http://www.edb.com/adnfond/transport/ws/misc/misc_v10" schemaLocation="Misc_v10.xsd"/>
> 		</schema>
> 	</wsdl:types>
> 	
> 	<wsdl:message name="getSalesOfficeIdReq">
> 		<wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeIdResp">
> 		<wsdl:part name="salesOfficeIdBodyResp" element="misc:getSalesOfficeIdResponse" />
> 	</wsdl:message>
> 	<wsdl:message name="getSalesOfficeId2Req">
> 		<wsdl:part name="salesOfficeId2Header" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeId2BodyReq" element="misc:getSalesOfficeId2Request"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeId2Resp">
> 		<wsdl:part name="salesOfficeId2BodyResp" element="misc:getSalesOfficeId2Response"/>
> 	</wsdl:message>
> 		<!-- 
> 		wsdl2java fails when part names are xsalesOfficeIdBodyReq and xsalesOfficeId2BodyReq
> 		but works fine when part names are  salesOfficeIdBodyReq and salesOfficeId2BodyReq 
>                -->
> 	<wsdl:portType name="MiscPort">
> 		<wsdl:operation name="getSalesOfficeId">
> 			<wsdl:input message="m:getSalesOfficeIdReq"/>
> 			<wsdl:output message="m:getSalesOfficeIdResp"/>
> 		</wsdl:operation>	
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<wsdl:input message="m:getSalesOfficeId2Req"/>
> 			<wsdl:output message="m:getSalesOfficeId2Resp"/>
> 		</wsdl:operation>
> 	</wsdl:portType>
> 	
> 	
> 	
> 	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
> 		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<wsdl:operation name="getSalesOfficeId">
> 			<soap:operation soapAction="getSalesOfficeId" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeIdReq" part="salesOfficeIdHeader" use="literal"/>
> 				<soap:body parts="xsalesOfficeIdBodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeId2Req" part="salesOfficeId2Header" use="literal"/>
> 				<soap:body parts="xsalesOfficeId2BodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 	</wsdl:binding>
> 	
> 	
> 	<wsdl:service name="MiscService">
> 		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
> 			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>
> 		</wsdl:port>
> 	</wsdl:service>
> </wsdl:definitions>
> This is how I use wsdl2java:
>         <target name="generate" depends="prepare" description="generate Java source files from schema and wsdl (only run this if you changed shcema or wsdl)">
>                 <wsdl2java dir="${wsdl.dir}/misc" file="Misc_v10.wsdl" srcdestdir="${generated.dir}" bindingfile="${wsdl.dir}/calendar.xjb.w2j" />
>                 <replaceregexp match="wsdlLocation = .* ," replace="" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>                 <replaceregexp match=", wsdlLocation = .*\)" replace=")" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>         </target>
>         <macrodef name="wsdl2java">
>                 <attribute name="srcdestdir" default="" />
>                 <attribute name="destdir" default="" />
>                 <attribute name="file" />
>                 <attribute name="servicename.arg" default="" />
>                 <attribute name="bindingfile" default="" />
>                 <attribute name="dir" default="" />
>                 <attribute name="wsdlLocation" default="" />
>                 <attribute name="package" default="NOT_SPECIFIED" />
>                 <sequential>
>                         <condition property="package.arg.@{file}" value="-p @{package}">
>                                 <not>
>                                         <equals arg1="@{package}" arg2="NOT_SPECIFIED" />
>                                 </not>
>                         </condition>
>                         <property name="package.arg.@{file}" value="" />
>                         <condition property="binding.arg" value='-b "@{bindingfile}"'>
>                                 <not>
>                                         <equals arg1="@{bindingfile}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="binding.arg" value="" />
>                         <condition property="wsdlLocation.arg" value='-wsdlLocation "@{wsdlLocation}"'>
>                                 <not>
>                                         <equals arg1="@{wsdlLocation}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="wsdlLocation.arg" value="" />
>                         <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
>                                 <classpath>
>                                         <path refid="test.classpath" />
>                                 </classpath>
>                                 <sysproperty key="exitOnFinish" value="true" />
>                                 <arg line="@{servicename.arg}" />
>                                 <arg line="${package.arg.@{file}}" />
>                                 <arg line="${binding.arg}" />
>                                 <arg line="${wsdlLocation.arg}" />
>                                 <arg value="-impl" />
>                                 <arg value="-verbose" />
>                                 <arg value="-validate" />
>                                 <arg value="-catalog" />
>                                 <arg value="@{dir}" />
>                                 <arg value="-d" />
>                                 <arg value="@{srcdestdir}" />
>                                 <arg value="@{dir}/@{file}" />
>                         </java>
>                 </sequential>
>         </macrodef>
> If the specs says that message part names can't be longer than 14 characters then please ignore this issue.
> Version 2.0.4 has this problem too, and other versions too I imagine, but I have only tested on 2.0.4 and 2.1.2.

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


[jira] Commented: (CXF-1793) WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630325#action_12630325 ] 

Daniel Kulp commented on CXF-1793:
----------------------------------


This issue has nothing to do with the number of characters....

Both the input message for both operations have the first element of:
edb:AutHeader
Thus, without processing the soap:binding to determine which are headers which I don't think the tools do by default, it doesn't look like the the incoming messages could be dispatched while streaming correctly.   (not wsi-bp compliant type thing again).     It MIGHT work if you add the -exsh true flag (not sure)  

Alternatively, if you move the header to it's own message, that should work (would want the -exsh true flag again)

Or put the header last:
 <wsdl:message name="getSalesOfficeIdReq"> 
 <wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/> 
 <wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/> 
 </wsdl:message> 


> WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical
> -------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1793
>                 URL: https://issues.apache.org/jira/browse/CXF-1793
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.2
>         Environment: Windows XP,  Java 1.5
>            Reporter: Dag Framstad
>
> In my WSDL I have 2 services that have similar names.
> If the first 14 characters in the message part name are identical WSDL2Java reports (from ant):
> generate:
>      [java] Loading FrontEnd jaxws ...
>      [java] Loading DataBinding jaxb ...
>      [java] wsdl2java -b c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/calendar.xjb.w2j -impl -verbose -validate -c
> atalog c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/misc -d c:\ADN\adnfond/src/main/generated c:\ADN\adnfond/src/m
> ain/resources/com/edb/adnfond/transport/ws/misc/Misc_v10.wsdl
>      [java] wsdl2java - Apache CXF 2.1.2
>      [java] 
>      [java] 
>      [java] WSDLToJava Error: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSalesPersonId ] have the sam
> e body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java] 
>      [java] org.apache.cxf.tools.common.ToolException: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSal
> esPersonId ] have the same body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java]     at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:128)
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:200
> )
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:62)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:132)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
>      [java]     at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
> Example WSDL:
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions 
> 	targetNamespace="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:misc="http://www.edb.com/adnfond/transport/ws/misc/misc_v10"
> 	xmlns:m="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> 	xmlns:edb="http://edb.com/ws/WSCommon_v21">
> 	<wsdl:documentation/>
> 	<wsdl:types>
> 		<schema xmlns="http://www.w3.org/2001/XMLSchema">
> 			<xsd:import namespace="http://edb.com/ws/WSCommon_v21" schemaLocation="../WSCommon_v21.xsd"/>
> 			<xsd:import namespace="http://www.edb.com/adnfond/transport/ws/misc/misc_v10" schemaLocation="Misc_v10.xsd"/>
> 		</schema>
> 	</wsdl:types>
> 	
> 	<wsdl:message name="getSalesOfficeIdReq">
> 		<wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeIdResp">
> 		<wsdl:part name="salesOfficeIdBodyResp" element="misc:getSalesOfficeIdResponse" />
> 	</wsdl:message>
> 	<wsdl:message name="getSalesOfficeId2Req">
> 		<wsdl:part name="salesOfficeId2Header" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeId2BodyReq" element="misc:getSalesOfficeId2Request"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeId2Resp">
> 		<wsdl:part name="salesOfficeId2BodyResp" element="misc:getSalesOfficeId2Response"/>
> 	</wsdl:message>
> 		<!-- 
> 		wsdl2java fails when part names are xsalesOfficeIdBodyReq and xsalesOfficeId2BodyReq
> 		but works fine when part names are  salesOfficeIdBodyReq and salesOfficeId2BodyReq 
>                -->
> 	<wsdl:portType name="MiscPort">
> 		<wsdl:operation name="getSalesOfficeId">
> 			<wsdl:input message="m:getSalesOfficeIdReq"/>
> 			<wsdl:output message="m:getSalesOfficeIdResp"/>
> 		</wsdl:operation>	
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<wsdl:input message="m:getSalesOfficeId2Req"/>
> 			<wsdl:output message="m:getSalesOfficeId2Resp"/>
> 		</wsdl:operation>
> 	</wsdl:portType>
> 	
> 	
> 	
> 	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
> 		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<wsdl:operation name="getSalesOfficeId">
> 			<soap:operation soapAction="getSalesOfficeId" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeIdReq" part="salesOfficeIdHeader" use="literal"/>
> 				<soap:body parts="xsalesOfficeIdBodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeId2Req" part="salesOfficeId2Header" use="literal"/>
> 				<soap:body parts="xsalesOfficeId2BodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 	</wsdl:binding>
> 	
> 	
> 	<wsdl:service name="MiscService">
> 		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
> 			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>
> 		</wsdl:port>
> 	</wsdl:service>
> </wsdl:definitions>
> This is how I use wsdl2java:
>         <target name="generate" depends="prepare" description="generate Java source files from schema and wsdl (only run this if you changed shcema or wsdl)">
>                 <wsdl2java dir="${wsdl.dir}/misc" file="Misc_v10.wsdl" srcdestdir="${generated.dir}" bindingfile="${wsdl.dir}/calendar.xjb.w2j" />
>                 <replaceregexp match="wsdlLocation = .* ," replace="" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>                 <replaceregexp match=", wsdlLocation = .*\)" replace=")" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>         </target>
>         <macrodef name="wsdl2java">
>                 <attribute name="srcdestdir" default="" />
>                 <attribute name="destdir" default="" />
>                 <attribute name="file" />
>                 <attribute name="servicename.arg" default="" />
>                 <attribute name="bindingfile" default="" />
>                 <attribute name="dir" default="" />
>                 <attribute name="wsdlLocation" default="" />
>                 <attribute name="package" default="NOT_SPECIFIED" />
>                 <sequential>
>                         <condition property="package.arg.@{file}" value="-p @{package}">
>                                 <not>
>                                         <equals arg1="@{package}" arg2="NOT_SPECIFIED" />
>                                 </not>
>                         </condition>
>                         <property name="package.arg.@{file}" value="" />
>                         <condition property="binding.arg" value='-b "@{bindingfile}"'>
>                                 <not>
>                                         <equals arg1="@{bindingfile}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="binding.arg" value="" />
>                         <condition property="wsdlLocation.arg" value='-wsdlLocation "@{wsdlLocation}"'>
>                                 <not>
>                                         <equals arg1="@{wsdlLocation}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="wsdlLocation.arg" value="" />
>                         <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
>                                 <classpath>
>                                         <path refid="test.classpath" />
>                                 </classpath>
>                                 <sysproperty key="exitOnFinish" value="true" />
>                                 <arg line="@{servicename.arg}" />
>                                 <arg line="${package.arg.@{file}}" />
>                                 <arg line="${binding.arg}" />
>                                 <arg line="${wsdlLocation.arg}" />
>                                 <arg value="-impl" />
>                                 <arg value="-verbose" />
>                                 <arg value="-validate" />
>                                 <arg value="-catalog" />
>                                 <arg value="@{dir}" />
>                                 <arg value="-d" />
>                                 <arg value="@{srcdestdir}" />
>                                 <arg value="@{dir}/@{file}" />
>                         </java>
>                 </sequential>
>         </macrodef>
> If the specs says that message part names can't be longer than 14 characters then please ignore this issue.
> Version 2.0.4 has this problem too, and other versions too I imagine, but I have only tested on 2.0.4 and 2.1.2.

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


[jira] Updated: (CXF-1793) WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical

Posted by "Dag Framstad (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag Framstad updated CXF-1793:
------------------------------

    Comment: was deleted

> WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical
> -------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1793
>                 URL: https://issues.apache.org/jira/browse/CXF-1793
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.2
>         Environment: Windows XP,  Java 1.5
>            Reporter: Dag Framstad
>
> In my WSDL I have 2 services that have similar names.
> If the first 14 characters in the message part name are identical WSDL2Java reports (from ant):
> generate:
>      [java] Loading FrontEnd jaxws ...
>      [java] Loading DataBinding jaxb ...
>      [java] wsdl2java -b c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/calendar.xjb.w2j -impl -verbose -validate -c
> atalog c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/misc -d c:\ADN\adnfond/src/main/generated c:\ADN\adnfond/src/m
> ain/resources/com/edb/adnfond/transport/ws/misc/Misc_v10.wsdl
>      [java] wsdl2java - Apache CXF 2.1.2
>      [java] 
>      [java] 
>      [java] WSDLToJava Error: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSalesPersonId ] have the sam
> e body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java] 
>      [java] org.apache.cxf.tools.common.ToolException: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSal
> esPersonId ] have the same body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java]     at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:128)
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:200
> )
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:62)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:132)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
>      [java]     at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
> Example WSDL:
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions 
> 	targetNamespace="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:misc="http://www.edb.com/adnfond/transport/ws/misc/misc_v10"
> 	xmlns:m="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> 	xmlns:edb="http://edb.com/ws/WSCommon_v21">
> 	<wsdl:documentation/>
> 	<wsdl:types>
> 		<schema xmlns="http://www.w3.org/2001/XMLSchema">
> 			<xsd:import namespace="http://edb.com/ws/WSCommon_v21" schemaLocation="../WSCommon_v21.xsd"/>
> 			<xsd:import namespace="http://www.edb.com/adnfond/transport/ws/misc/misc_v10" schemaLocation="Misc_v10.xsd"/>
> 		</schema>
> 	</wsdl:types>
> 	
> 	<wsdl:message name="getSalesOfficeIdReq">
> 		<wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeIdResp">
> 		<wsdl:part name="salesOfficeIdBodyResp" element="misc:getSalesOfficeIdResponse" />
> 	</wsdl:message>
> 	<wsdl:message name="getSalesOfficeId2Req">
> 		<wsdl:part name="salesOfficeId2Header" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeId2BodyReq" element="misc:getSalesOfficeId2Request"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeId2Resp">
> 		<wsdl:part name="salesOfficeId2BodyResp" element="misc:getSalesOfficeId2Response"/>
> 	</wsdl:message>
> 		<!-- 
> 		wsdl2java fails when part names are xsalesOfficeIdBodyReq and xsalesOfficeId2BodyReq
> 		but works fine when part names are  salesOfficeIdBodyReq and salesOfficeId2BodyReq 
>                -->
> 	<wsdl:portType name="MiscPort">
> 		<wsdl:operation name="getSalesOfficeId">
> 			<wsdl:input message="m:getSalesOfficeIdReq"/>
> 			<wsdl:output message="m:getSalesOfficeIdResp"/>
> 		</wsdl:operation>	
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<wsdl:input message="m:getSalesOfficeId2Req"/>
> 			<wsdl:output message="m:getSalesOfficeId2Resp"/>
> 		</wsdl:operation>
> 	</wsdl:portType>
> 	
> 	
> 	
> 	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
> 		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<wsdl:operation name="getSalesOfficeId">
> 			<soap:operation soapAction="getSalesOfficeId" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeIdReq" part="salesOfficeIdHeader" use="literal"/>
> 				<soap:body parts="xsalesOfficeIdBodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeId2Req" part="salesOfficeId2Header" use="literal"/>
> 				<soap:body parts="xsalesOfficeId2BodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 	</wsdl:binding>
> 	
> 	
> 	<wsdl:service name="MiscService">
> 		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
> 			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>
> 		</wsdl:port>
> 	</wsdl:service>
> </wsdl:definitions>
> This is how I use wsdl2java:
>         <target name="generate" depends="prepare" description="generate Java source files from schema and wsdl (only run this if you changed shcema or wsdl)">
>                 <wsdl2java dir="${wsdl.dir}/misc" file="Misc_v10.wsdl" srcdestdir="${generated.dir}" bindingfile="${wsdl.dir}/calendar.xjb.w2j" />
>                 <replaceregexp match="wsdlLocation = .* ," replace="" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>                 <replaceregexp match=", wsdlLocation = .*\)" replace=")" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>         </target>
>         <macrodef name="wsdl2java">
>                 <attribute name="srcdestdir" default="" />
>                 <attribute name="destdir" default="" />
>                 <attribute name="file" />
>                 <attribute name="servicename.arg" default="" />
>                 <attribute name="bindingfile" default="" />
>                 <attribute name="dir" default="" />
>                 <attribute name="wsdlLocation" default="" />
>                 <attribute name="package" default="NOT_SPECIFIED" />
>                 <sequential>
>                         <condition property="package.arg.@{file}" value="-p @{package}">
>                                 <not>
>                                         <equals arg1="@{package}" arg2="NOT_SPECIFIED" />
>                                 </not>
>                         </condition>
>                         <property name="package.arg.@{file}" value="" />
>                         <condition property="binding.arg" value='-b "@{bindingfile}"'>
>                                 <not>
>                                         <equals arg1="@{bindingfile}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="binding.arg" value="" />
>                         <condition property="wsdlLocation.arg" value='-wsdlLocation "@{wsdlLocation}"'>
>                                 <not>
>                                         <equals arg1="@{wsdlLocation}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="wsdlLocation.arg" value="" />
>                         <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
>                                 <classpath>
>                                         <path refid="test.classpath" />
>                                 </classpath>
>                                 <sysproperty key="exitOnFinish" value="true" />
>                                 <arg line="@{servicename.arg}" />
>                                 <arg line="${package.arg.@{file}}" />
>                                 <arg line="${binding.arg}" />
>                                 <arg line="${wsdlLocation.arg}" />
>                                 <arg value="-impl" />
>                                 <arg value="-verbose" />
>                                 <arg value="-validate" />
>                                 <arg value="-catalog" />
>                                 <arg value="@{dir}" />
>                                 <arg value="-d" />
>                                 <arg value="@{srcdestdir}" />
>                                 <arg value="@{dir}/@{file}" />
>                         </java>
>                 </sequential>
>         </macrodef>
> If the specs says that message part names can't be longer than 14 characters then please ignore this issue.
> Version 2.0.4 has this problem too, and other versions too I imagine, but I have only tested on 2.0.4 and 2.1.2.

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


[jira] Updated: (CXF-1793) WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-1793:
-----------------------------

    Attachment: cxf1793_works.wsdl


I cannot reproduce this.   I've attached a wsdl that I used from the info in the first message.  I had to create a schema for the various elements since you didn't provide any schema stuff.

I ran this with 2.1.1, 2.1.2, and the latest 2.1.3 and 2.2 snapshots and it just works without error.

I'll probably need a full example (zip file attachment is preferred so jira doesn't mangle things).

> WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical
> -------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1793
>                 URL: https://issues.apache.org/jira/browse/CXF-1793
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.2
>         Environment: Windows XP,  Java 1.5
>            Reporter: Dag Framstad
>         Attachments: cxf1793_works.wsdl
>
>
> In my WSDL I have 2 services that have similar names.
> If the first 14 characters in the message part name are identical WSDL2Java reports (from ant):
> generate:
>      [java] Loading FrontEnd jaxws ...
>      [java] Loading DataBinding jaxb ...
>      [java] wsdl2java -b c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/calendar.xjb.w2j -impl -verbose -validate -c
> atalog c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/misc -d c:\ADN\adnfond/src/main/generated c:\ADN\adnfond/src/m
> ain/resources/com/edb/adnfond/transport/ws/misc/Misc_v10.wsdl
>      [java] wsdl2java - Apache CXF 2.1.2
>      [java] 
>      [java] 
>      [java] WSDLToJava Error: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSalesPersonId ] have the sam
> e body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java] 
>      [java] org.apache.cxf.tools.common.ToolException: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSal
> esPersonId ] have the same body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java]     at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:128)
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:200
> )
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:62)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:132)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
>      [java]     at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
> Example WSDL:
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions 
> 	targetNamespace="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:misc="http://www.edb.com/adnfond/transport/ws/misc/misc_v10"
> 	xmlns:m="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> 	xmlns:edb="http://edb.com/ws/WSCommon_v21">
> 	<wsdl:documentation/>
> 	<wsdl:types>
> 		<schema xmlns="http://www.w3.org/2001/XMLSchema">
> 			<xsd:import namespace="http://edb.com/ws/WSCommon_v21" schemaLocation="../WSCommon_v21.xsd"/>
> 			<xsd:import namespace="http://www.edb.com/adnfond/transport/ws/misc/misc_v10" schemaLocation="Misc_v10.xsd"/>
> 		</schema>
> 	</wsdl:types>
> 	
> 	<wsdl:message name="getSalesOfficeIdReq">
> 		<wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeIdResp">
> 		<wsdl:part name="salesOfficeIdBodyResp" element="misc:getSalesOfficeIdResponse" />
> 	</wsdl:message>
> 	<wsdl:message name="getSalesOfficeId2Req">
> 		<wsdl:part name="salesOfficeId2Header" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeId2BodyReq" element="misc:getSalesOfficeId2Request"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeId2Resp">
> 		<wsdl:part name="salesOfficeId2BodyResp" element="misc:getSalesOfficeId2Response"/>
> 	</wsdl:message>
> 		<!-- 
> 		wsdl2java fails when part names are xsalesOfficeIdBodyReq and xsalesOfficeId2BodyReq
> 		but works fine when part names are  salesOfficeIdBodyReq and salesOfficeId2BodyReq 
>                -->
> 	<wsdl:portType name="MiscPort">
> 		<wsdl:operation name="getSalesOfficeId">
> 			<wsdl:input message="m:getSalesOfficeIdReq"/>
> 			<wsdl:output message="m:getSalesOfficeIdResp"/>
> 		</wsdl:operation>	
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<wsdl:input message="m:getSalesOfficeId2Req"/>
> 			<wsdl:output message="m:getSalesOfficeId2Resp"/>
> 		</wsdl:operation>
> 	</wsdl:portType>
> 	
> 	
> 	
> 	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
> 		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<wsdl:operation name="getSalesOfficeId">
> 			<soap:operation soapAction="getSalesOfficeId" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeIdReq" part="salesOfficeIdHeader" use="literal"/>
> 				<soap:body parts="xsalesOfficeIdBodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeId2Req" part="salesOfficeId2Header" use="literal"/>
> 				<soap:body parts="xsalesOfficeId2BodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 	</wsdl:binding>
> 	
> 	
> 	<wsdl:service name="MiscService">
> 		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
> 			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>
> 		</wsdl:port>
> 	</wsdl:service>
> </wsdl:definitions>
> This is how I use wsdl2java:
>         <target name="generate" depends="prepare" description="generate Java source files from schema and wsdl (only run this if you changed shcema or wsdl)">
>                 <wsdl2java dir="${wsdl.dir}/misc" file="Misc_v10.wsdl" srcdestdir="${generated.dir}" bindingfile="${wsdl.dir}/calendar.xjb.w2j" />
>                 <replaceregexp match="wsdlLocation = .* ," replace="" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>                 <replaceregexp match=", wsdlLocation = .*\)" replace=")" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>         </target>
>         <macrodef name="wsdl2java">
>                 <attribute name="srcdestdir" default="" />
>                 <attribute name="destdir" default="" />
>                 <attribute name="file" />
>                 <attribute name="servicename.arg" default="" />
>                 <attribute name="bindingfile" default="" />
>                 <attribute name="dir" default="" />
>                 <attribute name="wsdlLocation" default="" />
>                 <attribute name="package" default="NOT_SPECIFIED" />
>                 <sequential>
>                         <condition property="package.arg.@{file}" value="-p @{package}">
>                                 <not>
>                                         <equals arg1="@{package}" arg2="NOT_SPECIFIED" />
>                                 </not>
>                         </condition>
>                         <property name="package.arg.@{file}" value="" />
>                         <condition property="binding.arg" value='-b "@{bindingfile}"'>
>                                 <not>
>                                         <equals arg1="@{bindingfile}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="binding.arg" value="" />
>                         <condition property="wsdlLocation.arg" value='-wsdlLocation "@{wsdlLocation}"'>
>                                 <not>
>                                         <equals arg1="@{wsdlLocation}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="wsdlLocation.arg" value="" />
>                         <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
>                                 <classpath>
>                                         <path refid="test.classpath" />
>                                 </classpath>
>                                 <sysproperty key="exitOnFinish" value="true" />
>                                 <arg line="@{servicename.arg}" />
>                                 <arg line="${package.arg.@{file}}" />
>                                 <arg line="${binding.arg}" />
>                                 <arg line="${wsdlLocation.arg}" />
>                                 <arg value="-impl" />
>                                 <arg value="-verbose" />
>                                 <arg value="-validate" />
>                                 <arg value="-catalog" />
>                                 <arg value="@{dir}" />
>                                 <arg value="-d" />
>                                 <arg value="@{srcdestdir}" />
>                                 <arg value="@{dir}/@{file}" />
>                         </java>
>                 </sequential>
>         </macrodef>
> If the specs says that message part names can't be longer than 14 characters then please ignore this issue.
> Version 2.0.4 has this problem too, and other versions too I imagine, but I have only tested on 2.0.4 and 2.1.2.

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


[jira] Resolved: (CXF-1793) WSDL2Java reports Non unique body parts if first part in message are soap headers.

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-1793.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.3
         Assignee: Daniel Kulp

> WSDL2Java reports Non unique body parts if first part in message are soap headers.
> ----------------------------------------------------------------------------------
>
>                 Key: CXF-1793
>                 URL: https://issues.apache.org/jira/browse/CXF-1793
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.2
>         Environment: Windows XP,  Java 1.5
>            Reporter: Dag Framstad
>            Assignee: Daniel Kulp
>             Fix For: 2.1.3
>
>         Attachments: cxf-1793.zip, cxf1793_works.wsdl
>
>
> In my WSDL I have 2 services that have similar names.
> If the first 14 characters in the message part name are identical WSDL2Java reports (from ant):
> generate:
>      [java] Loading FrontEnd jaxws ...
>      [java] Loading DataBinding jaxb ...
>      [java] wsdl2java -b c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/calendar.xjb.w2j -impl -verbose -validate -c
> atalog c:\ADN\adnfond/src/main/resources/com/edb/adnfond/transport/ws/misc -d c:\ADN\adnfond/src/main/generated c:\ADN\adnfond/src/m
> ain/resources/com/edb/adnfond/transport/ws/misc/Misc_v10.wsdl
>      [java] wsdl2java - Apache CXF 2.1.2
>      [java] 
>      [java] 
>      [java] WSDLToJava Error: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSalesPersonId ] have the sam
> e body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java] 
>      [java] org.apache.cxf.tools.common.ToolException: Non unique body parts, operation [ getSalesOfficeId ] and  operation [ getSal
> esPersonId ] have the same body block {http://edb.com/ws/WSCommon_v21}AutHeader
>      [java] 
>      [java] 
>      [java]     at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:128)
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:200
> )
>      [java]     at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:62)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:132)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
>      [java]     at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>      [java]     at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
> Example WSDL:
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions 
> 	targetNamespace="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:misc="http://www.edb.com/adnfond/transport/ws/misc/misc_v10"
> 	xmlns:m="http://www.edb.com/adnfond/transport/ws/misc/"
> 	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> 	xmlns:edb="http://edb.com/ws/WSCommon_v21">
> 	<wsdl:documentation/>
> 	<wsdl:types>
> 		<schema xmlns="http://www.w3.org/2001/XMLSchema">
> 			<xsd:import namespace="http://edb.com/ws/WSCommon_v21" schemaLocation="../WSCommon_v21.xsd"/>
> 			<xsd:import namespace="http://www.edb.com/adnfond/transport/ws/misc/misc_v10" schemaLocation="Misc_v10.xsd"/>
> 		</schema>
> 	</wsdl:types>
> 	
> 	<wsdl:message name="getSalesOfficeIdReq">
> 		<wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeIdResp">
> 		<wsdl:part name="salesOfficeIdBodyResp" element="misc:getSalesOfficeIdResponse" />
> 	</wsdl:message>
> 	<wsdl:message name="getSalesOfficeId2Req">
> 		<wsdl:part name="salesOfficeId2Header" element="edb:AutHeader"/>
> 		<wsdl:part name="xsalesOfficeId2BodyReq" element="misc:getSalesOfficeId2Request"/>
> 	</wsdl:message>
> 	
> 	<wsdl:message name="getSalesOfficeId2Resp">
> 		<wsdl:part name="salesOfficeId2BodyResp" element="misc:getSalesOfficeId2Response"/>
> 	</wsdl:message>
> 		<!-- 
> 		wsdl2java fails when part names are xsalesOfficeIdBodyReq and xsalesOfficeId2BodyReq
> 		but works fine when part names are  salesOfficeIdBodyReq and salesOfficeId2BodyReq 
>                -->
> 	<wsdl:portType name="MiscPort">
> 		<wsdl:operation name="getSalesOfficeId">
> 			<wsdl:input message="m:getSalesOfficeIdReq"/>
> 			<wsdl:output message="m:getSalesOfficeIdResp"/>
> 		</wsdl:operation>	
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<wsdl:input message="m:getSalesOfficeId2Req"/>
> 			<wsdl:output message="m:getSalesOfficeId2Resp"/>
> 		</wsdl:operation>
> 	</wsdl:portType>
> 	
> 	
> 	
> 	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
> 		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<wsdl:operation name="getSalesOfficeId">
> 			<soap:operation soapAction="getSalesOfficeId" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeIdReq" part="salesOfficeIdHeader" use="literal"/>
> 				<soap:body parts="xsalesOfficeIdBodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 		<wsdl:operation name="getSalesOfficeId2">
> 			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
> 			<wsdl:input>
> 				<soap:header message="m:getSalesOfficeId2Req" part="salesOfficeId2Header" use="literal"/>
> 				<soap:body parts="xsalesOfficeId2BodyReq" use="literal"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 	</wsdl:binding>
> 	
> 	
> 	<wsdl:service name="MiscService">
> 		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
> 			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>
> 		</wsdl:port>
> 	</wsdl:service>
> </wsdl:definitions>
> This is how I use wsdl2java:
>         <target name="generate" depends="prepare" description="generate Java source files from schema and wsdl (only run this if you changed shcema or wsdl)">
>                 <wsdl2java dir="${wsdl.dir}/misc" file="Misc_v10.wsdl" srcdestdir="${generated.dir}" bindingfile="${wsdl.dir}/calendar.xjb.w2j" />
>                 <replaceregexp match="wsdlLocation = .* ," replace="" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>                 <replaceregexp match=", wsdlLocation = .*\)" replace=")" byline="true">
>                         <fileset dir="${generated.dir}" includes="**/*.java" />
>                 </replaceregexp>
>         </target>
>         <macrodef name="wsdl2java">
>                 <attribute name="srcdestdir" default="" />
>                 <attribute name="destdir" default="" />
>                 <attribute name="file" />
>                 <attribute name="servicename.arg" default="" />
>                 <attribute name="bindingfile" default="" />
>                 <attribute name="dir" default="" />
>                 <attribute name="wsdlLocation" default="" />
>                 <attribute name="package" default="NOT_SPECIFIED" />
>                 <sequential>
>                         <condition property="package.arg.@{file}" value="-p @{package}">
>                                 <not>
>                                         <equals arg1="@{package}" arg2="NOT_SPECIFIED" />
>                                 </not>
>                         </condition>
>                         <property name="package.arg.@{file}" value="" />
>                         <condition property="binding.arg" value='-b "@{bindingfile}"'>
>                                 <not>
>                                         <equals arg1="@{bindingfile}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="binding.arg" value="" />
>                         <condition property="wsdlLocation.arg" value='-wsdlLocation "@{wsdlLocation}"'>
>                                 <not>
>                                         <equals arg1="@{wsdlLocation}" arg2="" />
>                                 </not>
>                         </condition>
>                         <property name="wsdlLocation.arg" value="" />
>                         <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
>                                 <classpath>
>                                         <path refid="test.classpath" />
>                                 </classpath>
>                                 <sysproperty key="exitOnFinish" value="true" />
>                                 <arg line="@{servicename.arg}" />
>                                 <arg line="${package.arg.@{file}}" />
>                                 <arg line="${binding.arg}" />
>                                 <arg line="${wsdlLocation.arg}" />
>                                 <arg value="-impl" />
>                                 <arg value="-verbose" />
>                                 <arg value="-validate" />
>                                 <arg value="-catalog" />
>                                 <arg value="@{dir}" />
>                                 <arg value="-d" />
>                                 <arg value="@{srcdestdir}" />
>                                 <arg value="@{dir}/@{file}" />
>                         </java>
>                 </sequential>
>         </macrodef>
> If the specs says that message part names can't be longer than 14 characters then please ignore this issue.
> Version 2.0.4 has this problem too, and other versions too I imagine, but I have only tested on 2.0.4 and 2.1.2.

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