捕获XML响应 [英] Capture XML Response

查看:70
本文介绍了捕获XML响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个C#Windows服务,它调用远程Web服务上的方法

,并希望捕获Web服务返回的XML。我需要原始XML的原因是备份到我保存到

数据库的数据子集。


我发现的所有帖子似乎都假设一个人可以访问客户端

和服务器应用程序,但由于Web服务是远程的,我只能

控制客户端。


我们将非常感谢您学习如何实现这一目标的任何帮助。


谢谢,

Tom

I am writing a C# Windows service that calls methods on a remote web service
and would like to capture the XML returned by the web service. The reason I
need the raw XML is for back up to the sub-set of data I am saving to a
database.

All the posts I have found seem to assume one has access to both the client
and server applications but since the web service is remote, I can only
control the client side.

Any help in learning how to accomplish this will be greatly appreciated.

Thanks,
Tom

推荐答案

向Web服务器发送常规HTTP POST请求,该服务器将调用

相应的Web服务,并且将返回的XML作为流读取。


您是否拥有Web服务的URL?如果是,请尝试在

Web浏览器中键入该URL。它将显示HTTP请求的正确格式,因此您可以使用它来获得它。


" Tom Bean" < tb *** @ newsgroup.nospamwrote in message

news:up ************** @ TK2MSFTNGP04.phx.gbl ...
Send a regular HTTP POST request to the web server that will call the
appropriate web service, and read the returned XML as a stream.

Do you have the URL of the web service? If yes, try to type that URL in your
web browser. It will display the proper format of the HTTP request, so you
can use it.

"Tom Bean" <tb***@newsgroup.nospamwrote in message
news:up**************@TK2MSFTNGP04.phx.gbl...

>我正在编写一个C#Windows服务,它调用远程Web服务上的方法,并希望捕获Web服务返回的XML。我需要原始XML的原因是备份到我保存到数据库的数据子集。


我有的所有帖子发现似乎假设有人可以访问

客户端和服务器应用程序,但由于Web服务是远程的,我可以

只控制客户端。


非常感谢学习如何实现这一目标的任何帮助。


谢谢,

Tom

>I am writing a C# Windows service that calls methods on a remote web
service and would like to capture the XML returned by the web service. The
reason I need the raw XML is for back up to the sub-set of data I am saving
to a database.

All the posts I have found seem to assume one has access to both the
client and server applications but since the web service is remote, I can
only control the client side.

Any help in learning how to accomplish this will be greatly appreciated.

Thanks,
Tom



Ashot,


我使用从WSDL文件创建的WebReference对象调用方法,

没有使用HTTP POST。每次调用Web服务都需要收取费用,所以我不能通过两种方式来获取数据和XML。


Tom


" Ashot Geodakov" < a _ ******** @ hotmail.comwrote in message

news:uY ************** @ TK2MSFTNGP06.phx.gbl .. 。
Ashot,

I call the methods using a WebReference object, created from a WSDL file,
not with HTTP POST. There is a charge for each call to the web service so I
can''t afford to make the call both ways to get the data and the XML.

Tom

"Ashot Geodakov" <a_********@hotmail.comwrote in message
news:uY**************@TK2MSFTNGP06.phx.gbl...

向Web服务器发送常规HTTP POST请求,该服务器将调用

相应的Web服务,并将返回的XML作为流。


您是否拥有Web服务的URL?如果是,请尝试在您的网络浏览器中输入

中的该URL。它将显示HTTP请求的正确格式,

以便您可以使用它。


Tom Bean < tb *** @ newsgroup.nospamwrote in message

news:up ************** @ TK2MSFTNGP04.phx.gbl ...
Send a regular HTTP POST request to the web server that will call the
appropriate web service, and read the returned XML as a stream.

Do you have the URL of the web service? If yes, try to type that URL in
your web browser. It will display the proper format of the HTTP request,
so you can use it.

"Tom Bean" <tb***@newsgroup.nospamwrote in message
news:up**************@TK2MSFTNGP04.phx.gbl...

>>我正在编写一个C#Windows服务,该服务调用远程Web服务上的方法,并希望捕获Web服务返回的XML。我需要原始XML的原因是备份到我保存到数据库的数据子集。

我找到的所有帖子似乎都假设有一个访问
客户端和服务器应用程序,但由于Web服务是远程的,我只能控制客户端。

任何学习如何完成此任务的帮助将是非常感谢。

谢谢,
Tom

>>I am writing a C# Windows service that calls methods on a remote web
service and would like to capture the XML returned by the web service.
The reason I need the raw XML is for back up to the sub-set of data I am
saving to a database.

All the posts I have found seem to assume one has access to both the
client and server applications but since the web service is remote, I can
only control the client side.

Any help in learning how to accomplish this will be greatly appreciated.

Thanks,
Tom




查看MSDN文档:

ms-help://MS.MSSDK.1033/MS.NETFX30SDK.1033/cpref26/html/T_System_Web_Services_Protocols_SoapExtension.htm


显示在客户端si上使用SoapExtension de(你的Windows服务)

在客户端和服务之间写出传出和传入的XML。


Ron


汤姆比恩 < tb *** @ newsgroup.nospamwrote in message

news:up ************** @ TK2MSFTNGP04.phx.gbl ...
Check out the MSDN docs:
ms-help://MS.MSSDK.1033/MS.NETFX30SDK.1033/cpref26/html/T_System_Web_Services_Protocols_SoapExtension.htm

Shows using a SoapExtension on the client side (your windows service) to
write outgoing and incoming XML between client and service.

Ron

"Tom Bean" <tb***@newsgroup.nospamwrote in message
news:up**************@TK2MSFTNGP04.phx.gbl...

>我正在编写一个C#Windows服务,它调用远程Web服务上的方法,并希望捕获Web服务返回的XML。我需要原始XML的原因是备份到我保存到数据库的数据子集。


我有的所有帖子发现似乎假设有人可以访问

客户端和服务器应用程序,但由于Web服务是远程的,我可以

只控制客户端。


非常感谢学习如何实现这一目标的任何帮助。


谢谢,

Tom

>I am writing a C# Windows service that calls methods on a remote web
service and would like to capture the XML returned by the web service. The
reason I need the raw XML is for back up to the sub-set of data I am saving
to a database.

All the posts I have found seem to assume one has access to both the
client and server applications but since the web service is remote, I can
only control the client side.

Any help in learning how to accomplish this will be greatly appreciated.

Thanks,
Tom



这篇关于捕获XML响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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