Request not reaching Wire Mock

570 views
Skip to first unread message

Frucin Bagam

unread,
Mar 22, 2017, 9:05:58 AM3/22/17
to wiremock-user
 have recorded the requests and responses but when I replay them, only one of the request doesn't seem to reach wiremock hence it is not using the response. Weird thing is that, this works fine in all other machines except for the one that is in cloud. Is there anything specific to firewall that I should check here?

I am starting wiremock standalone with just the basic commands "java -jar wiremock-standalone-2.5.1.jar --port 9111". I have created mappings for all the requests but when I launch the application, wiremock doesn't seem to capture the request for one of the service alone. When I check the application log it is actually posting the request for the respective service. 

Any guidance would be of great help. Thanks!.. 

Tom Akehurst

unread,
Mar 22, 2017, 9:19:36 AM3/22/17
to wiremock-user
As I mentioned in the GH issue, it'd be very useful to see your stubs/code and specific requests in order to diagnose this.

Frucin Bagam

unread,
Mar 22, 2017, 10:00:06 AM3/22/17
to wiremock-user
Request: 
{
  "id" : "1bd95e00-f0e7-3a82-a428-7d61b4579b33",
  "request" : {
    "url" : "/keepalive.html",
    "method" : "GET"
  },
  "response" : {
    "status" : 200,
    "bodyFileName" : "response.xml",
    "headers" : {
      "date" : "Wed, 22 Feb 2017 13:13:24 GMT",
      "Transfer-Encoding" : "chunked",
      "server" : [ "Microsoft-IIS/6.0", "WebSphere Application Server/6.1" ],
      "x-powered-by" : "ASP.NET",
      "content-type" : "text/xml; charset=UTF-8",
      "content-language" : "en-GB"
    }
  },
  "uuid" : "1bd95e00-f0e7-3a82-a428-7d61b4579b33"

Response: 

<?xml version="1.0"?>
<KeepAlive>
</KeepAlive>

I have removed few information like the exact url and the body content of the response xml file as they are restricted info. 

So when I launch the application in my personal machine, wiremock captures the request as below and it matches the response as well;

Request received:
127.0.0.1 - GET /keepalive.html (via browser proxy request)

User-Agent: [Java/1.8.0_101]
Host: [server:port]
Accept: [text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2]
Proxy-Connection: [keep-alive]

But when I do the same from a cloud machine (Azure) it doesn't capture the request at all. As it is not capturing the request it is not using the response.

Tom Akehurst

unread,
Mar 22, 2017, 5:13:41 PM3/22/17
to wiremock-user
So your app running on Azure has WireMock configured as its forward proxy?

You'll need to start WireMock with --enable-browser-proxying for one thing.

Also not sure if you're trying to use HTTPS. If that's the case then you won't be able to use forward/browser proxying as WM can't currently do MITM.

Frucin Bagam

unread,
Mar 23, 2017, 6:31:11 AM3/23/17
to wiremock-user
To answer to your questions, Yes.. Wiremock proxy is set in the app so that the requests will be forwarded via the same.
Also, I tried with --enable-browser-proxying and it doesn't seem to work as well. And it is Http Request. 

I would like to give you some additional information as well, the application is a desktop application and it sends request to the http://keepalive url. The same url can be accessed from the browser as well, and when I do that by setting the browser proxy to point wiremock it does makes use of the stubs. Its just that it is not able to capture the request that is sent from the app. 

Also, to confirm that the app is interacting with the wiremock proxy, it is making use of the other stubs that are placed. 

pranith pola

unread,
Jun 20, 2017, 11:22:28 PM6/20/17
to wiremock-user
Hi,

I am facing an issue in running the standalone jar on cloud foundry!

I am trying to execute cloud foundry command " cf push app-name -p wiremock\wiremock-standalone-2.6.0.jar " . Its working fine in my local. But when i run it on cloud and give https://pcf.com/__admin/ Its giving below response.

{
  "mappings" : [ ],
  "meta" : {
    "total" : 0
  }
}

I assume its not taking or unable to locate mappings and __files folder. Can any one please advise further on how to push and start the wiremock standalone on cloud foundry. Thanks you! 

Aruna Raja

unread,
Sep 2, 2020, 8:32:16 AM9/2/20
to wiremock-user
did you find the solution for this. if so could you please let me know. i am currently facing same issue
Reply all
Reply to author
Forward
0 new messages