【问题标题】:What's wrong with this URL : Impossible to Add a Service Reference此 URL 有什么问题:无法添加服务参考
【发布时间】:2017-07-12 19:04:27
【问题描述】:

有问题的网址:http://ec.europa.eu/taxation_customs/vies/checkVatTestService.wsdl

当我用浏览器点击它时,一切似乎都是正确的,但是当我想在我的项目中添加服务引用时,我收到一条错误消息:

下载时出错 'http://ec.europa.eu/taxation_customs/vies/checkVatTestService.wsdl/$元数据'。 请求失败,HTTP 状态为 404:未找到。元数据包含 无法解析的引用: 'http://ec.europa.eu/taxation_customs/vies/checkVatTestService.wsdl'。 响应消息的内容类型 text/html 与 绑定的内容类型(application/soap+xml;charset=utf-8)。如果 使用自定义编码器,请确保 IsContentTypeSupported 方法 实施得当。响应的前 1024 个字节是: '
本服务的具体免责声明------------------------------------------ 以下是用于接收每种答案的增值税号列表: 100 = 具有有效增值税号的有效请求 200 = 有效 带有无效增值税号 201 的请求 = 错误:INVALID_INPUT 202 = 错误:INVALID_REQUESTER_INFO 300 = 错误:SERVICE_UNAVAILABLE 301 = 错误:MS_UNAVAILABLE 302 = 错误:TIMEOUT 400 = 错误: VAT_BLOCKED 401 = 错误:IP_BLOCKED 500 = 错误:GL'。如果 服务在当前解决方案中定义,尝试构建解决方案 并再次添加服务引用。

