如何根据Request.InputStream判断调用了哪个WS方法?
在 HttpModule 中,我想弄清楚哪个 Web 方法被调用/拦截,并据此采取行动。例如,如果我调用 WebMethod1,则执行某些操作,但对 WebMethod2 不执行任何操作。
如果我查看soap:Header 和soap:Body,我可以看到方法名称,但是解析soap:Envelope 可以吗?如果可以,解析哪一部分?
Within a HttpModule, I'd like to figure out which web method was called/intercepted and act based on that. For example, if I called WebMethod1, do something, yet do nothing for WebMethod2.
If I look at soap:Header and soap:Body, I can see the method name but would it be alright to parse the soap:Envelope and if so, which part?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果这两个方法有一个公共端点,您需要解析 SOAP 消息以确定调用哪个方法。在这种情况下,您需要检查
标记并找到属于 body 标记的第一个元素名称的操作名称。If the two method have a common endpoint you need to parse the SOAP message to determine what method is called. In this case you need to check the
<soap:Body>
tag and find the operation name that is the first element name that belongs to the body tag.这是我解析肥皂消息的代码:
Here's my code that parses the soap message: