首页 > 解决方案 > 如何将命名空间添加到 SOAP 响应?

问题描述

我的 SOAP 服务器返回以下响应:

   <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://uws.provider.com/">
       <SOAP-ENV:Body>
          <ns1:PerformTransactionResult>
             <status>201</status>
          </ns1:PerformTransactionResult>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

但我需要以下结构:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <ns2:PerformTransactionResult xmlns:ns2="http://uws.provider.com/">
         <status>0</status>
      </ns2:PerformTransactionResult>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope> 

标签: phpsoapserver

解决方案


推荐阅读