Hi,
I am trying to make a post request to a WCF service which saves the data. Unfortunately I am getting a 405 - Method Not Allowed error. I was able to execute a get request successfully so the network settings are OK. If I post the request from fiddler it works. Here is the code:
returnedState = cellularRadio.SendATCommand("AT+SAPBR=3,1,\"CONTYPE\",\"GPRS\"");
returnedState = cellularRadio.SendATCommand("AT+SAPBR=3,1,\"APN\",\"******\"");
returnedState = cellularRadio.SendATCommand("AT+SAPBR=3,1,\"USER\",\"******\"");
returnedState = cellularRadio.SendATCommand("AT+SAPBR=3,1,\"PWD\",\"******\"");
returnedState = cellularRadio.SendATCommand("AT+SAPBR=1,1");
returnedState = cellularRadio.SendATCommand("AT+HTTPINIT");
returnedState = cellularRadio.SendATCommand("AT+HTTPPARA=\"CID\",1");
//returnedState = cellularRadio.SendATCommand("AT+HTTPPARA=\"URL\",\"http://www.google.com\"");
returnedState = cellularRadio.SendATCommand("AT+HTTPPARA=\"URL\",\"http://******:8080\"");
string requestString = "POST /TestService.svc HTTP/1.1\r\n";
requestString += "Content-Type: text/xml; charset=utf-8\r\n";
requestString += "SOAPAction: \"http://tempuri.org/ITestService/TestMethod\"\r\n";
requestString += "Host: ******:8080\r\n";
//requestString += "Content-Length: 194\r\n";
requestString += "Expect: 100-continue\r\n";
requestString += "Accept-Encoding: gzip, deflate\r\n";
requestString += "Connection: Keep-Alive\r\n";
requestString += "\r\n";
requestString += "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><TestMethod xmlns=\"http://tempuri.org/\"><parameters>Test from GHI module.</parameters></TestMethod></s:Body></s:Envelope>\r\n";
returnedState = cellularRadio.SendATCommand("AT+HTTPDATA=" + requestString.Length + ",3000");
returnedState = cellularRadio.SendATCommand(requestString);
returnedState = cellularRadio.SendATCommand("AT+HTTPACTION=1");
returnedState = cellularRadio.SendATCommand("AT+HTTPREAD");
returnedState = cellularRadio.SendATCommand("AT+HTTPTERM");
Any help will be greately appreciated.
Thanks