0
我很新WSO2 ESB我发现以下困难,生成一个XML文档。它工作得很好,但之后,生成此文档,我必须删除标签上的XML属性。如何从WSO2 ESB应用程序生成的标记中删除XML属性?
我有一个生成的XML文档这一序列码:
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="transferSequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<payloadFactory media-type="xml">
<format>
<ds:FindTransfer xmlns:ds="http://ws.wso2.org/dataservice">
<ds:transferId>$1</ds:transferId>
</ds:FindTransfer>
</format>
<args>
<arg evaluator="xml" expression="$ctx:transferId" xmlns:ds="http://ws.wso2.org/dataservice" xmlns:ns="http://org.apache.synapse/xsd"/>
</args>
</payloadFactory>
<header name="Action" scope="default" value="urn:FindTransfer"/>
<callout endpointKey="pgrfasEndpoint">
<source xmlns:ns="http://org.apache.synapse/xsd" xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s12="http://www.w3.org/2003/05/soap-envelope" xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
<target xmlns:ns="http://org.apache.synapse/xsd" xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s12="http://www.w3.org/2003/05/soap-envelope" xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
</callout>
<enrich>
<source clone="true" xmlns:ds="http://ws.wso2.org/dataservice" xmlns:ns="http://org.apache.synapse/xsd" xpath="//ds:transfer"/>
<target type="body"/>
</enrich>
<property name="messageType" scope="axis2" type="STRING" value="application/xml"/>
<property name="HTTP_METHOD" scope="axis2" type="STRING" value="post"/>
<!-- Store message into message store -->
<store messageStore="transferMessageStore"/>
</sequence>
产生这样一个XML文档:
<?xml version="1.0" encoding="UTF-8"?>
<transfer xmlns="http://ws.wso2.org/dataservice" username="my_user" password="my_pswd">
<providerpid>00AB40</providerpid>
<recipientpid>00AD12</recipientpid>
<symbol>SMTA1234</symbol>
<type>SMTA</type>
<materials>
<doi>10.0155/1463</doi>
<doi>10.0155/1464</doi>
</materials>
</transfer>
这是正确的,唯一的问题是,元素设置了该属性xmlns =“http://ws.wso2.org/dataservice”
我绝对需要以最简单的方式删除此属性(例如,使用脚本调解器(使用JavaScript)或其他方法。
我该怎么办?
xslt删除名称空间 – simar
或您的有效负载调解器再次重新创建没有名称空间相同的消息。 – simar
看看这里http://wso2.com/project/data-services/2.6.3/docs/namespace_handling.html。值得尝试为dss server设置空的命名空间 –
simar