简体   繁体   中英

Webservice compatibility issue due to name attribute in wsdl

I'm trying to use a third-party java-based webservice from a .net application. The thing is I'm having compatibility issues regarding the given wsdl. When I try to include this wsdl in my VStudio project I'm getting this message:

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

I've read here that they shouldn't use a colon character in the name attribute, because as a NCName type it's only allowed to use a very short set of them. The thing is when I import this wsdl in a Eclipse web project I've no issues at all. Does any of you have any clue about what's happening in Eclipse that doesn't work in VS?

Thanks in advance.

The concerning wsdl code:

<?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>

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM