POJOCommand usage

View: New views
2 Messages — Rating Filter:   Alert me  

POJOCommand usage

by Niek Palm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
               

ÿþDit bericht is vertrouwelijk en kan geheime informatie bevatten enkel
bestemd voor de geadresseerde. Indien dit bericht niet voor u is bestemd,
verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te
vernietigen.
Aangezien de integriteit van het bericht niet veilig gesteld is middels
verzending via internet, kan Atos Origin niet aansprakelijk worden gehouden
voor de inhoud daarvan.
Hoewel wij ons inspannen een virusvrij netwerk te hanteren, geven
wij geen enkele garantie dat dit bericht virusvrij is, noch aanvaarden wij
enige aansprakelijkheid voor de mogelijke aanwezigheid van een virus in dit
bericht.
 
Op al onze rechtsverhoudingen, aanbiedingen en overeenkomsten waaronder
Atos Origin goederen en/of diensten levert zijn met uitsluiting van alle
andere voorwaarden de Leveringsvoorwaarden van Atos Origin van toepassing.
Deze worden u op aanvraag direct kosteloos toegezonden.
 
This e-mail and the documents attached are confidential and intended solely
for the addressee; it may also be privileged. If you receive this e-mail
in error, please notify the sender immediately and destroy it.
As its integrity cannot be secured on the Internet, the Atos Origin group
liability cannot be triggered for the message content. Although the
sender endeavours to maintain a computer virus-free network, the sender
does not warrant that this transmission is virus-free and will not be
liable for any damages resulting from any virus transmitted.
 
On all offers and agreements under which Atos Origin supplies goods and/or
services of whatever nature, the Terms of Delivery from Atos Origin
exclusively apply.
The Terms of Delivery shall be promptly submitted to you on your request.
 
Atos Origin Nederland B.V. / Utrecht
KvK Utrecht 30132762

Re: POJOCommand usage

by Asankha C. Perera :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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