Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Web services 用于检索元素的XPATH_Web Services_Xslt_Soap_Xpath - Fatal编程技术网

Web services 用于检索元素的XPATH

Web services 用于检索元素的XPATH,web-services,xslt,soap,xpath,Web Services,Xslt,Soap,Xpath,我有这个wsdl <definitions targetNamespace="http://testwork/" name="HelloWorldService" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" x

我有这个wsdl

<definitions targetNamespace="http://testwork/" name="HelloWorldService"
             xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
             xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
             xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:tns="http://testwork/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <types>
        <xsd:schema>
            <xsd:import namespace="http://soapServlet/" schemaLocation="http://localhost:8085/testwork/soapServlet?xsd=1"/>
        </xsd:schema>
    </types>
    <message name="sayHelloWorldFrom">
        <part name="parameters" element="tns:sayHelloWorldFrom"/>
    </message>
    <message name="sayHelloWorldFromResponse">
        <part name="parameters" element="tns:sayHelloWorldFromResponse"/>
    </message>
    <message name="additionalFault">
        <wsdl:part name="error" element="tns:responseFault"/>
    </message>
    <portType name="HelloWorld">
        <operation name="sayHelloWorldFrom">
            <input wsam:Action="http://testwork/HelloWorld/sayHelloWorldFromRequest" message="tns:sayHelloWorldFrom"/>
            <output wsam:Action="http://testwork/HelloWorld/sayHelloWorldFromResponse" message="tns:sayHelloWorldFromResponse"/>
            <wsdl:fault name="error" message="additionalFault"/>
        </operation>
    </portType>
    <binding name="HelloWorldPortBinding" type="tns:HelloWorld">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <operation name="sayHelloWorldFrom">
            <soap:operation soapAction=""/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="error">
                <soap:fault name="error" use="literal"/>
            </fault>
        </operation>
    </binding>
    <service name="HelloWorldService">
        <port name="HelloWorldPort" binding="tns:HelloWorldPortBinding">
            <soap:address location="http://localhost:8085/testwork/soapServlet"/>
        </port>
    </service>
</definitions>

但由于某种原因,元素==null,但我通过调试看到funcName实际上是sayHelloWorldFrom。因此,问题出在哪里?

我不知道为什么,但当我删除此部分时:

xmlns="http://schemas.xmlsoap.org/wsdl/"
xpath之所以有效,可能是因为xmlns对xml或xpath意味着什么

definitions/portType/operation[@name='sayHelloWorldFrom']

您可以在这里查看它

谢谢,但是如果我删除这一行,我的wsdl将变得无效,那么,在不删除这一行的情况下,我能做些什么来让这个XPath工作呢?也许你可以改成xmlns:wsdl,因为我不擅长,正如我在这里发现的那样,你可以把它改成某个名称。我刚才注意到你有相同的名称空间:xmlns=xmlns:wsdl=
definitions/portType/operation[@name='sayHelloWorldFrom']