1

My REST SOAPUI mockservices are getting failed because of preflight OPTIONS requests. I had created a GET mock service /getAllStudents in SOAPUI. When I tried to invoke it from apache server, OPTIONS getAllStudents is called by browser and it is getting failed with 404 error. Is there any way to solve this issue?

JPS
  • 2,730
  • 5
  • 32
  • 54

1 Answers1

1

This sounds like an issue that needs to be resolved server side. For your incoming OPTIONS requests your server will need to answer with the allowed methods, as well as allowed origins using following headers:

Access-Control-Allow-Origin: http://foo.example
Access-Control-Allow-Methods: POST, GET, OPTIONS
Erik Svedin
  • 1,286
  • 12
  • 26
  • It may not be a `Access-Control-Allow-Origin` issue. Because if everything else is correct then it should have provided a `200 ok`. I commented based on [this](http://stackoverflow.com/questions/35045971/soap-response-firefox-vs-soapui-same-machine) question , I asked. I maybe wrong. – user1207289 Feb 10 '16 at 21:38
  • How to do it in SOAP UI – Kartikeya Sharma Nov 17 '16 at 08:25
  • 1
    @KartikeyaSharma in the MockResponse editor there is a green plus sign with the tooltip "Adds a custom HTTP header to this message", as header you put the first part (before the colon, without it) and as value you put the second part (after the colon, without spaces), additionally you can put asterisk instead the url to allow requests from any part. – William Ardila May 22 '17 at 21:16