2012-06-26 59 views
0

我有一个php web服务,我可以从一个php客户端调用。我需要从vb.net应用程序调用此Web服务。当我尝试添加一个引用此Web服务我得到这个错误:WSDL:W3C XML Schema的根元素应该是<schema>

一个W3C XML架构的根元素应该是<schema>

这里是我的WSDL文件的顶部:

<?xml version="1.0"?> 
<!--     partie 1 : Definitions        --> 
<definitions name="raidService" 
      targetNamespace="http://mydomain/webservice/raidService.wsdl" 
      xmlns:typens="urn:eRaid" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
      xmlns="http://schemas.xmlsoap.org/wsdl/"> 
+0

你能粘贴这个WSDL的所有生成的XML吗? –

回答

0

这里是整个wsdl:

<?xml version="1.0"?> 
<!--     partie 1 : Definitions        --> 
<definitions name="eRaid" 
      targetNamespace="eRaid" 
      xmlns:typens="urn:eRaid" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
      xmlns="http://schemas.xmlsoap.org/wsdl/"> 

<!--     partie 2 : Types          --> 
    <types> 
      <xsd:schema  xmlns="http://www.w3.org/2001/XMLSchema" 
        targetNamespace="urn:eRaid"> 
      </xsd:schema> 
    </types> 


<!--     partie 3 : Message         --> 
    <message name="getDbFileHashRequest"> 
     <part name="algo" type="xsd:string"/> 
     <part name="fichier" type="xsd:string"/> 
    </message> 
    <message name="getDbFileHashResponse"> 
      <part name="return" type="xsd:string"/> 
    </message> 

    <message name="sendStatusRequest"> 
      <part name="return" type="xsd:integer"/> 
      <part name="return" type="xsd:integer"/> 
      <part name="return" type="xsd:string"/> 
    </message> 

<!--     partie 4 : Port Type         --> 
    <portType name="eRaidPort"> 
      <!-- partie 5 : Operation --> 
      <operation name="getDbFileHash"> 
        <input message="typens:getDbFileHashRequest"/> 
        <output message="typens:getDbFileHashResponse"/> 
      </operation> 
      <operation name="sendStatus"> 
        <input message="typens:sendStatusRequest"/> 
      </operation> 
    </portType> 

<!--     partie 6 : Binding         --> 
    <binding name="eRaidBinding" type="typens:eRaidPort"> 
      <soap:binding style="rpc"    transport="http://schemas.xmlsoap.org/soap/http"/> 
      <operation name="getDbFileHash"> 
        <soap:operation soapAction="getDbFileHashAction"/> 
        <input name="getDbFileHashRequest"> 
          <soap:body  use="encoded" 
              namespace="urn:eRaid"   
              encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
        </input> 
        <output name="getDbFileHashResponse"> 
          <soap:body  use="encoded" 
              namespace="urn:eRaid" 
               encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
        </output> 
      </operation> 
      <operation name="sendStatus"> 
        <soap:operation soapAction="sendStatusAction"/> 
        <input name="sendStatusRequest"> 
          <soap:body  use="encoded" 
              namespace="urn:eRaid"   
               encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
        </input> 
      </operation> 
    </binding> 

<!--     partie 7 : Service         --> 
    <service name="eRaidService"> 
      <documentation>Retourne une phrase simple </documentation> 
      <!-- partie 8 : Port --> 
      <port name="eRaidPort" binding="typens:eRaidBinding"> 
        <soap:address location="http://localhost/webServiceTest/MyService.php"/> <!-- modifier ce chemin vers server.php --> 
       </port> 
     </service> 
</definitions>