WithCallback leads to empty response
See original GitHub issueWhen I use .WithBody(@"<soapenv:Envelope
etc. I get a response that is can be handled well by our applications.
However when we use a callback, the response message is empty :
.WithCallback(req =>
{
return CoverApplicationResponseBuilder.CreateResponse(req);
})
public class CoverApplicationResponseBuilder
{
public static ResponseMessage CreateResponse(RequestMessage requestSoapMessage)
{
//get some vars from the requestSoapMessage (excerpt)
XDocument doc = XDocument.Parse(requestSoapMessage.Body);
//now replace some vars in the response (also an excerpt)
var response = new StringBuilder(ResponseMessages.CoverApplicationResponse);
return new ResponseMessage { BodyData = new WireMock.Util.BodyData { BodyAsString = response.ToString() } };
}
}
Leads to:
"Response": {
"StatusCode": 200,
"Headers": {},
"BodyDestination": null,
"Body": null,
"BodyAsJson": null,
"BodyAsBytes": null,
"BodyAsFile": null,
"BodyAsFileIsCached": null,
"BodyOriginal": null,
"BodyEncoding": null,
"DetectedBodyType": 0,
"DetectedBodyTypeFromContentType": 0
},
Am I doing something wrong?
Regards,
Michel
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
nodejs sends empty response before data retrieved from ...
I can confirm that data are correctly loaded from mongodb because data can be printed on nodejs console after nodejs sent the empty...
Read more >How to troubleshoot connectivity when curl gets an *empty ...
So, I understand that an empty response means that curl didn't get any response from the server. No problem, that's precisely what I'm ......
Read more >Empty response after a callback in form_alter - Drupal Answers
I am trying to add a new field in a preexistent form and invoke a callback. The response of the callback is alway...
Read more >JavaScript Callback Functions – What are Callbacks in JS ...
So in this post, I would like to help you to understand what callback functions are and how to use them in JavaScript...
Read more >Network World - Jul 13, 1987 - Page 16 - Google Books Result
No one can use the modem, dial a number, or change option settings unless they ... AD3H — 1200 and 2400 bps stand-alone...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You need to provide
DetectedBodyType = BodyType.String
See https://github.com/WireMock-Net/WireMock.Net/blob/master/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithCallbackTests.cs#L21
OK. Good to hear.
Closing…