0

我有一个可以从 php 客户端调用的 php web 服务。我需要从 vb.net 应用程序调用此 Web 服务。当我尝试添加对此 Web 服务的引用时,我收到此错误:

W3C XML Schema 的根元素应该是<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/">
4

1 回答 1

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>
于 2012-06-26T13:38:48.897 回答