no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


linux_faq:curl_soap [2020/12/11 18:18] (current) – created admin
Line 1: Line 1:
 +http://yapro.ru/article/6517
  
 +====== Как выполнить Soap-запрос с помощью curl ======
 +Нужно сформировать сам запрос в виде **xml**, затем - выполнить запрос, указав в заголовках необходимые поля. \\
 +
 +  curl -u login:password --header "Content-Type: text/xml;charset=UTF-8" --header "SOAPAction:sky:GetServiceLis" --data @request.txt http://host/erp/ws/skynet
 +Тут:
 +  * **-u login:password** - это данные для авторизации на сервере, к которому мы обращаемся
 +  * **--header "Content-Type: text/xml;charset=UTF-8"** - устанавливаем тип содержимого запроса
 +  * **--header "SOAPAction:sky:GetServiceLis"** - задаем неймспейс **sky** (URN - Uniform Resource Name) и имя метода **GetServiceLis**
 +А в файле **request.txt** будет что-то такое:
 +<code>
 +    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:sky="mytest-erp/skynet" xmlns:glob="mytest-erp/Global">
 +       <soap:Header/>
 +       <soap:Body>
 +          <sky:GetServiceLis>
 +             <sky:parameters>
 +                <glob:OnlyChanged>false</glob:OnlyChanged>
 +                <!--Optional:-->
 +                <glob:MaximumObjectsInResult>100</glob:MaximumObjectsInResult>
 +             </sky:parameters>
 +          </sky:GetServiceLis>
 +       </soap:Body>
 +    </soap:Envelope>
 +</code>
  • linux_faq/curl_soap.txt
  • Last modified: 2020/12/11 18:18
  • by admin