未声明WSDL错误类型

时间:2016-04-15 09:32:57

标签: c# xml web-services soap wsdl

我需要这个wsdl的帮助。我从我试图与之联系的机构得到了这个。我需要更正文件,以便我可以正确使用它...

我收到此错误: "输入' http://object.dl.ws.dummyhost.org2:DriverLicenceDetails'没有宣布"

问题在于wsdl文件中的这一行。



<element name="getDriversLicenceIReturn" nillable="true" type="tns1:DriverLicenceDetails" />
&#13;
&#13;
&#13;

出于安全原因,我使用了一个虚构的主机名。

wsdl文件是

&#13;
&#13;
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://dl.ws.dummyhost.org2" xmlns:impl="http://dl.ws.dummyhost.org2" xmlns:intf="http://dl.ws.dummyhost.org2" xmlns:tns1="http://object.dl.ws.dummyhost.org2" xmlns:tns2="http://exceptions.ws.dummyhost.org2" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <wsdl:types>
    <schema targetNamespace="http://dl.ws.dummyhost.org2" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://object.dl.ws.dummyhost.org2"/>
      <element name="getDriversLicenceIResponse">
        <complexType>
          <sequence>
            <element name="getDriversLicenceIReturn" nillable="true" type="tns1:DriverLicenceDetails" />
          </sequence>
        </complexType>
      </element>
      <element name="getDriversLicenceI">
        <complexType>
          <sequence>
            <element name="driversLicenceNo" nillable="true" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
    </schema>
    <schema targetNamespace="http://object.dl.ws.dummyhost.org2" xmlns="http://www.w3.org/2001/XMLSchema" >      
      <complexType name="DriverLicenceDetails">
        <sequence>
          <element name="driversLicenceNo" nillable="true" type="xsd:string"/>
          <element name="controlNo" nillable="true" type="xsd:string"/>
          <element name="issueDate" nillable="true" type="xsd:string"/>
          <element name="expiryDate" nillable="true" type="xsd:string"/>
          <element name="dlClassCode" nillable="true" type="xsd:string"/>
          <element name="dlClassDesc" nillable="true" type="xsd:string"/>
          <element name="vehicleLicencedToDrive" nillable="true" type="xsd:string"/>
          <element name="trnNo" nillable="true" type="xsd:string"/>
          <element name="lastName" nillable="true" type="xsd:string"/>
          <element name="firstName" nillable="true" type="xsd:string"/>
          <element name="middleName" nillable="true" type="xsd:string"/>
          <element name="nationality" nillable="true" type="xsd:string"/>
          <element name="address" nillable="true" type="tns1:Address"/>
          <element name="placeOfBirth" nillable="true" type="xsd:string"/>
          <element name="dateOfBirth" nillable="true" type="xsd:string"/>
          <element name="parishOfBirth" nillable="true" type="xsd:string"/>
          <element name="gender" nillable="true" type="xsd:string"/>
          <element name="collectorateIssued" nillable="true" type="xsd:string"/>
          <element name="collectorateFirstIssued" nillable="true" type="xsd:string"/>
          <element name="dateFirstIssued" nillable="true" type="xsd:string"/>
          <element name="licenceStatus" nillable="true" type="xsd:string"/>
          <element name="photograph" type="xsd:base64Binary"/>
        </sequence>
      </complexType>
      <complexType name="Address">
        <sequence>
          <element name="mark" nillable="true" type="xsd:string"/>
          <element name="streetNumber" nillable="true" type="xsd:string"/>
          <element name="streetName" nillable="true" type="xsd:string"/>
          <element name="poBoxNumber" nillable="true" type="xsd:string"/>
          <element name="poLocation" nillable="true" type="xsd:string"/>
          <element name="areaCityTown" nillable="true" type="xsd:string"/>
          <element name="parish" nillable="true" type="xsd:string"/>
        </sequence>
      </complexType>
    </schema>
    <schema targetNamespace="http://exceptions.ws.dummyhost.org2" xmlns="http://www.w3.org/2001/XMLSchema">
      <complexType name="FslWebServiceException">
        <sequence>
          <element name="errorCode" nillable="true" type="xsd:string"/>
          <element name="errorDescription" nillable="true" type="xsd:string"/>
          <element name="variables" nillable="true" type="tns2:ArrayOf_873062395_nillable_string"/>
        </sequence>
      </complexType>
      <complexType name="ArrayOf_873062395_nillable_string">
        <sequence>
          <element maxOccurs="unbounded" minOccurs="0" name="string" nillable="true" type="xsd:string"/>
        </sequence>
      </complexType>
      <element name="FslWebServiceException" nillable="true" type="tns2:FslWebServiceException"/>
    </schema>
  </wsdl:types>
  <wsdl:message name="getDriversLicenceIRequest">
    <wsdl:part element="impl:getDriversLicenceI" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="FslWebServiceException">
    <wsdl:part element="tns2:FslWebServiceException" name="fault">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="getDriversLicenceIResponse">
    <wsdl:part element="impl:getDriversLicenceIResponse" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="FslDriversLicence">
    <wsdl:operation name="getDriversLicenceI">
      <wsdl:input message="impl:getDriversLicenceIRequest" name="getDriversLicenceIRequest">
      </wsdl:input>
      <wsdl:output message="impl:getDriversLicenceIResponse" name="getDriversLicenceIResponse">
      </wsdl:output>
      <wsdl:fault message="impl:FslWebServiceException" name="FslWebServiceException">
      </wsdl:fault>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="FslDriversLicenceSoapBinding" type="impl:FslDriversLicence">
    <wsaw:UsingAddressing wsdl:required="false" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getDriversLicenceI">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="getDriversLicenceIRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="getDriversLicenceIResponse">
        <wsdlsoap:body use="literal"/>
      </wsdl:output>
      <wsdl:fault name="FslWebServiceException">
        <wsdlsoap:fault name="FslWebServiceException" use="literal"/>
      </wsdl:fault>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="FslDriversLicenceService">
    <wsdl:port binding="impl:FslDriversLicenceSoapBinding" name="FslDriversLicence">
      <wsdlsoap:address location="https://wse_qa.dummyhost.org2/wsg/service/client/trn"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions> 
&#13;
&#13;
&#13;

感谢您的专家帮助..谢谢。

2 个答案:

答案 0 :(得分:0)

tns1名称空间似乎没有在你的wsdl中声明,因此无法找到该元素。

答案 1 :(得分:0)

检查在线解析器,wsdl文件似乎没问题。问题似乎与Visual Studio有关。我正在使用Visual Studio 2015社区。