![](/img/trans.png)
[英]receiving null value of parameters of web method when calling SOAP Web Service from php
[英]Error when calling dynamics ax soap service method from php
我有一個PHP Webapp,需要連接到Dynamics 365斧頭肥皂服務。
給了我一個wsdl網址,然后我試圖從那里獲取值。
我曾經得到禁止錯誤:608現在我得到HTTP代碼400錯誤的請求
我正在認證,獲取令牌,並將其與POST方法一起傳遞
POST /soap/services/ webservice?wsdl HTTP/1.1
Host: domain.sandbox.ax.dynamics.com
Accept: text/xml
Connection:Keep-Alive
Content-type: text/xml
Authorization: Bearer tokenString
Soapaction: "http://tempuri.org/webservice/method"
Content-Length lengthOfXML
服務器響應:
HTTP/1.1 400 Bad Request Cache-Control: private Server:.. Strict-Transport-Security: max-age..; includeSubDomains Set-Cookie:ASP.NET_sessionId=.....;path=/;secure; HttpOnly Set-Cookie: ms-dyn-csrftoken:........ p3p: CP="No P3P policy defined. Read Microsoft privacy ... LinkID=271135" ..
//my XML that i pass as a curl POSTFIELD
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:i0="http://tempuri.org" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" >
<soap:Header>
<CallContext xmlns="schemas.microsoft.com/.../datacontracts">
<Company>some</Company>
<Language>en-us</Language>
<MessageId>0</MessageId>
<PartitionKey>286942</PartitionKey>
</CallContext>
</soap:Header>
<soap:Body>
<i0:nameofmethod >
<parameter>25536</parameter>
</i0:nameofmethod>
</soap:Body>
</soap:Envelope>
我至少需要獲得某種HTTP 200 OK的值。我應該得到一個字符串數組。
我發現我的Bad請求來自在XML頭中添加字符串。 在其他論壇的一些答案中,我正在搜索,他們建議在XML字符串本身之前添加“ xmlRequest =“字符串,但我忘記了添加,這導致了問題。 我還刪除了帶有UTF代碼的第一行字符串
<?xml version="1.0" encoding="utf-8" ?>
並直接添加肥皂信封。 我使用SOAPUI幫助確保結構正確。
我仍然在調用我的方法時遇到問題,但是實際上有一個不同的錯誤
Forbidden 1317 System.ComponentModel.Win32Exception The specified account does not exist
我希望可以找到解決方法。 使用不同的POST。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.