mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
How to connect to wiremock server instance to add mappings? #334
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mcopjan on GitHub (Feb 24, 2021).
Originally assigned to: @StefH on GitHub.
Hi, I am new to WireMock and trying to do some mocking for grpc service using https://github.com/Adven27/grpc-wiremock
I have a wiremock server running on localhost:8888, if I hit http://localhost:8888/__admin/mappings from my browser I can see there are no mappings
I would like to add some mappings now so I am using the following code (first I am trying to fetch existing mappings expecting an empty list)
The above code fails on
csproj details
I tried other methods such as GetSettingsAsync() with the same result.
What I am missing here please?
@StefH commented on GitHub (Feb 24, 2021):
Hello @mcopjan,
I see your confusion.
The issue is that you are running the Java version from WireMock and trying to connect to this running Java instance using the Client Libraries from WireMock.Net (this project).
This will not work because the mappings are not compatible (sorry for that) --> https://github.com/WireMock-Net/WireMock.Net/issues/491.
@mcopjan commented on GitHub (Feb 24, 2021):
hi @StefH, thanks for your quick answer. That's unfortunate. I would expect the client communication with the Java server works no matter what language of client I am using (as long as I meet the API contract of server)
@StefH commented on GitHub (Feb 24, 2021):
The API contract from WireMock Java and this project WireMock.Net is not compatible. (The ideas are the same, but the mappings are different.)
This .NET Client can only be used for this project : WireMock.Net
However, if you want to connect using a C# Client to WireMock Java, you could try to load the Swagger from the Java project (http://wiremock.org/docs/api/) and generate the c# client + models using this project: https://github.com/StefH/RestEase-Client-Generator
@StefH commented on GitHub (Dec 29, 2023):
See also
https://github.com/WireMock-Net/WireMock.Net/discussions/1045