由于 wsdl 中的名称属性导致的 Web 服务兼容性问题

Webservice compatibility issue due to name attribute in wsdl

我正在尝试从 .net 应用程序中使用基于第三方 java 的网络服务。问题是我遇到了关于给定 wsdl 的兼容性问题。当我尝试将此 wsdl 包含在我的 VStudio 项目中时,我收到此消息:

Warning: 'name' attribute is invalid. The value 'envio:Foo_Envio" is invalid for data type' http://www.w3.org/2001/XMLSchema:NCName '- The':' character, hexadecimal value 0x3A, can not be used in a name . Line 17, position 20

我读过 here 他们不应该在名称属性中使用冒号字符,因为作为 NCName 类型,它只允许使用一个非常短的集合。问题是,当我在 Eclipse Web 项目中导入此 wsdl 时,我完全没有问题。你们中有人知道 Eclipse 中发生的事情在 VS 中不起作用吗?

提前致谢。

相关wsdl代码:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:Foo="transmision" xmlns:envio="envio.xsd" xmlns:recepcion="recepcion.xsd" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="transmision">
  <types>
    <schema elementFormDefault="qualified" xmlns:Foo="transmision" xmlns:envio="transmision" xmlns:FooRecepcion="recepcion.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
      <xsd:import namespace="recepcion.xsd" schemaLocation="recepcion.xsd"/>
      <xsd:import namespace="envio.xsd" schemaLocation="envio.xsd"/>
    </schema>
  </types>
  <message name="Foo_Envio">
    <part name="envio" element="envio:envio"/>
  </message>
  <message name="Foo_Recepcion">
    <part name="recepcion" element="recepcion:confirmacionRecepcion"/>
  </message>
  <portType name="Foo">
    <operation name="Foo">
      <input name="envio:Foo_Envio" message="Foo:Foo_Envio"/>
      <output name="envio:Foo_Recepcion" message="Foo:Foo_Recepcion"/>
    </operation>
  </portType>
  <binding name="FooSoapBinding" type="Foo:Foo">
    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="Foo">
      <input>
        <wsdlsoap:body use="literal"/>
      </input>
      <output>
        <wsdlsoap:body use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="FooService">
    <port name="Foo" binding="Foo:FooSoapBinding">
      <wsdlsoap:address location="https://ws.whatever.com/iniinvoc/es.foo.Foos.ws.EnvioSOAP"/>
    </port>
  </service>
</definitions>

最后我们联系了第三方,他们更改了名称属性,删除了“:”字符。