library(RCurl)
headerFields =
c(Accept = "text/xml",
Accept = "multipart/*",
'Content-Type' = "text/xml; charset=utf-8",
SOAPAction = "XYZ")
body = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="XYZ" xmlns:xsd="XYZ"
xmlns:soap="XYZ/soap/envelope/">
<soap:Body>
<clientLogin xmlns="XYZ">
<id>string</id>
</clientLogin>
</soap:Body>
</soap:Envelope>'
curlPerform(url = "XYZ",
httpheader = headerFields,
postfields = body
)
我正在使用上面的代码来获取我在body部分传递的每个ID的数据。我用“4AD,H5F等”ID替换“string”中的字符串
如何创建循环以将ID列表传递到soap请求中,而不必手动输入每个请求的ID。
如何从以下输出获取输出:
curlPerform(url = "XYZ",
httpheader = headerFields,
postfields = body)
并在文件中解析/每次调用新ID时附加它</ p>