Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.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
如何在SOAP请求中包含带有的XML标记_Xml_Soapui - Fatal编程技术网

如何在SOAP请求中包含带有的XML标记

如何在SOAP请求中包含带有的XML标记,xml,soapui,Xml,Soapui,我有一个简单的SOAP请求,如下所示 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.bayer.com/" xmlns:chim="http://scivantage.com/tata"> <soapenv:Header/> <soapenv:Body> <ser:strat

我有一个简单的SOAP请求,如下所示

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.bayer.com/" xmlns:chim="http://scivantage.com/tata">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:strategy>
         <request>
            <xmlMessage>?</xmlMessage>
          </request>
      </ser:strategy>
   </soapenv:Body>
</soapenv:Envelope>

?
在上面的简单SOAP请求中 在xmlMessage标记中,我需要包含以下XML数据

<accountid>384</accountid>
<userid>testuser</userid>
384
测试用户
请告诉我如何将这两个标记包含在问号中???

您可以使用CDATA(未解析文本的地方)并在客户端上重新解析xmlMessage。见:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.bayer.com/" xmlns:chim="http://scivantage.com/tata">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:strategy>
         <request>
            <xmlMessage><![CDATA[<accountid>384</accountid><userid>testuser</userid>]]>/xmlMessage>
          </request>
      </ser:strategy>
   </soapenv:Body>
</soapenv:Envelope>

384测试用户]]>/xmlMessage>

在CData中,它只接受一个xml元素,例如38400016]]>,当我尝试包含这两个标记时,它不工作。请尝试以下操作:384]]>testuser]]>