omegahat / RCurl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in merge(list(...), .opts) : object 'headerfields' not found

syedfahadalihashmi opened this issue · comments

Hi I am facing an issue with calling a web service from Rcurl
Here is my code i cant ensure what is going wrong
library(RCurl)
library(XML)

headerFields =
c(Accept = "text/xml",
Accept = "multipart/*",
'Content-Type' = "text/xml; charset=utf-8",
SOAPAction = "https://reiv.com.au/CMSWebParts/REIVMarketInsights/Suburbs/GetMedianSalePriceJson")

body = '
<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

abbotsford
Melbourne Metro

</soap:Body>
</soap:Envelope>'

reader = basicTextGatherer()

curlPerform(
url = "https://reiv.com.au/CMSWebParts/REIVMarketInsights/Suburbs/SuburbTrendService.asmx",
httpheader = headerfields,
postfields = body,
writefunction = reader$update
)
As a result of that I get the error
Error in merge(list(...), .opts) : object 'headerfields' not found

This is a simple R error. You mean headerFields - not headerfields.
It is not an RCurl, XML or SOAP error.