Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R中的SOAP请求_R_Soap_Rcurl_Httr - Fatal编程技术网

R中的SOAP请求

R中的SOAP请求,r,soap,rcurl,httr,R,Soap,Rcurl,Httr,有人知道如何用R来表达下面的SOAP请求吗 POST /API/v201010/AdvertiserService.asmx HTTP/1.1 Host: advertising.criteo.com Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "https://advertising.criteo.com/API/v201010/clientLogin" <?xml version="

有人知道如何用R来表达下面的SOAP请求吗

POST /API/v201010/AdvertiserService.asmx HTTP/1.1
Host: advertising.criteo.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://advertising.criteo.com/API/v201010/clientLogin"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <clientLogin xmlns="https://advertising.criteo.com/API/v201010">
      <username>string</username>
      <password>string</password>
      <source>string</source>
    </clientLogin>
  </soap:Body>
</soap:Envelope>
POST/API/v201010/AdvertiserService.asmx HTTP/1.1
主持人:advisting.criteo.com
内容类型:text/xml;字符集=utf-8
内容长度:长度
SOAPAction:“https://advertising.criteo.com/API/v201010/clientLogin"
一串
一串
一串

这解决了问题:

library(RCurl)

headerFields =
  c(Accept = "text/xml",
    Accept = "multipart/*",
    'Content-Type' = "text/xml; charset=utf-8",
    SOAPAction = "https://advertising.criteo.com/API/v201010/clientLogin")

body = '<?xml version="1.0" encoding="utf-8"?>
  <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
  <clientLogin xmlns="https://advertising.criteo.com/API/v201010">
  <username>string</username>
  <password>string</password>
  <source>string</source>
  </clientLogin>
  </soap:Body>
  </soap:Envelope>'

curlPerform(url = "https://advertising.criteo.com/API/v201010/AdvertiserService.asmx",
                          httpheader = headerFields,
                          postfields = body
                          )
库(RCurl)
人头场=
c(Accept=“text/xml”,
Accept=“multipart/*”,
“内容类型”=“文本/xml;字符集=utf-8”,
SOAPAction=”https://advertising.criteo.com/API/v201010/clientLogin")
身体
一串
一串
一串
'
执行(url=”https://advertising.criteo.com/API/v201010/AdvertiserService.asmx",
httpheader=头字段,
postfields=body
)

您目前的努力取得了什么成果?谢谢@Thomas。我找到了解决办法。太好了。请记住,通过单击答案左侧的复选框将您的答案标记为已接受,以便其他人可以看到您的问题已得到解决。如果您需要包含SSL证书和密码,这会是什么样子?