I’ve struggled a bit trying to connect my corona app to a Webservice written in C#.
I keep getting “The server cannot service the request because the media type is unsupported.”
This happens when I switch access from “GET” to “POST” in the network.request call.
Obvious the error is from the IIS that I’m communicating with but after a few hours of digging this
fault can apparently also be due to faulty header parameters. I’ve checked the configuration file on
the iis to accept HTTPPost, and HTTPGet.
First I thought the error was due to the fact that the WS was using complex objects as parameter
input but after throwing together a simple “helloworld” I still get the same issue. Anyone got experience
with issues like this?
I basically do:
header[“Content-Type”] = “application/x-www-form-urlencoded”
(tried with other content-type such as text/xml etc - same result)
params.header = header
params.body = [[
]]
network.request( “http://127.0.0.1:1234/WebserviceTest/Service1.asmx?op=HelloWorld”, “POST”, networkListener, params)
Also, I’ve tried this from SoapUI and it works flawlessly from that application. It uses POST in that
call with no issues at all. Since the webservice is not mine I can’t change it internally so I’m rather
stuck atm. Any ideas would be most appriciated.
Thank you for your time
//Anders
[import]uid: 134273 topic_id: 29561 reply_id: 329561[/import]