【问题标题】:How change namespace of Soap ns2 message in %SOAP.Webclient如何在 %SOAP.Webclient 中更改 Soap ns2 消息的命名空间
【发布时间】:2021-03-18 12:12:02
【问题描述】:

我使用 Atelier 的向导创建了一个肥皂客户端连接,它创建了所有消息(请求和响应)和业务操作对象。

此soap 连接将用于连接其他SOAP Web 服务(更改URL),但信封的命名空间会因目的地而异。

我已经对 Soap 类进行了更改,以便为信封添加我的命名空间

Property Namespace As %String
Parameter SETTINGS = "Namespace:Basic";
Method methodFind(idEspecialist As %String(REQUIRED=1), actList As %ListOfObjects(Myapp.ns2.actType") [ Final, ProcedureBlock = 1, SoapBindingStyle = document, SoapBodyUse = literal, WebMethod ]
 {
 Quit ..WebMethod("methodFind").Invoke($this,..Namespace_"/methodFind",.idEspecialist,.actList)
 }

它有效,只是我必须在生产中创建一个新的 BO 项目并为目标设置命名空间。

但是 ns.actType 在定义中有属性命名空间(正如我所说,这个对象是用 Atelire (SOAP) 的向导创建的)并且它用于所有 BO。

/// created from: http://mywsservice.salutic.org/EspecialistWS?wsdl=EspecialistWSSoap.wsdl
Class Myapp.ns2.actoType Extends (%SerialObject, %XML.Adaptor) [ ProcedureBlock ]
{

Parameter ELEMENTQUALIFIED = 1;

Parameter NAMESPACE = "http://mywsservice.salutic.org/";

Parameter XMLNAME = "actType";

Parameter XMLSEQUENCE = 1;

Property ActCode As %String(MAXLEN = "", XMLNAME = "ActCode") [ Required ];

Property description As  %String(MAXLEN = "", XMLNAME = "description") [ Required ];
......
......
}

因此,invokeClient 方法在创建 SOAP Envelope 时,如下所示:

<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:s='http://www.w3.org/2001/XMLSchema'>
  <SOAP-ENV:Body>
    <methodFind xmlns="http://customer.namespace.org/">
        <idEspecialist xsi:type="s:string">TAC</idEspecialist>
        <actList>
            <act xmlns:s01="http://mywsservice.salutic.org/" xsi:type="s01:actoType">
                <ActCode xsi:type="s:string">1032001</ActCode>
                <description xsi:type="s:string">Torax</description>
            </act>
        </actList>
    </methodFind>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

有没有办法以编程方式更改节点的命名空间?

最好的问候, 库罗·洛佩斯

【问题讨论】:

    标签: intersystems-ensemble intersystems-iris


    【解决方案1】:

    我看不到您的代码来提供细节,但是当创建客户端对象时,它应该有一个 %SOAP.SessionHeader 具有 NAMESPACE 属性。它应该附加到 SOAP.WebClient 的 HeadersOut 属性

    这都是凭记忆,所以你需要检查一下。

    【讨论】:

      猜你喜欢
      • 2013-11-18
      • 2011-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多