6

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?

2 Answers 2

18

Change your web.config like so:

<system.web>
    ...
    <webServices>
        <protocols>
              <add name="HttpSoap"/> 
              <add name="HttpPost"/>
              <add name="HttpGet"/>
        </protocols>
    </webServices>
</system.web>
Sign up to request clarification or add additional context in comments.

3 Comments

Use GET. Isn't that what you're question is about?
it wasn't obvious that I will be able to go /app/AutocompleteManager.asmx/AutocompleteComposers? ... (which for the record is now the URL I have to call)
I don't think that <add name="HttpSoap"/> is necessary. It seems to work just fine for a simple get with out it.
-1

Get needs to enabled. Check that first.

2 Comments

What do you mean? How would I do this?
Please provide an example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.