0

I am not expert of Internet communication protocols. Normally I develop some WebServices in c#, for my needs. My functions are developed with the [WebMethod] keyword and return numbers, for example two coordinates. To call the WebService, for example with a browser, I write:

https://www.mysite.xx/MyWebService.asmx/MyWebMethod?Request=..Parameters ...

And I get an answer like:

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">-102866,667000005;-92718,2779999226</string>

Till to day, calling the WebService with programs, I process the above answer, to get what I need, i.e. just the two numbers. I would like to know whether it is possible to simply get an answer with the two numbers only, without the other stuff.

rene
  • 41,474
  • 78
  • 114
  • 152
gpol
  • 39
  • 6
  • 1
    You might try this answer: https://stackoverflow.com/a/18684392 if you want to keep the asmx stuff. – rene Dec 04 '22 at 07:03
  • Thanks. It resolved. As a matter of fact, my WebMethods were declared with return type (for example). Then they just returned their resulting numbers Instead I declared them as "void" and simply used Context.Response.Write(.... numbers ..). Really trivial. Thanks again – gpol Dec 04 '22 at 10:15

0 Answers0