2

所以我有一个 Web 服务方法,它位于:

mysite.com/mywebservice.asmx?op=GetOrders

GetOrders如果他们只是导航到,有什么方法可以自动调用该方法:

mysite.com/mywebservice.asmx

4

1 回答 1

1

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.

于 2013-10-15T16:22:58.187 回答