提问人:bob alston 提问时间:4/8/2023 更新时间:4/9/2023 访问量:28
如何操作 wcf soap/xml 服务结果的结果
How to manipulate the result of a wcf soap/xml service result
问:
我使用 WCF 生成用于向 soap/xml 服务发送请求的类。我记录了出站消息,它看起来正确。我使用 Fiddler 来检查结果。
我无法弄清楚如何操作/解析返回到我的程序的结果。
WSDL=https://cmbhs.dshs.state.tx.us/cmbhswebservice/Service/DataDownloadService.asmx?wsdl
我的代码 =
enter code here
DataDownloadServiceSoapClient service= new DataDownloadServiceSoapClient();
CMBHSAuthenticationHeader myheader = new CMBHSAuthenticationHeader();
myheader.CMBHSUserName = "xxxxx";
myheader.CMBHSPassword = "yyyyy";
DateTime FromDate = new DateTime(2022, 10, 01);
DateTime ToDate = new DateTime(2022, 10, 03);
var mydata = service.Download(myheader, 449737, FromDate, ToDate, 12, 2);
我查看了 wcf 生成的类,无法弄清楚返回的数据的数据类型。 建议? 鲍勃
答:
0赞
bob alston
4/9/2023
#1
我找到了这个网络帖子。请注意,在一个空格中,“responsexml”一词中有一个拼写错误。
我把它和一个写到文件语句,并以字符串的形式获取了xml数据:
xmlSerializer.Serialize(textWriter, myval);
string responsexml = textWriter.ToString();
File.WriteAllText(@"C:\work\CMBHSoutput.xml",responsexml);
评论