NodeJS(HapiJS)parsingXML

我是新的parsing和XML和使用nodejs,我已经尝试node-soapeasysoapstrong-soap ,但我不能让这个图书馆工作

这是我的XML如果我打开浏览器的链接

 <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:myserv" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:myserv"> <types> <xsd:schema targetNamespace="urn:myserv"> <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/> <xsd:complexType name="reqSearch"> <xsd:sequence> <xsd:element name="Username" type="xsd:string" minOccurs="1"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="respSearch">...</xsd:complexType> </xsd:schema> </types> <message name="SearchRequest"> <part name="param" type="tns:reqSearch"/> </message> <message name="SearchResponse"> <part name="return" type="tns:respSearch"/> </message> <portType name="searchPortType"> <operation name="Search"> <documentation>Search Service</documentation> <input message="tns:SearchRequest"/> <output message="tns:SearchResponse"/> </operation> </portType> <binding name="searchBinding" type="tns:searchPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="Search"> <soap:operation soapAction="urn:s-service#Search" style="rpc"/> <input> <soap:body use="encoded" namespace="urn:s-service" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:s-service" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service name="myserv"> <port name="searchPort" binding="tns:searchBinding">...</port> </service> </definitions> 

我到现在为止尝试的是这样的

 var clientParams = { host : 'https://xxxxxxxxxxxxx', path : '/xxxxx/xxxx.php', wsdl : '/xxxxxxx/xxxx.php?wsdl' }; var clientOptions = { secure : false }; var soapClient = easysoap.createClient(clientParams, clientOptions); soapClient.call({ method : "Search", params: { Username: "test", } }) .then((callResponse) => { console.log(callResponse.data); // response data as json console.log(callResponse.body); // response body console.log(callResponse.header); //response header }) .catch((err) => { throw new Error(err); }); 

但没有结果。 我认为我的代码是错误的。 请指导我如何parsingXML并得到respSearch的结果