cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag Framstad (JIRA)" <>
Subject [jira] Created: (CXF-1793) WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical
Date Thu, 11 Sep 2008 13:05:45 GMT
WSDL2Java reports Non unique body parts if the first 14 characters of message parts are identical

                 Key: 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

     [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
     [java] wsdl2java - Apache CXF 2.1.2
     [java] WSDLToJava Error: Non unique body parts, operation [ getSalesOfficeId ] and  operation
[ getSalesPersonId ] have the sam
e body block {}AutHeader
     [java] Non unique body parts, operation [
getSalesOfficeId ] and  operation [ getSal
esPersonId ] have the same body block {}AutHeader
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at

Example WSDL:
<?xml version="1.0" encoding="utf-8"?>
		<schema xmlns="">
			<xsd:import namespace="" schemaLocation="../WSCommon_v21.xsd"/>
			<xsd:import namespace="" schemaLocation="Misc_v10.xsd"/>
	<wsdl:message name="getSalesOfficeIdReq">
		<wsdl:part name="salesOfficeIdHeader" element="edb:AutHeader"/>
		<wsdl:part name="xsalesOfficeIdBodyReq" element="misc:getSalesOfficeIdRequest"/>
	<wsdl:message name="getSalesOfficeIdResp">
		<wsdl:part name="salesOfficeIdBodyResp" element="misc:getSalesOfficeIdResponse" />

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

		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 name="getSalesOfficeId2">
			<wsdl:input message="m:getSalesOfficeId2Req"/>
			<wsdl:output message="m:getSalesOfficeId2Resp"/>
	<wsdl:binding name="MiscSoapBinding" type="m:MiscPort">
		<soap:binding style="document" transport=""/>
		<wsdl:operation name="getSalesOfficeId">
			<soap:operation soapAction="getSalesOfficeId" style="document"/>
				<soap:header message="m:getSalesOfficeIdReq" part="salesOfficeIdHeader" use="literal"/>
				<soap:body parts="xsalesOfficeIdBodyReq" use="literal"/>
				<soap:body use="literal"/>
		<wsdl:operation name="getSalesOfficeId2">
			<soap:operation soapAction="getSalesOfficeId2" style="document"/>
				<soap:header message="m:getSalesOfficeId2Req" part="salesOfficeId2Header" use="literal"/>
				<soap:body parts="xsalesOfficeId2BodyReq" use="literal"/>
				<soap:body use="literal"/>
	<wsdl:service name="MiscService">
		<wsdl:port name="MiscSoapPort" binding="m:MiscSoapBinding">
			<soap:address location="http://localhost:8080/adnfond/services/MiscService"/>

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 match=", wsdlLocation = .*\)" replace=")" byline="true">
                        <fileset dir="${generated.dir}" includes="**/*.java" />

        <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" />
                        <condition property="package.arg.@{file}" value="-p @{package}">
                                        <equals arg1="@{package}" arg2="NOT_SPECIFIED"
                        <property name="package.arg.@{file}" value="" />
                        <condition property="binding.arg" value='-b "@{bindingfile}"'>
                                        <equals arg1="@{bindingfile}" arg2="" />
                        <property name="binding.arg" value="" />
                        <condition property="wsdlLocation.arg" value='-wsdlLocation "@{wsdlLocation}"'>
                                        <equals arg1="@{wsdlLocation}" arg2="" />
                        <property name="wsdlLocation.arg" value="" />
                        <java failonerror="true" classname=""
                                        <path refid="test.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}" />

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.

View raw message