Issue posting a call to simple REST service RRS feed

  • 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


    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">
        <TITLE>Bad Request</TITLE>
        <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">
        <h2>Bad Request - Invalid Hostname</h2>
        <p>HTTP Error 400. The request hostname is invalid.</p>


    Friday, September 11, 2020 12:03 AM
  • What is the URL  http://HOSTNAME/path 

    If you browse to it, what do you get?

    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


    • 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
    Friday, September 11, 2020 12:20 AM