I'm new to mule and working on a POC. I want to enrich the payload(target.xml) by calling an http endpoint which returns xml as response (source.xml) .
<flow name="mule-configFlow" doc:name="mule-configFlow">
<jms:inbound-endpoint doc:name="JMS" connector-ref="Active_MQ" queue="QUEUE1"/>
<logger message="#[message.payload]" level="INFO" doc:name="Logger"/>
<enricher doc:name="Message Enricher" target="#[xpath:Customer/OfficeId]">
<http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8095" path="myservice/v1/" method="GET" doc:name="HTTP">
<expression-transformer evaluator="xpath" expression="Response/OffId" />
</http:outbound-endpoint>
</enricher>
<jms:outbound-endpoint queue="QUEUE2" connector-ref="Active_MQ" doc:name="JMS"/>
</flow>
I've verified and http endpoint works fine but I'm getting the below error
Expression Evaluator "xpath" with expression "Response/OffId" returned null but a value was required
Am i configuring the source and target expression correctly ?
Incoming Message payload (target.xml):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Customer xmlns="http://www.xyz.com/abc/v1">
<ActionType>ACCOUNT_ADDED</ActionType>
<OfficeId></OfficeId>
<MemberId></MemberId>
</Customer>
Source for enrichment (source.xml):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Response xmlns="http://www.xyz.com/abc/v1">
<OffId></OffId>
<MemId></MemId>
</Response>