class Iti4142RouteBuilder extends SpringRouteBuilder { void configure() { errorHandler(noErrorHandler()) from('xds-iti41:xds-iti41') .to('iti41Processor') .transform { new Response(Status.SUCCESS) } }}
public class CustomProcessorIti41 implements Processor{ ProducerTemplate producer; public void setProducer(ProducerTemplate producer) { this.producer = producer; }
private Map<String, String> endpoints;
public Map<String, String> getEndpoints(){ return endpoints; }
public void setEndpoints() Map<String, String> endpoints){ this.endpoints = endpoints; }
@Override public void process(Exchange exchange) throws Exception {
String docSourceId = documentSourceId(exchange);
String targetEndpoint = endpoints.get(docSourceOid);
producer.send(targetEndpoint, exchange); }
private String documentSourceId(Exchange exchange) { ProvideAndRegisterDocumentSet pnr = exchange.getIn().getBody(ProvideAndRegisterDocumentSet.class); return pnr.getSubmissionSet().getSourceId(); }
}
--
You received this message because you are subscribed to the Google Groups "ipf-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ipf-user+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
<camel:to ref="iti41Processor"/>
--
<camel:camelContext id="camelContext">
<camel:dataFormats>
<camel:jaxb id="ebxmlJaxb" contextPath="org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30"/>
</camel:dataFormats>
</camel:camelContext>
<routeContext id="myRoutes" xmlns="http://camel.apache.org/schema/spring">
<camel:route id="fileConsumerIti41">
<camel:from uri="file:/usr/local/drop/?moveFailed=/usr/local/drop/.error"/>
<marshal ref="ebxmlJaxb"/>
<camel:process ref="iti41Processor"/>
</camel:route>
</camel:routeContext>
13:59:57.615 [Camel (camelContext) thread #0 - file:///usr/local/drop/] WARN n.s.i.i.a.InteropAuditingEventNotifier - The exchange contained a failure notification: org.apache.camel.TypeConversionException: Error during type conversion from type: byte[] to the required type: org.openehealth.ipf.commons.ihe.xds.core.requests.ProvideAndRegisterDocumentSet with value [B@272977e8 due null
Caused by: com.sun.istack.SAXParseException2; lineNumber: 1; columnNumber: 1; unexpected element (uri:"urn:ihe:iti:xds-b:2007", local:"ProvideAndRegisterDocumentSetRequest"). Expected elements are <{http://www.openehealth.org/ipf/xds}association>,<{http://www.openehealth.org/ipf/xds}document>,<{http://www.openehealth.org/ipf/xds}documentEntry>,<{http://www.openehealth.org/ipf/xds}folder>,<{http://www.openehealth.org/ipf/xds}provideAndRegisterDocumentSet>,<{http://www.openehealth.org/ipf/xds}submissionSet>
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:740).........
Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"urn:ihe:iti:xds-b:2007", local:"ProvideAndRegisterDocumentSetRequest"). Expected elements are <{http://www.openehealth.org/ipf/xds}association>,<{http://www.openehealth.org/ipf/xds}document>,<{http://www.openehealth.org/ipf/xds}documentEntry>,<{http://www.openehealth.org/ipf/xds}folder>,<{http://www.openehealth.org/ipf/xds}provideAndRegisterDocumentSet>,<{http://www.openehealth.org/ipf/xds}submissionSet>
What am I doing wrong?
Thanks.
Miguel.
<camel:jaxb id="ebxmlJaxb" contextPath="org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.ProvideAndRegisterDocumentSetRequestType.class"/>
--
test.InteropIntegrationTest: org.apache.camel.RuntimeCamelException: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.ProvideAndRegisterDocumentSetRequestType.class" doesnt contain ObjectFactory.class or jaxb.index
- with linked exception:
[javax.xml.bind.JAXBException: "org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.ProvideAndRegisterDocumentSetRequestType.class" doesnt contain ObjectFactory.class or jaxb.index]
JAXBContext contextPnR = JAXBContext.newInstance(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.ProvideAndRegisterDocumentSetRequestType.class);
Unmarshaller unmarshallerPnR = contextPnR.createUnmarshaller();
Object unmarshalledPnR = unmarshallerPnR.unmarshal(inputPnR.getInputStream());
And that works fine.
Any other ideas?
<camel:camelContext id="camelContext">
<camel:dataFormats>
<camel:jaxb id="ebxmlJaxb" contextPath="org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30"/>
</camel:dataFormats>
</camel:camelContext>
<routeContext id="myRoutes" xmlns="http://camel.apache.org/schema/spring">
<camel:route id="fileConsumerIti41">
<camel:from uri="file:/usr/local/drop/?moveFailed=/usr/local/drop/.error"/>
<unmarshal ref="ebxmlJaxb"/>
<camel:process ref="iti41Processor"/>
</camel:route>
</camel:routeContext>