-1

http://wishisdone.com/IphoneService.svc/echoWithPost Key:S Value: Welcome

Below the error:

service help page

for constructing valid requests to the service. The exception message is 'The incoming message has an unexpected message format 'Raw'. The expected message formats for the operation are 'Xml', 'Json'. This can be because a WebContentTypeMapper has not been configured on the binding. See the documentation of WebContentTypeMapper for more details.'. See server logs for more details. The exception stack trace is:

Raskayu
  • 735
  • 7
  • 20
  • 1
    please use authorisation first as your methods are publicly accessible. – Anupam Singh Aug 02 '16 at 06:51
  • it is authorisation for publicly accessible. please use postman for access this service: http://wishisdone.com/IphoneService.svc/echoWithPost Key:S Value: Welcome – Tripurari Singh Aug 02 '16 at 06:57
  • [have you verified this link](http://stackoverflow.com/questions/26123619/wcf-service-error-incoming-message-has-an-unexpected-message-format-raw-exp) with similar issue – Keppy Aug 02 '16 at 07:09

2 Answers2

0

parameter shold be in json format {"EmployeeId":"601"}.use firefox restclient to check error.

Vaibhav Save
  • 56
  • 2
  • 10
  • i used restclient for this but is is throwing error: The server encountered an error processing the request. Please see the service help page for constructing valid requests to the service. The exception message is 'There was an error checking start element of object of type System.String. Encountered unexpected character 's'.'. See server logs for more details. – Tripurari Singh Aug 02 '16 at 07:10
  • Can you please let me confirm what is the exact error.? – Tripurari Singh Aug 02 '16 at 07:11
  • in restclient you have to add header content-type:application-json. – Vaibhav Save Aug 02 '16 at 07:18
  • run service on local host and add debugger to code to check error using restclient – Vaibhav Save Aug 02 '16 at 07:19
  • your error is pasing error in your code according to me – Vaibhav Save Aug 02 '16 at 07:20
0

This will work.

HTTP POST : http://wishisdone.com/IphoneService.svc/echoWithPost?content=Hello

This returned me status 200 OK. XML returned is

<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
    Post: 
</string>

The reason is that string is a primitive data type and so, even though the HTTP Request a POST it should be appended as a querystring.

naveen
  • 53,448
  • 46
  • 161
  • 251