marcgg
marcgg

Reputation: 66525

How to call an ASMX web service via GET?

I have a webservice defined here:

/app/AutocompleteManager.asmx

[WebMethod]
public string AutocompleteComposers()
{
  return "hey, what's up";
}

I want to call it using the GET method with extra parameters.

If I just go /app/AutocompleteManager.asmx?q=something, it won't work because I don't have the action specified.

If I go /app/AutocompleteManager.asmx/AutocompleteComposers?q=something it breaks.

Any idea?

Upvotes: 6

Views: 25210

Answers (2)

Flory
Flory

Reputation: 2849

Change your web.config like so:

<system.web>
    ...
    <webServices>
        <protocols>
              <add name="HttpSoap"/> 
              <add name="HttpPost"/>
              <add name="HttpGet"/>
        </protocols>
    </webServices>
</system.web>

Upvotes: 18

Srikar Doddi
Srikar Doddi

Reputation: 15609

Get needs to enabled. Check that first.

Upvotes: -1

Related Questions