question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WithCallback leads to empty response

See original GitHub issue

When 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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
StefHcommented, Oct 15, 2019
1reaction
StefHcommented, Oct 16, 2019

OK. Good to hear.

Closing…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found