如题:CXF根据wsdl生成Java代码异常:Property "Any" is already defined. Use <jaxb:property> to resolve this conflict背景是这样的,又一个C#的WebService需要调用,C#是利用WCF开放的服务,java这边通过cxf去调用,生成的wsdl地址是正常的,但是在生成java代码的时候报错了,Property "Any" is already defined. Use <jaxb:property> to resolve this conflict.
苦苦搜索解决办法魏国,不知道各位有没有碰到过类似情况的请赐教下已下是C#服务的配置文件:web.config<?xml version="1.0" encoding="UTF-8"?>
<!--
    注意: 除了手动编辑此文件以外, 
    还可以使用 Web 管理工具来配置应用程序的设置。
    可以使用 Visual Studio 中的“网站”->“Asp.Net 配置”选项。
    设置和注释的完整列表在 
    machine.config.comments 中,该文件通常位于 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
  <!--全国分销商部门ID-->
  <!--<add key="CountryDeptID" value="131|1364|333" />-->
  <appSettings/>
<connectionStrings/>
<system.web>
<!--
            设置 compilation debug="true" ,将调试符号 
            插入已编译的页面中。但由于这会影响性能, 
           因此请只在开发过程中 
            将此值设置为 true。
        -->
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>

<authentication mode="Windows"/>
 
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<system.web.extensions>
<scripting>
<webServices>
<!--
              取消对此节的注释以启用身份验证服务。如果适用,请加入 
              requireSSL="true"。          <authenticationService enabled="true" requireSSL = "true|false"/>
          -->
<!--
              取消对这些行的注释,以启用配置文件服务并选择 
              可在 ASP.NET AJAX  应用程序中检索和修改的
              配置文件属性。          <profileService enabled="true"
                          readAccessProperties="propertyname1,propertyname2"
                          writeAccessProperties="propertyname1,propertyname2" />
          -->
<!--
              取消对此节的注释,以启用角色服务。          <roleService enabled="true"/>
          -->
</webServices>
<!--
        <scriptResourceHandler enableCompression="true" enableCaching="true" />
        -->
</scripting>
</system.web.extensions>

<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
    <directoryBrowse enabled="true"/>
</system.webServer>
<system.serviceModel>
<services>
<service name="Better517Na.OfficeSystemProcess.Service.OfficeSystemProcessService" behaviorConfiguration="OfficeSystemProcessServiceBehavior">
<host>
<baseAddresses>
</baseAddresses>
</host>
<!-- Service Endpoints -->
        <!--<endpoint address="" binding="netTcpBinding" contract="Better517Na.OfficeSystemProcess.Contract.IOfficeSystemProcessService" bindingConfiguration="OfficeSystemProcessServiceTcpBinding"></endpoint> -->        <!-- <endpoint address="" binding="wsHttpBinding" contract="Better517Na.OfficeSystemProcess.Contract.IOfficeSystemProcessService" ></endpoint> -->        <endpoint address ="" binding="basicHttpBinding"
                   bindingConfiguration="wolegequ" contract="Better517Na.OfficeSystemProcess.Contract.IOfficeSystemProcessService">
        </endpoint>
        
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="OfficeSystemProcessServiceBehavior">
 
<serviceDebug includeExceptionDetailInFaults="True"/>
          <serviceThrottling maxConcurrentCalls ="1000" maxConcurrentInstances ="1000" maxConcurrentSessions ="1000" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="OfficeSystemProcessServiceTcpBinding" openTimeout="00:03:00" closeTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00" maxBufferPoolSize="655350" maxReceivedMessageSize="1073741824" maxConnections="500" listenBacklog="1000">
<security mode="None">
<message clientCredentialType="None"/>
</security>
<readerQuotas maxArrayLength="1073741824" maxStringContentLength="1073741824"/>
</binding>
</netTcpBinding>      <basicHttpBinding>
        <binding name="wolegequ">
        <security mode="None" />
        <!-- 获取或设置可由使用此绑定配置的终结点处理的 SOAP 消息的复杂性约束【下面几个值都是 int 值】-->
        <!-- maxArrayLength:获取并设置允许的最大数组长度,默认值为 16384。
                              【注意:此属性值应用于消息处理过程的每个步骤。包括可以扩展消息或消息部分大小的一些步骤。特别是,加密可能会大大增加消息的大小】 -->
        <!-- maxBytesPerRead:获取并设置允许每次读取返回的最大字节数,默认值为 4096。
                              【注意:此配额与该传输级别在网络上接收的字节数密切相关,但其目的是控制每次读取时可以接收的数据量】 -->
        <!-- maxDepth:获取并设置最大嵌套节点深度,最大嵌套节点深度,默认值为 32。此配额设置 XML 的嵌套节点深度限制。
                              【注意:不太重要,一般来说常用的 XML 深度不大可能达到32层】 -->
        <!-- maxNameTableCharCount:获取并设置表名称中允许的最大字符数,表名称中允许的最大字符数,默认值为 16384。
                              【注意:暂时没用】 -->
        <!-- maxStringContentLength:获取并设置读取器返回的最大字符串长度,读取器返回的最大字符串长度,默认值为 8192。
                              【注意:这个根据实际需要配置下,因为默认长度 8192 对于稍大的对象序列化后的长度很可能不够用】 -->
        <readerQuotas maxArrayLength="1073741824" maxStringContentLength="1073741824" />
        </binding>
        <!-- <binding name="wotama">
          <security mode = "None"/>
        </binding> -->
      </basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>

解决方案 »

  1.   

    上wsdl  错误信息文本贴出来
      

  2.   

    不咋会在回复里面上传附件,请移步:http://blog.csdn.net/u011740064/article/details/79316301
      

  3.   

    没有账号 下载不了 wsdl是xml,按html贴出来就是了
      

  4.   

    用浏览器访问服务地址+?wsdl  就是发布服务的wsdl。一个webservice的wsdl是一个xml文件
      

  5.   

    是的,是一个xml文件,但是这个目标文件太大了,太占篇幅了,所以才出此下策这是一个百度云盘的链接,如果您有空,麻烦看看呢:https://pan.baidu.com/s/1i6I9Hpb
      

  6.   

    看到文件了,太大了,你怎么得到xml的?试过用浏览器从发布的服务获得吗?你的import有import 本地文件,这个应该是工具生成的,如果是发布的,import也会是服务点。
    你的处理流程是怎样的