这是我从浏览器(或邮递员)收到的信息:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:ec.europa.eu:taxud:vies:services:checkVat" xmlns:tns1="urn:ec.europa.eu:taxud:vies:services:checkVat:types" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:impl="urn:ec.europa.eu:taxud:vies:services:checkVat" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/">
    <xsd:documentation>
     Specific disclaimer for this service ----------------------------------------- 
     Here is the list of VAT Number to use to receive each kind of answer : 
        100 = Valid request with Valid VAT Number
        200 = Valid request with an Invalid VAT Number
        201 = Error : INVALID_INPUT
        202 = Error : INVALID_REQUESTER_INFO
        300 = Error : SERVICE_UNAVAILABLE
        301 = Error : MS_UNAVAILABLE
        302 = Error : TIMEOUT
        400 = Error : VAT_BLOCKED
        401 = Error : IP_BLOCKED
        500 = Error : GLOBAL_MAX_CONCURRENT_REQ
        501 = Error : GLOBAL_MAX_CONCURRENT_REQ_TIME
        600 = Error : MS_MAX_CONCURRENT_REQ
        601 = Error : MS_MAX_CONCURRENT_REQ_TIME

        For all the other cases, The web service will responds with a "SERVICE_UNAVAILABLE" error.
    </xsd:documentation>
    <wsdl:types>
        <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="urn:ec.europa.eu:taxud:vies:services:checkVat:types" xmlns="urn:ec.europa.eu:taxud:vies:services:checkVat:types">
            <xsd:element name="checkVat">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="countryCode" type="xsd:string"/>
                        <xsd:element name="vatNumber" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="checkVatResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="countryCode" type="xsd:string"/>
                        <xsd:element name="vatNumber" type="xsd:string"/>
                        <xsd:element name="requestDate" type="xsd:date"/>
                        <xsd:element name="valid" type="xsd:boolean"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="name" nillable="true" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="address" nillable="true" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="checkVatApprox">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="countryCode" type="xsd:string"/>
                        <xsd:element name="vatNumber" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderName" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderCompanyType" type="tns1:companyTypeCode"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderStreet" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderPostcode" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderCity" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="requesterCountryCode" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="requesterVatNumber" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="checkVatApproxResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="countryCode" type="xsd:string"/>
                        <xsd:element name="vatNumber" type="xsd:string"/>
                        <xsd:element name="requestDate" type="xsd:date"/>
                        <xsd:element name="valid" type="xsd:boolean"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderName" nillable="true" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderCompanyType" nillable="true" type="tns1:companyTypeCode"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderAddress" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderStreet" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderPostcode" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderCity" type="xsd:string"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderNameMatch" type="tns1:matchCode"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderCompanyTypeMatch" type="tns1:matchCode"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderStreetMatch" type="tns1:matchCode"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderPostcodeMatch" type="tns1:matchCode"/>
                        <xsd:element maxOccurs="1" minOccurs="0" name="traderCityMatch" type="tns1:matchCode"/>
                        <xsd:element name="requestIdentifier" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:simpleType name="companyTypeCode">
                <xsd:restriction base="xsd:string">
                    <xsd:pattern value="[A-Z]{2}\-[1-9][0-9]?"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:simpleType name="matchCode">
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="1">
                        <xsd:annotation>
                            <xsd:documentation>VALID</xsd:documentation>
                        </xsd:annotation>
                    </xsd:enumeration>
                    <xsd:enumeration value="2">
                        <xsd:annotation>
                            <xsd:documentation>INVALID</xsd:documentation>
                        </xsd:annotation>
                    </xsd:enumeration>
                    <xsd:enumeration value="3">
                        <xsd:annotation>
                            <xsd:documentation>NOT_PROCESSED</xsd:documentation>
                        </xsd:annotation>
                    </xsd:enumeration>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="checkVatRequest">
        <wsdl:part name="parameters" element="tns1:checkVat">
    </wsdl:part>
    </wsdl:message>
    <wsdl:message name="checkVatApproxResponse">
        <wsdl:part name="parameters" element="tns1:checkVatApproxResponse">
    </wsdl:part>
    </wsdl:message>
    <wsdl:message name="checkVatApproxRequest">
        <wsdl:part name="parameters" element="tns1:checkVatApprox">
    </wsdl:part>
    </wsdl:message>
    <wsdl:message name="checkVatResponse">
        <wsdl:part name="parameters" element="tns1:checkVatResponse">
    </wsdl:part>
    </wsdl:message>
    <wsdl:portType name="checkVatPortType">
        <wsdl:operation name="checkVat">
            <wsdl:input name="checkVatRequest" message="impl:checkVatRequest">
    </wsdl:input>
            <wsdl:output name="checkVatResponse" message="impl:checkVatResponse">
    </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="checkVatApprox">
            <wsdl:input name="checkVatApproxRequest" message="impl:checkVatApproxRequest">
    </wsdl:input>
            <wsdl:output name="checkVatApproxResponse" message="impl:checkVatApproxResponse">
    </wsdl:output>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="checkVatTestBinding" type="impl:checkVatPortType">
        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="checkVat">
            <wsdlsoap:operation soapAction=""/>
            <wsdl:input name="checkVatRequest">
                <wsdlsoap:body use="literal"/>
            </wsdl:input>
            <wsdl:output name="checkVatResponse">
                <wsdlsoap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="checkVatApprox">
            <wsdlsoap:operation soapAction=""/>
            <wsdl:input name="checkVatApproxRequest">
                <wsdlsoap:body use="literal"/>
            </wsdl:input>
            <wsdl:output name="checkVatApproxResponse">
                <wsdlsoap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="checkVatTestService">
        <wsdl:port name="checkVatPort" binding="impl:checkVatTestBinding">
            <wsdlsoap:address location="http://ec.europa.eu/taxation_customs/vies/services/checkVatTestService"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

是网址有问题还是我的 VS 有问题?

谢谢

【问题讨论】:

标签: soap visual-studio-2015 wsdl service-reference


【解决方案1】:

我认为您应该将帖子发送到以下地址: http://ec.europa.eu/taxation_customs/vies/services/checkVatTestService

邮件底部是网址

<wsdlsoap:address location="http://ec.europa.eu/taxation_customs/vies/services/checkVatTestService"/>

【讨论】:

    【解决方案2】:

    问题是服务回复 contentType 'text/html' 这混淆了 VS 服务参考工具。

    改用 wsdl.exe 工具生成代理类。

    【讨论】:

      猜你喜欢
      • 2014-05-22
      • 1970-01-01
      • 2011-04-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多