我的 wso2 代理服务中有一个自定义中介,它将传入的 xml 转换为另一种格式,然后它被代理转发到 jms 队列。但是 xml 格式不正确。在控制台和队列中显示如下:
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Envelope xmlns:ws="http://isova.wipro.com/">
<arg0><Prescription xmlns="http://hl7.org/fhir">
<identifier>
<id value="A0001"/>
</identifier>
<status value="active"/>
<patient>
<type value="Patient"/>
<url value="Bhavani"/>
</patient>
<prescriber>
<type value="Provider"/>
<url value="Dr.Mathews"/>
</prescriber>
<medicine>
<identification>
<text value="Zintac"/>
</identification>
</medicine>
</Prescription></arg0>
</soapenv:Envelope>
</soapenv:Body>
</soapenv:Envelope>
我的代理服务:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="risresult"
transports="https,http,jms" statistics="disable" trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="ContentType" value="text/plain" scope="default"
type="STRING" />
<class name="com.test.guru.HL7RISPrescription" />
<property name="RESPONSE" value="true" />
<header name="To" action="remove" />
<send>
<endpoint>
<address
uri="jms:/prescription?
transport.jms.ConnectionFactoryJNDIName
=QueueConnectionFactory&java.naming.
factory.initial=org.apache.activemq.jndi.
ActiveMQInitialContextFactory&java.
naming.provider.url=tcp://localhost:61616" />
</endpoint>
</send>
</inSequence>
<outSequence>
<drop />
</outSequence>
<faultSequence />
</target>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
<description></description>
</proxy>
这可能是什么原因?问题是因为axis2元素吗?
我的调解员班有这些最后的陈述:
OMFactory factoryOM = OMAbstractFactory.getOMFactory();
OMElement code = factoryOM.createOMElement("arg0","","");
code.setText(pdoc.toString());
axis2Element.addChild(code);