Asked by:
Issue posting a call to simple REST service

Question
-
I have created a simple Input schema with one element in it say 'FirstName'. Have created an Orch with a Map to replace it with LastName and send in respose back in RequestResponse logical Port.
I have used WCF publishing wizard, used WCF-WebHTTP and checked create ReceiveLocation in the application and followed the wizard which created Receive location.
It created a service in IIS, changed the AppPool settings for this service accordignly.
When I start the Receive Location, IIS app and try to do a POST call from POSTMAN i am receiving following weird error :
HTTP Error 400. The request hostname is invalid.
Not sure what am I doing wrong in crerating this REST service. Please advice
RH
Thursday, September 10, 2020 7:19 PM
All replies
-
What hostname are you using in the URL from POSTMAN? Are you using host headers in IIS?Thursday, September 10, 2020 11:35 PM
-
I am not using any Hostname or anything.
Under Authorization : No Auth
Headers : Content-Type : application/json
Body :
{"Name" : "John"}
Response I get as :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"><HTML><HEAD><TITLE>Bad Request</TITLE><META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD><BODY><h2>Bad Request - Invalid Hostname</h2><hr><p>HTTP Error 400. The request hostname is invalid.</p></BODY></HTML>RH
Friday, September 11, 2020 12:03 AM -
What is the URL http://HOSTNAME/path
If you browse to it, what do you get?
- Edited by Colin Dijkgraaf Friday, September 11, 2020 12:07 AM
Friday, September 11, 2020 12:05 AM -
Uri in POSTMAN is : https://localhost/path/Service1.svc
also tried using servername I am using : https://servername/path/Service1.svc
also tried IP address : https://IPAddress/path/Service1.svc
same error
RH
- Edited by Dan2890 Friday, September 11, 2020 12:15 AM a1
Friday, September 11, 2020 12:14 AM -
Then your IIS is probably set up to use host headers, and localhost is not one of them
- Edited by Colin Dijkgraaf Friday, September 11, 2020 12:21 AM
Friday, September 11, 2020 12:20 AM