【发布时间】:2011-07-05 03:34:24
【问题描述】:
使用 ASP.NET Web 服务时,它会自动添加 MethodNameResult 和 MethodaNameResponse。
有没有简单的方法不包括它们,我们可以对请求做同样的事情吗?
即,从
中删除<tem:HelloWorld><tem:xml>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:HelloWorld>
<tem:xml>
这是响应示例
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<HelloWorldResponse xmlns="http://tempuri.org/">
<HelloWorldResult>
</HelloWorldResult>
</HelloWorldResponse>
</soap:Body>
</soap:Envelope>
【问题讨论】:
-
它将成为另一个服务的代理服务,所以不需要添加额外的东西,所有这个 servrivce 所做的就是将它接收到的 xml 传递给另一个服务。我的 WS 具有像 Public Xmldocument Hellowork ( XmlDocument xmltext) 这样的方法定义,因此 xmlvalue 上的任何内容都会传递给另一个 ws。所以我的 ws 将被包裹在方法 xml 周围,所以尽量避免使用这些
标签: c# .net asp.net web-services