通过代码注入获取具有服务和方法名称的Web服务URL [英] Getting the Web Service URL with Service and Method Name by Code Injection

查看:71
本文介绍了通过代码注入获取具有服务和方法名称的Web服务URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在SoapHttpClientProtcol中注入我的代码:调用方法并取出"this" SoapHttpClientProtocol类的对象。

I inject my code inside SoapHttpClientProtcol:Invoke method and take the "this" object of the SoapHttpClientProtocol class.


从那里我如何获得带有服务和方法名称的Web服务方法的URL。?

From there how can i get the web service method's URL with Service and method name.?


我注入的代码就像

My injected Code is like

      System.Web.Services.Protocols.SoapHttpClientProtocol sObj = (System.Web.Services.Protocols.SoapHttpClientProtocol)fObj;
      stream.Writeline(sObj.Url);



我只得到文件名localhost的URL:6066 / Service2.asmx

I get only the URL till the file name localhost:6066/Service2.asmx


我需要的网址类似于  localhost:6066 / Service2.asmx:Service2.GetUserDetails  ,
其中  Service2  是
服务名称  GetUserDetails  是
ASP.Net服务中的方法名称。

I need the URL like localhost:6066/Service2.asmx:Service2.GetUserDetails , where Service2 is service name and GetUserDetails is the method name in the ASP.Net service.


如果我注入的代码在里面  System.Web.Services.Protocols.LogicalMethodInfo  
如何获取带有服务和方法名称的URL ..?

And if my injected code is inside System.Web.Services.Protocols.LogicalMethodInfo how to get the URL with service and method name..?

推荐答案

您好Selva VS,

Hi Selva VS,

感谢您的发布。公共语言运行时内部和架构 论坛旨在讨论和提出有关.NET核心问题的问题,包括安全性,性能,托管,基类,互操作性,可靠性,
调试,GC和分析。您的问题更多与ASP.NET Web Service相关。我建议您在ASP.NET Web服务论坛中发布您的问题,以获得专门的帮助。

http://forums.asp.net/28.aspx/1?WCF+ASMX+and+other+Web+Services

Thank you for your post. Common Language Runtime Internals and Architecture forum is aim to discuss and ask questions about issues regarding the very core of .NET, including security, performance, hosting, base classes, interop, reliability, debugging, GC, and profiling. Your question is more related to ASP.NET Web Service. I suggest you posting your question in ASP.NET Web Service forum for dedicated help.
http://forums.asp.net/28.aspx/1?WCF+ASMX+and+other+Web+Services

最好的问候,

Li Wang


这篇关于通过代码注入获取具有服务和方法名称的Web服务URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