如何在没有xmlns名称空间的情况下编写SOAP服务

时间:2017-05-10 14:09:09

标签: xml web-services delphi soap

我正在使用DELPHI XE2并成功发布了SOAP服务。 Client-Request的示例如下所示:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://www.teccom-eu.net/wsdl">
   <soapenv:Header/>
   <soapenv:Body>
      <wsdl:Ping/>
   </soapenv:Body>
</soapenv:Envelope>

这是迄今为止生成的SOAP响应:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
      <PingResponse xmlns="http://www.teccom-eu.net/wsdl">
         <PingResult xmlns="http://www.w3.org/2001/XMLSchema">My PingResult um 10.05.2017 15:39:21</PingResult>
      </PingResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

我想要实现的是没有PingResult的xmlns的SOAP响应,该行应如下所示:

         <PingResult>My PingResult um 10.05.2017 15:39:21</PingResult>

我正在寻找使用一些Register-function的解决方案。 我已经尝试过,但没有成功:

InvRegistry.RegisterParamInfo(TypeInfo(TecOpenMessagingSoap), 'Ping', 'PingResult', 'PingResult', '[Namespace="http://194"]', $FF); //IS_OPTN);

我知道如何手动修改SOAP-Response(一种黑客攻击),但我希望有更优雅的方式,特别是当我要添加更多SoapActions时。 任何帮助将不胜感激。

2017年5月17日新增: 查找有关此注册表过程的更多具体信息以及有关可用参数的更多说明也很有帮助:

InvRegistry.RegisterMethodInfo(TypeInfo(TecOpenMessagingSoap), 'Ping', '', '[ReturnName="PingResponse"]', IS_OPTN);

0 个答案:

没有答案