Xml Wsdl:命名空间中没有声明这样的元素

Xml Wsdl:命名空间中没有声明这样的元素,xml,wsdl,Xml,Wsdl,我尝试编写自己的wsdl。根据我的代码,我会收到两个错误中的一个。(在分析wsdl时使用:) 代码变体1 使用类型定义消息时 <wsdl:message name="InstituteRequest"> <wsdl:part name="instituteID" type="xs:string"/> </wsdl:message> 我得到一个错误: 无法解析元素引用“xs:string”。命名空间“”中没有声明这样的元素http://www.

我尝试编写自己的wsdl。根据我的代码,我会收到两个错误中的一个。(在分析wsdl时使用:)

代码变体1 使用
类型定义消息时

  <wsdl:message name="InstituteRequest">
    <wsdl:part name="instituteID" type="xs:string"/>
  </wsdl:message>
我得到一个错误:

无法解析元素引用“xs:string”。命名空间“”中没有声明这样的元素http://www.w3.org/2001/XMLSchema“。

我基本上是从现有web服务复制了头文件,所以我想知道为什么名称空间没有定义字符串

全部代码

  <wsdl:message name="InstituteRequest">
    <wsdl:part name="instituteID" element="xs:string"/>
  </wsdl:message>
<?xml version="1.0" encoding="UTF-8"?>

<!-- Definition of the service -->
<!-- http://crunchify.com/basic-wsdl-structure-understanding-wsdl-explained/ -->
<!-- define own namespaces with xmlns:mynamespace (types can be used predefined in the web) -->
<wsdl:definitions  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://localhost:3000/" targetNamespace="http://localhost:3000/">
  <!-- Define own data types -->
<!--   <wsdl:types>
    <xs:schema elementFormDefault="qualified" targetNamespace="http://localhost:3000/">
      <xs:element name="HelloWorld">
        <xs:complexType/>
      </xs:element>
    </xs:schema>
  </wsdl:types> -->

  <!-- Parameters used in the webservice  -->
  <!-- Schmemas for elements: http://www.w3schools.com/schema/schema_simple.asp  -->
  <wsdl:message name="InstituteRequest">
    <wsdl:part name="instituteID" element="xs:string" type="xs:string"/>
  </wsdl:message>

  <wsdl:message name="InstituteResponse">
     <wsdl:part name="institute" element="xs:string" type="xs:string"/>
  </wsdl:message>

  <!-- Port types are combinations of methods (operations) and describe these-->
  <wsdl:portType name="ExampleManagerPort">
    <!-- Operations are the functions of the webservice, they expect in/-outputs -->
    <wsdl:operation name="GetInstitute">
      <wsdl:input message="tns:InstituteRequest"/>
      <wsdl:output message="tns:InstituteResponse"/>
    </wsdl:operation>

  </wsdl:portType>

  <!-- Bindings describe operations -->
  <wsdl:binding name="ExampleManagerBinding" type="tns:ExampleManagerPort">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

    <wsdl:operation name="GetInstitute">
      <soap:operation soapAction="http://localhost:3000#GetInstitute" style="document"/>
        <wsdl:input>
          <soap:body use="literal"/>
        </wsdl:input>
        <wsdl:output>
          <soap:body use="literal"/>
        </wsdl:output>
    </wsdl:operation>

  </wsdl:binding>


  <!-- Service (api?) -->
  <wsdl:service name="ExampleManagerService">
    <!-- ports are endpointsd (respond to request) -->
    <wsdl:port name="ExampleManagerPort" binding="tns:ExampleManagerBinding">
      <soap:address location="http://localhost:3000/"/>
    </wsdl:port>
  </wsdl:service>

</wsdl:definitions>