Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.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
.net WCF webmethod xml字符串问题_.net_Xml_Wcf_Web Services - Fatal编程技术网

.net WCF webmethod xml字符串问题

.net WCF webmethod xml字符串问题,.net,xml,wcf,web-services,.net,Xml,Wcf,Web Services,我有一个WCF web服务,它向基于Java的客户端返回字符串 <OperationContract()> Function SomeSvc(ByVal fileString As String) As String 函数SomeSvc(ByVal fileString As String)作为字符串 fileString是一组xml。当客户端得到响应时,我的xmlstring被编码为文本 <s:Body u:Id="_0"> <SomeSvcRes

我有一个WCF web服务,它向基于Java的客户端返回字符串

<OperationContract()>
Function SomeSvc(ByVal fileString As String) As String

函数SomeSvc(ByVal fileString As String)作为字符串
fileString是一组xml。当客户端得到响应时,我的xmlstring被编码为文本

 <s:Body u:Id="_0">
    <SomeSvcResponse xmlns="http://tempuri.org/">
      <SomeSvcResult>&gt; &lt;/ns2:FailureMessage&gt; &lt;/ns:BOD&gt; &lt;/ns:ConfirmDataArea&gt; &lt;/ns:Confirm&gt;
      </SomeSvcResult>
    </SomeSvcResponse>
  </s:Body>
</s:Envelope>

/ns2:FailureMessage/ns:BOD/ns:ConfirmDataArea/ns:Confirm

为什么我的服务返回的是编码文本而不是xml

服务对您的数据进行编码,因为您将返回值定义为
String
。如果要返回XML,请使用
XElement

服务会对您的数据进行编码,因为您将返回值定义为
String
。如果要返回XML,请使用
XElement

非.net客户端是否能够处理返回的XElement?是,它将以纯XML形式返回,WSDL将消息内容定义为xsd:any。非.net客户端是否能够处理返回的XElement?是,它将以纯XML形式返回,WSDL将定义消息内容为xsd:any。