Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.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
未使用JAVA填充SOAP响应对象_Java_Spring Mvc_Soap_Axis2_Soap Client - Fatal编程技术网

未使用JAVA填充SOAP响应对象

未使用JAVA填充SOAP响应对象,java,spring-mvc,soap,axis2,soap-client,Java,Spring Mvc,Soap,Axis2,Soap Client,我想从下面提到的SOAP响应中读取多引用元素。我试图读取multiRef元素,但无法解析responsecode元素。 请帮助我,因为我是新的肥皂和一些我必须如何完成这项任务 SOAP XML响应 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:x

我想从下面提到的SOAP响应中读取多引用元素。我试图读取multiRef元素,但无法解析responsecode元素。 请帮助我,因为我是新的肥皂和一些我必须如何完成这项任务

SOAP XML响应

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
    <ns1:doBillResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:ns1="urn:ms.model.response">
        <doBillReturn href="#id0"/>
    </ns1:doBillResponse>
    <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:BillResponse"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:ns2="http://model.ef.ms.resonse">
        <var1 xsi:type="soapenc:string">2</var1>
        <var2 xsi:type="soapenc:string">variabletwo</var2>
        <var3 xsi:type="soapenc:string">0025634838021</var3>

        <responseCode href="#id1"/>
    </multiRef>
    
    <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">6
    </multiRef>
</soapenv:Body>
</soapenv:Envelope>

有人知道如何解析multiRef元素responseCode吗?有人知道如何解析multiRef元素responseCode吗?
public static String ExtractResponse(String soapmessage,String var2, String var3) {

    CreateDirectory cd = new CreateDirectory();
    String result="";
    SOAPBody body =null;

    try {
        SOAPMessage respMsg = null;

        InputStream is = new ByteArrayInputStream(soapmessage.getBytes());
        respMsg = MessageFactory.newInstance().createMessage(null, is);
        body = respMsg.getSOAPBody();
        NodeList element1 = body.getElementsByTagName("var1");
        NodeList element2 = body.getElementsByTagName("var2");
        NodeList element3 = body.getElementsByTagName("var3");

        String TransactionNum = element1.item(0).getTextContent();
        String AcctResCode = element2.item(0).getTextContent();
        String ExpDate = element3.item(0).getTextContent();
        result = TransactionNum+"@"+AcctResCode+"@"+ExpDate;
        
    }catch(Exception e){
        e.printStackTrace();
    }
    return result;
}