Harm Verhagen wrote: > Hi, > > I'm using a vfs proxy to process xml files. > Vfs has the nice feature that on an error, the files are moved to an > error location. > > Depending on the result of a callout mediator I want to decide whether > the vfs should fault or not. How can I make a sequence fault ? > I tried the fault and drop mediators, but they don't seem to do the job. > > I hande the callout response in a <switch> and want to let the > <default> clause case an error, so that the vfs knows it has to move > the file to the error folder. > > Any Ideas ? Fault mediator make the message in hand s fault message, it doesn't trigger a fault to the transport. You can try writing a custom mediator and throwing a SynapseException at the mediate method. I am afraid there is no way that you can fault a sequence in the standard configuration, not sure whether that is good or not after looking at your requirement. :-)
Thanks, Ruwan > > > synapse.xml snippets: > > > <syn:callout > serviceURL="http://localhost:8080/UM/services/userManagement"> > <syn:source xmlns:ns2="http://org.apache.synapse/xsd" > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" > xmlns:ns="http://org.apache.synapse/xsd" > xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" > xpath="s11:Body/foo"/> > <syn:target xmlns:ns2="http://org.apache.synapse/xsd" > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" > xmlns:ns="http://org.apache.synapse/xsd" > xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" > xpath="s11:Body/:fooResponse"/> > </syn:callout> > > > <syn:switch xmlns:ns2="http://org.apache.synapse/xsd" > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" > xmlns:ns="http://org.apache.synapse/xsd" > source="//foo/return/resultCode"> > <syn:case regex="0"/> > <!-- OK --> > <syn:case regex="-502"/> > <!-- some other OK --> > <syn:default> > <syn:log level="custom"> > <syn:property name="description" value="ERROR: > Invalid response from foo, Faulting"/> > <syn:property name="resultCode" > expression="//nsi:foo/return/resultCode"/> > </syn:log> > <!-- here i want the sequence to fault --> > <syn:drop/> > > </syn:default> > </syn:switch> > > Any ideas ? > > Regards, > Harm > ------------------------------------------------------------------------ > > _______________________________________________ > Esb-java-user mailing list > [email protected] > https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user > -- Ruwan Linton Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb WSO2 Inc.; http://wso2.org email: [email protected]; cell: +94 77 341 3097 blog: http://blog.ruwan.org _______________________________________________ Esb-java-user mailing list [email protected] https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
