У меня есть эта служба прокси для агрегирования двух xml-сообщений в один.WSO2 aggregator - xpath cannt traverse
- Я настроил мой класс агрегатор с XPath
- Я не уверен, работает ли мой XPath с пространством имен. Я не мог отслеживать журналы.
Моя конфигурация прокси:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="prescription"
transports="https http jms"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<aggregate>
<completeCondition>
<messageCount min="2" max="2"/>
</completeCondition>
<onComplete expression="//soapenv:Envelope//f:Prescription//f:identifier//f:id//@value">
<send>
<endpoint>
<address uri="jms:/report?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616"/>
</endpoint>
</send>
</onComplete>
</aggregate>
</inSequence>
<outSequence>
<drop/>
</outSequence>
<faultSequence/>
</target>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
</proxy>
Мои входные сообщения выглядит следующим образом: (Я хочу, чтобы агрегировать на основе идентификатора пациента)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://isova.wipro.com/">
<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></soapenv:Envelope>
Любые предложения?
С уважением Гуру @gnanagurus
Я не мог помочь решить эту проблему. Это мой последний прокси WSO2.
Эти два сообщения существуют в очереди «Репрезентация».
Сообщение1:
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://isova.wipro.com/">
<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></soapenv:Envelope></soapenv:Body></soapenv:Envelope>
Сообщение 2:
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://isova.wipro.com/">
<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.John"/>
</prescriber>
<medicine>
<identification>
<text value="tintac"/>
</identification>
</medicine>
</Prescription></soapenv:Envelope></soapenv:Body></soapenv:Envelope>
Proxy:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="prescription"
transports="https http jms"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<aggregate>
<completeCondition>
<messageCount min="2"/>
</completeCondition>
<onComplete expression="/Prescription">
<send>
<endpoint>
<address uri="jms:/report?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616"/>
</endpoint>
</send>
</onComplete>
</aggregate>
</inSequence>
<outSequence>
<drop/>
</outSequence>
<faultSequence/>
</target>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
</proxy>
Это не мое решение агрегации. Эти два сообщения не получают агрегатор. Я пробовал с несколькими xpath с пространствами имен. Anyhelp очень нужен.
Существует ли какой-либо Java-класс WSG2 Aggregator, который я могу использовать вместо агрегирующего агента?
С уважением Гуру
как подсказка, возможно, не слишком много // в выражении xpath, поскольку вы знаете структуру - одного/достаточно. – FiveO