You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Niek Palm <ni...@atosorigin.com> on 2009/09/18 11:07:38 UTC

POJOCommand usage

Hi,


I am trying to use a POJOCammand to replace some values in a message.
Unfortunatly I get some XML related errors. 

I use synapse 1.2 and the following configuration.

Sample message:
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
	<SOAP-ENV:Body>
		<ns1:someElement xmlns:ns1="http://www.abc.com>
			<ns1:anotherElement>
				<ns1:reference>123456</ns1:reference>
			</ns1:anotherElement>
		</ns1:someElement>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

POJO mediator:
<pojoCommand name="AdapterCommand">
<property name="referentieNummer"
  expression="//ns1:anotherElement/ns1:reference/."  
  action="UpdateMessage" />
</pojoCommand> 
		
When I send a message I get the following synapse error>

ERROR POJOCommandMediator Unable to set the command property reference
back to the message org.jaxen.UnresolvableException: Cannot resolve
namespace prefix 'ns1'


Do I make mistakes in mij configuration? I hope someone can help me.

Regards, Niek Palm
		

Re: POJOCommand usage

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Niek
> Sample message:
> <?xml version='1.0' encoding='utf-8'?>
> <?xml version='1.0' encoding='utf-8'?>
> <SOAP-ENV:Envelope.....
>   
You have two XML declarations above!

> POJO mediator:
> <pojoCommand name="AdapterCommand">
> <property name="referentieNummer"
>   expression="//ns1:anotherElement/ns1:reference/."  
>   action="UpdateMessage" />
> </pojoCommand> 
>   
Define the "ns1" namespace in the element .. i.e.

<property name="referentieNummer"
  expression="//ns1:anotherElement/ns1:reference/."  action="UpdateMessage" xmlns:ns1="http://some_ns_uri"/>

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com