WSDL:W3C XML Schema的根元素应该是<schema> </schema>

时间:2012-06-26 12:49:29

标签: php vb.net wsdl

我有一个php web服务,我可以从php客户端调用。我需要从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/">

1 个答案:

答案 0 :(得分: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>