亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

像在SoapUI中一樣,如何在php中進行SOAP請求?

像在SoapUI中一樣,如何在php中進行SOAP請求?

PHP
飲歌長嘯 2021-05-04 21:18:00
我是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 回答

  • 2 回答
  • 0 關注
  • 239 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號