我是php的新手,并且在執行肥皂請求時全都迷路了。我還有另一個問題,如何在javascript中發送SOAP請求,例如在SoapUI中,我剛剛得到了答復,但是我現在決定使用php而不是Node.js。因為我希望我的php代碼做完全相同的事情,所以我將在下面重復我之前的問題:我有這個WSDL網站,我需要從中獲得一些答案。我已經想出了如何在SoapUI中做到這一點,但是我不知道如何在php中做到這一點。我在soapUI中發送的請求如下所示:<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:uni="https://uni-login.dk"> <soap:Header/> <soap:Body> <uni:hentDataAftaler> <uni:wsBrugerid>?</uni:wsBrugerid> <uni:wsPassword>?</uni:wsPassword> </uni:hentDataAftaler> </soap:Body></soap:Envelope>我也有wsdl-link:https : //wsiautor.uni-login.dk/wsiautor-v4/ws?WSDL希望您有一些建議,并告訴我是否需要更多信息來回答我的問題:)我上一個問題的答案如下 const soapRequest = require('easy-soap-request'); const url = 'https://wsiautor.uni-login.dk/wsiautor-v4/ws'; const headers = { 'Content-Type': 'application/soap+xml;charset=UTF-8', 'soapAction': 'https://wsiautor.uni-login.dk/hentDataAftaler',};// example dataconst xml = `<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:uni="https://uni-login.dk"> <soap:Header/> <soap:Body> <uni:hentDataAftaler> <uni:wsBrugerid>?</uni:wsBrugerid> <uni:wsPassword>?</uni:wsPassword> </uni:hentDataAftaler> </soap:Body></soap:Envelope>`;// usage of modulesoapRequest(url, headers, xml).then(({response: {body, statusCode}}) => { console.log(body); console.log(statusCode);}).catch((errorBody) => { console.error(errorBody);});
- 2 回答
- 0 關注
- 239 瀏覽
添加回答
舉報
0/150
提交
取消