Using wiremock as a soap server

735 views
Skip to first unread message

Felipe Boso

unread,
Dec 29, 2021, 3:15:54 PM12/29/21
to wiremock-user
I'm configuring wiremock standalone to emulate my third party soap service calls.
My project is a java spring app and consume soap webserver using BindingProvider like this:

public LogisticaReversaWS getWSService(final Tenant tenant) {
final var service = new LogisticaReversaService();
final var port = service.getLogisticaReversaWSPort();
final var binding = (BindingProvider) port;
final var contract = correiosProperties.getContractProperties(tenant);
binding.getRequestContext().put(ENDPOINT_ADDRESS_PROPERTY, correiosProperties.getUri());
binding.getRequestContext().put(CONNECT_TIMEOUT, correiosProperties.getConnectTimeout());
binding.getRequestContext().put(REQUEST_TIMEOUT, correiosProperties.getReadTimeout());
binding.getRequestContext().put(USERNAME_PROPERTY, contract.getIdentification());
binding.getRequestContext().put(PASSWORD_PROPERTY, contract.getPassword());
return port;
}

I set the ENDPOINT_ADDRESS_PROPERTY in application.properties of my application, generally is a wsdl path.

I tryed to config wiremock to be called by my app but always return error 404.

The server sent HTTP status code 404: Not Found\n\tat com.sun.xml.ws.transport.http.client.HttpTransportPipe.checkStatusCode(HttpTransportPipe.java:332)\n\tat com.sun.xml.ws.transport.http.client.HttpTransportPipe

Is there a way to config a wiremock url in java project to simulate my webserver? 
FYI: i'm not tryng to do integration or unit tests, just call in a stage or local app calls.

I set the following urls


but always return the 404 error.

The mocked service sample :

Screenshot from 2021-12-29 17-10-21.png





Reply all
Reply to author
Forward
0 new messages