Problem with hhtp post to schema based webservices
I would like to make a http post for update a contact database via schema based web services using JSON and did the following:
The content is :
<cfset content2 = '{"estateServiceUpdateContactRequest":{"__type":"EstateServiceUpdateContactRequest:Whoman.Estate","ClientID":"#attributes.clientWSkey#","Address1":"Stationstraat","Address2":"","AgreementMail":0,"AgreementSms":0,"Box":"","City":"Tervuren","Comments":"Test contact created from own website","ContactOriginID":"190","ContactTitleID":1016,"ContactTypeIDList":[7194,7195],"CountryID":1,"FirstName":"Hugo","LanguageID":"nl-BE","Message":"This is the message for the test contact created from own website","Name":"Claestest","Number":"10","OfficeID":993,"PrivateEmail":"dttfghsf@scarlet.be","PrivateTel":"+32 (0)456/23.45.24","SearchCriteria":{"__type":"EstateServiceUpdateContactRequestSearchCriteria:Whoman.Estate","CategoryIdList":[1,2],"PriceRange":[10,1000000],"PurposeIdList":[1,2],"PurposeStatusIdList":[1,2],"RegionIDList":[1822,1823],"SubCategoryIdList":[2,1]},"Zip":"1200"}}'>
<cfparam name="WSURL" default="http://193.74.68.130/websiteservices/EstateService.svc/">
<cfhttp url = "#WSURL#UpdateContact" method="post" throwonerror="Yes" charset="UTF-16">
<cfhttpparam type="XML" name="BODY" value="#content2#">
</cfhttp>
It looks like the request gets on the server but I get a “bad request” return (the logs of the IIS also returns a Coldfusion 400 0 0 error).
Using the code
<cfhttp url = "#WSURL#UpdateContact" method="post" throwonerror="Yes" charset="UTF-16">
<cfhttpparam type="BODY" value="#content2#">
</cfhttp>
gives a Coldfusion server error.
