0

Is it possible to get XML response parallel with calling webservice method;

For example:

var ws = new WebReference.WService();
String result = ws.HelloWorld();

I need to get XML response from webservice for HelloWorld() function like

<string xmlns="http://tempuri.org/">Hello World</string>

and parallel string result in variable result = "Hello World"

Andrey
  • 497
  • 2
  • 11
  • 25
  • You need to add more detail to improve this question, what is the `result`? is it not XML? As it stands this question does not show research effort, is unclear and not useful. – Jeremy Thompson May 23 '16 at 09:01
  • Probably not. The service will not be running until the webervice completes so the GetResult method will not work. – jdweng May 23 '16 at 09:13

2 Answers2

0

In order to avoid calling the same method twice, you'll need to move to a WCF approach, implementing an IEndpointBehavior behavior to read the raw communication with your webservice endpoint.

An example for such behavior can be found at Generic WCF Host.

Rubens Farias
  • 57,174
  • 8
  • 131
  • 162
0

This is answer https://stackoverflow.com/a/13779722/1179895. But it is necessary to add service reference to project as a service, NOT webservice.

Community
  • 1
  • 1
Andrey
  • 497
  • 2
  • 11
  • 25