Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/334.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#-如何使用ResponseSoapContext下载SOAP附件_C#_Web Services_Soap - Fatal编程技术网

C#-如何使用ResponseSoapContext下载SOAP附件

C#-如何使用ResponseSoapContext下载SOAP附件,c#,web-services,soap,C#,Web Services,Soap,我正在使用来自C#应用程序的Java Web服务。我必须调用一个方法并从SOAP附件读取结果。对我来说,这是第一次使用SOAP附件 我成功地调用了我的方法,但在读取结果时遇到了问题 我理解我必须使用此对象: myWebService.ResponseSoapContext.Attachments[0].Stream 但是我不懂怎么读内容。是base-64编码的吗 Thx已解决 Stream stream = ws.ResponseSoapContext.

我正在使用来自C#应用程序的Java Web服务。我必须调用一个方法并从SOAP附件读取结果。对我来说,这是第一次使用SOAP附件

我成功地调用了我的方法,但在读取结果时遇到了问题

我理解我必须使用此对象:

myWebService.ResponseSoapContext.Attachments[0].Stream
但是我不懂怎么读内容。是base-64编码的吗

Thx已解决

                    Stream stream = ws.ResponseSoapContext.Attachments[0].Stream;    

                //XmlTextReader reader = new XmlTextReader(stream);

                StreamReader sr = new StreamReader(stream);

                wsXmlOutput = sr.ReadToEnd();