Navision 웹 서비스에 명령을 보내려고합니다. 최대한 전체 연결을 이해하려면 처음에는 간단한 cURL 명령을 사용하고 싶습니다.Navision SOAP 서비스에 명령 보내기
나는 URL https://IP:PORT/.../Codeunit/Webservices
에 간단한 GET Requests를 실험했다. 거기에는 모든 명령을 가진 매우 긴 XML 구조가 있습니다. 목록의 일부는 간단한 echo 명령으로 문자열을 보내고 되돌릴 수 있습니다.
<schema elementFormDefault="qualified" targetNamespace="urn:microsoft-dynamics-schemas/codeunit/Webservices" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="SoundCheck">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="p_Text" type="string"/>
</sequence>
</complexType>
</element>
<element name="SoundCheck_Result">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="return_value" type="string"/>
</sequence>
</complexType>
</element>
...
지금 내 문제는 내가 명령을 보내는 방법을 모르겠입니다 :
이
그것의 discription입니다. 나는이 두 가지 특별한 SOAP 라이브러리에서 보았다 : 는
- https://github.com/jamesiarmes/php-ntlm
- https://github.com/rileydutton/Exchange-Web-Services-for-PHP 나는 그들의 approches을 시도했지만 아무것도 작동하지 않습니다.
$headers = [ 'Method: GET', 'Connection: Keep-Alive', 'User-Agent: PHP-SOAP-CURL', 'Content-Type: text/xml; charset=utf-8', 'SOAPAction: "' . $action . '"', ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, $username . ':' . $password); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $response = curl_exec($ch); return $response;
내가
$action
의 다양한 값을 보내려고하지만 난 항상이 오류를 얻을 : 내 코드는 이제 다음과 같습니다
어쩌면 내가 내 비전과 전체 SOAP 과정을 오해을뿐만 아니라, I 웹에서 정말 좋은 자습서를 찾지 못했습니다. 내가 도대체 뭘 잘못하고있는 겁니까? 도와 주셔서 감사합니다!<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault> <faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:System.ArgumentNullParametername: input</faultstring> <detail><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Der Wert darf nicht NULL sein.\nParametername: input</string></detail> </s:Fault></s:Body></s:Envelope>