Steven
Steven

Reputation: 18859

Default method for asmx web service

So I have a web service method that lives at:

mysite.com/mywebservice.asmx?op=GetOrders

Is there any way that I can automatically call the GetOrders method if they just navigate to:

mysite.com/mywebservice.asmx

Upvotes: 2

Views: 2330

Answers (1)

Habib
Habib

Reputation: 223247

Use urlMappings in Web.Config.

Defines a mapping that hides the real URL and maps it to a more user-friendly URL.

<urlMappings enabled="true">
  <clear />
  <add url="mysite.com/mywebservice.asmx" mappedUrl="mysite.com/mywebservice.asmx?op=GetOrders" />
</urlMappings>

But I think this will effect your other methods, like if you call a mysite.com/mywebservice.asmx?op=SomeOtherMethod this would take you GetOrders, I am not sure about it, but you can try.

Upvotes: 1

Related Questions