如何在SOAP请求中包含带有的XML标记
我有一个简单的SOAP请求,如下所示如何在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
<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]]>