[英]Default method for asmx web service
So I have a web service method that lives at: 所以我有一个Web服务方法,它位于:
mysite.com/mywebservice.asmx?op=GetOrders
Is there any way that I can automatically call the GetOrders
method if they just navigate to: 有什么方法可以自动调用
GetOrders
方法(如果它们只是导航至):
mysite.com/mywebservice.asmx
Use urlMappings in Web.Config. 在Web.Config中使用urlMappings 。
Defines a mapping that hides the real URL and maps it to a more user-friendly URL.
定义一个隐藏真实URL的映射,并将其映射到更用户友好的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. 但是我认为这会影响您的其他方法,例如,如果您调用
mysite.com/mywebservice.asmx?op=SomeOtherMethod
这将使您获得GetOrders
,我不确定,但是可以尝试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.