Sending to dynamic address endpoint - wso2

How can one send an email to a dynamic address?
Address endpoint's URI seem to be static.
Is there a way to inject a property in a address endpoint ?
Here is what I have so far :
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="sendMail" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<property expression="//email" name="email" scope="default" type="STRING"/>
<log level="custom">
<property expression="fn:concat('Sending mail to - ',get-property('mail'))" name="mail"/>
</log>
<property name="messageType" value="text/html" scope="axis2"/>
<property name="ContentType" value="text/html" scope="axis2"/>
<property name="Subject" value="File Received" scope="transport"/>
<property name="OUT_ONLY" value="true"/>
<send>
<endpoint name="mail2user">
<address uri="mailto:username#gmail.com"/>
</endpoint>
</send>
</sequence>
Thanks.

Define header "To" and use send without endpoint :
<header name="To"expression="fn:concat('mailto:', get-property('senderAddress'))"/>
<property name="OUT_ONLY" value="true"/>
<send/>
Don't forget to define transportSender "mailto" with class "org.apache.axis2.transport.mail.MailTransportSender" in axis2.xml

Here is the final code after jean-michel suggestion :
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="sendMail" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<property expression="//email" name="mailto" scope="default" type="STRING"/>
<log level="custom">
<property expression="fn:concat('Sending mail to - ',get-property('mailto'))" name="mail"/>
</log>
<property name="messageType" scope="axis2" type="STRING" value="text/html"/>
<property name="ContentType" scope="axis2" type="STRING" value="text/html"/>
<property name="Subject" scope="transport" type="STRING" value="File Received"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<header expression="fn:concat('mailto:', get-property('mailto'))" name="To" scope="default"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<send/>
</sequence>

Related

How to change WSDL and add input variables in Proxy Service?

I created proxy service in WSO EI 6.4.0, which send email. In the flow I use properties: AttachmentFile, transport.mail.bodyWhenAttached, senderAddress and Subject. How to create custom wsdl with input parameters sender_address, subject, mail_text, attachment_file. or what other solution can you use?
I want to call this proxy server via API and send the parameters.
<inSequence xmlns="http://ws.apache.org/ns/synapse">
<property name="transport.mail.Format" scope="axis2" type="STRING" value="Attachment"/>
<property name="AttachmentFile" scope="axis2" type="STRING" value="attachment.csv"/>
<property name="ContentType" scope="axis2" type="STRING" value="text/html"/>
<property name="messageType" scope="axis2" type="STRING" value="text/html"/>
<property expression="Some body text" name="transport.mail.bodyWhenAttached"
scope="axis2" type="STRING"/>
<property name="senderAddress" scope="default" type="STRING" value="test#test.com"/>
<property name="Subject" scope="transport" type="STRING" value="WSO Email Test"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="true"/>
<log level="full"/>
<header
expression="fn:concat('mailto:', get-property('senderAddress'))"
name="To" scope="default"/>
<call>
<endpoint>
<default/>
</endpoint>
</call>
</inSequence>
Save the below file with the name sendEmailProxy.xml under the location
//repository/deployment/server/synapse-configs/default/proxy-services
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="sendEmailProxy"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<property name="transport.mail.Format"
scope="axis2"
type="STRING"
value="Attachment"/>
<property name="AttachmentFile"
scope="axis2"
type="STRING"
value="attachment.csv"/>
<property name="ContentType"
scope="axis2"
type="STRING"
value="text/html"/>
<property name="messageType"
scope="axis2"
type="STRING"
value="text/html"/>
<property name="senderAddress"
scope="default"
type="STRING"
value="test#test.com"/>
<property name="Subject"
scope="transport"
type="STRING"
value="WSO Email Test"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<property name="FORCE_SC_ACCEPTED"
scope="axis2"
type="STRING"
value="true"/>
<log level="full"/>
<header expression="fn:concat('mailto:', get-property('senderAddress'))"
name="To"
scope="default"/>
<call>
<endpoint>
<default/>
</endpoint>
</call>
<respond/>
</inSequence>
</target>
<parameter name="useOriginalwsdl">true</parameter>
<description/>
</proxy>
Once it is saved start wso2 EI/ESB instance , log into the instance, then click on service which is on left hand side of screen below services you wil find the proxy, You will have two options wsdl1.1 wsdl2.0 click on which ever you prefer , this would provide the wsdl file for you proxy
If you are already having a custom wsdl and want wso2 to pick up that wsdl then you need to add the below parameter
<parameter name="useOriginalwsdl">true</parameter>
This would accept your custom wsdl and wso2 will not generate it's own wsdl

WSO2 ESB how to sending array list empty error

I Configurate url like:
https://htygnfgvsccl.com:6753/intellige/vehicle/getAlerts
this url some times getting data like
{
"alertsList": [
{
"vehicleNo": "45342",
"alertName": "Stop Skipped",
"depotName": "akividu"
},
{
"vehicleNo": "674894",
"alertName": "Stop Skipped",
"depotName": "guntur"
}
]
}
but some times getting data like
{
"alertsList": []
}
every time response code is 200 but how to send with error message in the case of alertsList empty
vehiclegetAlertsapi
<?xml version="1.0" encoding="UTF-8"?>
<api context="/intellige/vehicle/getAlerts" name="vehiclegetAlertsapi" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET">
<inSequence>
<property description="http" name="HTTP_SC" scope="axis2" type="STRING" value="404"/>
<log level="full"/>
<send>
<endpoint key="vehiclegetAlertsendpoint"/>
</send>
</inSequence>
<outSequence>
<switch source="get-property('axis2','HTTP_SC')">
<case regex="200">
<log description="200log" level="custom">
<property expression="$ctx:ERROR_CODE" name="200reserrorcode"/>
</log>
<send/>
</case>
<default>
<log description="reslog" level="custom">
<property expression="$ctx:ERROR_CODE" name="reserrorcode"/>
<property expression="$ctx:ERROR_MESSAGE" name="reserrormessage"/>
<property expression="get-property('axis2','HTTP_SC')" name="reshttpsc"/>
</log>
</default>
</switch>
<clone continueParent="true">
<target>
<sequence>
<sequence key="vehiclegetAlertsmail"/>
</sequence>
</target>
</clone>
<send/>
</outSequence>
<faultSequence>
<switch source="get-property('axis2','HTTP_SC')">
<case regex="200">
<log description="200log" level="custom">
<property expression="$ctx:ERROR_CODE" name="200reserrorcode"/>
</log>
</case>
<default>
<log description="reslog" level="custom">
<property expression="$ctx:ERROR_CODE" name="reserrorcode"/>
<property expression="$ctx:ERROR_MESSAGE" name="reserrormessage"/>
<property expression="get-property('axis2','HTTP_SC')" name="reshttpsc"/>
</log>
</default>
</switch>
<clone continueParent="true">
<target>
<sequence>
<sequence key="vehiclegetAlertsmail"/>
</sequence>
</target>
</clone>
<send/>
</faultSequence>
</resource>
</api>
vehiclegetAlertsendpoint
<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="vehiclegetAlertsendpoint" xmlns="http://ws.apache.org/ns/synapse">
<http method="get" uri-template="https://htygnfgvsccl.com:6753/intellige/vehicle/getAlerts "/>
</endpoint>
vehiclegetAlertsmail:
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="vehiclegetAlertsmail" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<log level="custom">
<property name="status" value=" vehileget alert Details Sending mail"/>
</log>
<property expression="get-property('axis2','HTTP_SC')" name="ErrorMessage" scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
<property name="ContentType" scope="axis2" type="STRING" value="text/plain"/>
<property name="Subject" scope="transport" type="STRING" value="vehileget alert api not working"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="true"/>
<payloadFactory media-type="json">
<format>{"vehileget alert api not working":"$1"}</format>
<args>
<arg evaluator="xml" expression="$ctx:ErrorMessage" xmlns:ns="http://org.apache.synapse/xsd"/>
</args>
</payloadFactory>
<call>
<endpoint key="vehiclegetAlertsmailid"/>
</call>
<drop/>
</sequence>
vehiclegetAlertsmailid:
<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="vehiclegetAlertsmailid" xmlns="http://ws.apache.org/ns/synapse">
<recipientlist>
<endpoint>
<address uri="mailto:aisha#gmail.com"/>
</endpoint>
</recipientlist>
</endpoint>
get 200 response code send the data automatically in case if any other reponse to send the mail my mail id ,prsent my problem is my rest url some time total data like alertsList with data comming some times only alertsList comming not comming data that case how to send mail

No password supplied by the callback handler for the user [wso2]

I have a proxy service inlclued a sequence.
I process for authentication for proxy service with tag
<policy key="gov:/testPolicy"/>
<enableSec/>
In this sequence contain iterate mediator.
When call proxy service with authentication by soapUI then not reponse for client and have a error Unexpected error sending message back {org.apache.synapse.core.axis2.Axis2Sender} org.apache.axis2.AxisFault: No password supplied by the callback handler for the user : "wso2carbon"
If have not iterate mediator then have not error
This sequence
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="SendReceiveQueue" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<property expression="get-property('Edxml_Organ_Id')" name="senderUnitId" scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="get-property('Edxml_Type')" name="applicationType" scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="get-property('Edxml_Record_Code')" name="recordCode" scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="$ctx:data_original" name="messagePl" scope="default" type="STRING" xmlns:edXML="http://www.mic.gov.vn/TBT/QCVN_102_2016" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="$body" name="messagePlBody" scope="default" type="STRING" xmlns:edXML="http://www.mic.gov.vn/TBT/QCVN_102_2016" xmlns:ns="http://org.apache.synapse/xsd"/>
<property name="QUEUE_ACTION_TYPE" scope="default" type="STRING" value="SENDER"/>
<log level="custom">
<property expression="get-property('messagePl')" name="messagePllogging" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="get-property('messagePlBody')" name="messagePlloggingBody" xmlns:ns="http://org.apache.synapse/xsd"/>
</log>
<iterate expression="$ctx:abc//edXML:To" id="abc" sequential="true" xmlns:edXML="http://www.mic.gov.vn/TBT/QCVN_102_2016" xmlns:ns="http://org.apache.synapse/xsd" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<target>
<sequence>
<log level="custom">
<property name="goi DSS" value="-------------------------------------------"/>
<property expression="//edXML:To/edXML:OrganId/text()" name="queue name"/>
</log>
<payloadFactory media-type="xml">
<format>
<p:getQueueId xmlns:p="http://ws.wso2.org/dataservice">
<xs:in_unitId xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:in_unitId>
<xs:in_b2bType xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:in_b2bType>
</p:getQueueId>
</format>
<args>
<arg evaluator="xml" expression="//edXML:To/edXML:OrganId/text()"/>
<arg evaluator="xml" expression="syn:get-property('Edxml_Type')"/>
</args>
</payloadFactory>
<call blocking="true">
<endpoint>
<address uri="http://cqdt-app3:8280/services/validateData"/>
</endpoint>
</call>
<property expression="//x:returnCode/x:MessageQueueId/text()" name="queue_name" scope="default" type="STRING" xmlns:x="http://ws.wso2.org/dataservice"/>
<log level="custom">
<property name="lay xong tu dss" value="-------------------------------------------"/>
<property expression="$ctx:queue_name" name="ten queue lay ra"/>
</log>
<class name="com.vsc.ReceiveQueue">
<property name="password" value="admin"/>
<property name="queueName" value="testQueue1"/>
<property name="CF_NAME_PREFIX" value="connectionfactory."/>
<property name="CF_NAME" value="QueueConnectionFactory"/>
<property name="QPID_ICF" value="org.wso2.andes.jndi.PropertiesFileInitialContextFactory"/>
<property name="CARBON_DEFAULT_HOSTNAME" value="cqdt-app3"/>
<property name="QUEUE_NAME_PREFIX" value="queue."/>
<property name="userName" value="admin"/>
<property name="CARBON_CLIENT_ID" value="carbon"/>
<property name="CARBON_DEFAULT_PORT" value="5675"/>
<property name="CARBON_VIRTUAL_HOST_NAME" value="carbon"/>
</class>
<log level="custom">
<property name="put xong vao queue" value="-------------------------------------------"/>
<property expression="$ctx:queue_name" name="ten queue ban xong"/>
</log>
<payloadFactory media-type="xml">
<format>
<response>
<result>SUCCESS</result>
</response>
</format>
<args/>
</payloadFactory>
<property name="RESPONSE" scope="default" type="STRING" value="true"/>
<property name="messageType" scope="axis2" type="STRING" value="application/xml"/>
<property action="remove" name="NO_ENTITY_BODY" scope="axis2"/>
<header action="remove" name="To" scope="default"/>
<send/>
</sequence>
</target>
</iterate>
<property name="RESPONSE" scope="default" type="STRING" value="true"/>
<header action="remove" name="To" scope="default"/>
<log level="custom">
<property expression="get-property('messagePl')" name="1111555555555555555555555555551111111111111111111111111111111-------------------------------" xmlns:ns="http://org.apache.synapse/xsd"/>
</log>
</sequence>
Please help me!
Have you tried applying the policy on the endpoint directly?
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="TQBsEndpoint">
<address uri="http://cqdt-app3:8280/services/validateData" format="soap11">
<enableSec policy="gov:testPolicy"/>
</address>
</endpoint>

Can we get Class return Property in Proxy sequence

I written custom mediator and its working fine I am passing the values to my class mediator using insequence like this
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="tReadingMobile_5"
transports="https http"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence onError="fault">
<property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/>
<property name="Reading"
expression="//Readings"
scope="default"
type="STRING"/>
<property name="actiondetailid"
expression="//actiondetailid/text()"
scope="default"
type="STRING"/>
<property name="actionid"
expression="//actionid/text()"
scope="default"
type="STRING"/>
<property name="userid"
expression="//userid/text()"
scope="default"
type="STRING"/>
<property name="assetid"
expression="//assetid/text()"
scope="default"
type="STRING"/>
<property name="partybranchid"
expression="//partybranchid/text()"
scope="default"
type="STRING"/>
<property name="activityid"
expression="//activityid/text()"
scope="default"
type="STRING"/>
<property name="clientid"
expression="//clientid/text()"
scope="default"
type="STRING"/>
<property name="ouid"
expression="//ouid/text()"
scope="default"
type="STRING"/>
<log level="custom">
<property name="fff" expression="get-property('Reading')"/>
<property name="ggggg" expression="get-property('actiondetailid')"/>
<property name="hhhh" expression="get-property('actionid')"/>
<property name="partybranchid" expression="get-property('partybranchid')"/>
</log>
<iterate continueParent="true"
id="Readings"
expression="//ReadingsLiteTaildto">
<target>
<sequence>
<property name="actiondetailid" expression="get-property('actiondetailid')"/>
<property name="parameterid" expression="//ParameterId/text()"/>
<property name="slno" expression="//SlNo/text()"/>
<property name="inputvalue" expression="//InputValue/text()"/>
<property name="inputtext" expression="//InputText/text()"/>
<property name="finalvalue" expression="//FinalValue/text()"/>
<payloadFactory>
<format>
<p:insert_treadings_operation xmlns:p="http://ws.wso2.org/dataservice">
<xs:actiondetailid xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:actiondetailid>
<xs:slno xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:slno>
<xs:parameterid xmlns:xs="http://ws.wso2.org/dataservice">$3</xs:parameterid>
<xs:inputvalue xmlns:xs="http://ws.wso2.org/dataservice">$4</xs:inputvalue>
<xs:inputtext xmlns:xs="http://ws.wso2.org/dataservice">$5</xs:inputtext>
<xs:finalvalue xmlns:xs="http://ws.wso2.org/dataservice">$6</xs:finalvalue>
</p:insert_treadings_operation>
</format>
<args>
<arg expression="get-property('actiondetailid')"/>
<arg expression="get-property('slno')"/>
<arg expression="get-property('parameterid')"/>
<arg expression="get-property('inputvalue')"/>
<arg expression="get-property('inputtext')"/>
<arg expression="get-property('finalvalue')"/>
</args>
</payloadFactory>
<send receive="tReadingsid_Seq">
<endpoint>
<address uri="http://localhost:9764/services/treadings_DataService/"
format="soap11"/>
</endpoint>
</send>
</sequence>
</target>
</iterate>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="Time"
expression="get-property('SYSTEM_TIME')"
scope="default"
type="STRING"/>
<property name="actiondetailid"
expression="get-property('actiondetailid')"
scope="default"
type="STRING"/>
<property name="OUT_ONLY" value="true"/>
<property name="dbconnectionurl"
value="jdbc:postgresql://$$$$$$$$$$/*****"/>
<property name="dbuser" value="##########"/>
<property name="dbpassword" value="*******"/>
<class name="in.youtility.esb.custommediators.ReadingAlertMediator"/>
<property name="Message"
expression="get-property('Message')"
scope="default"
type="STRING"/>
</inSequence>
<outSequence onError="fault"/>
</target>
</proxy>
The Message property is define inside the class
So i wish retrieve it from out side class means insequence
Is it possible in wso2esb or not if i get this property out of class then i will get scenario
Yes. It is possible. It will work as a normal property which you can refer at any place after you get the return value from class mediator.
You can get the property 'Message' as you have mentioned but before that you need to assign the result to the property 'Message'.
See the following sample of assign the result,
<class name="in.youtility.esb.custommediators.ReadingAlertMediator">
<property name="target" value="Message"/>
</class>

How to get the value of propetry and set payload in proxy wso2 esb

Here is my proxy code:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="ProviderPublication" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<filter xmlns:p="http://www.openoandm.org/xml/ISBM/" xpath="//p:OpenPublicationSession">
<then>
<property xmlns:xs="http://www.openoandm.org/xml/ISBM/" name="ChannelURI" expression="//xs:ChannelURI" scope="default" type="STRING"/>
<class name="wso2.org.Communicator.OpenPublication">
<property name="channelURI" value="myChannelURI"/>
</class>
**<property name="sessionIDFromClassMediator" expression="get-property('SessionID')" scope="default" type="STRING"/>**
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<payloadFactory>
<format>
<ns1:OpenPublicationSessionResponse xmlns:ns1="http://www.openoandm.org/xml/ISBM/">
<ns1:SessionID>$1</ns1:SessionID>
</ns1:OpenPublicationSessionResponse>
</format>
<args>
<arg expression="get-property('sessionIDFromClassMediator')"/>
</args>
</payloadFactory>
<send/>
</then>
<else>
<filter xpath="//p:PostPublication">
<then>
<property xmlns:xs="http://www.openoandm.org/xml/ISBM/" name="SessionID" expression="//xs:SessionID" scope="default" type="STRING"/>
<property xmlns:xs="http://www.openoandm.org/xml/ISBM/" name="Topic" expression="//xs:Topic" scope="default" type="STRING"/>
<property xmlns:xs="http://www.openoandm.org/xml/ISBM/" name="Expiry" expression="//xs:Expiry" scope="default" type="STRING"/>
<property xmlns:ns="http://www.openoandm.org/xml/ISBM/" name="MessageContent" expression="//MessageContent" scope="default" type="STRING"/>
<class name="wso2.org.postPublication.PostPublication">
<property name="topic" value="Sports"/>
<property name="sessionID" value="session_001"/>
<property name="messagecontent" value="Cricket on air"/>
<property name="expiry" value="Monday"/>
</class>
<property name="getMessageIDFromClassMed" expression="get-property('MessageID')" scope="default" type="STRING"/>
<log level="full">
**<property name="SessionIDFromFstFltr" expression="get-property('sessionIDFromClassMediator')"/>**
</log>
I AM NOT ABLE TO GET THE PROPERTY VALUE OF sessionIDFromClassMediator SO MY FILTER NEVER GETS TRUE AND CAN'T GET INSIDE THE FILTER
**<filter xpath="get-property('sessionIDFromClassMediator') = get-property('SessionID')">
<then>
<log level="custom">
<property name="STATE" value="message is sent to queue"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<payloadFactory>
<format>
<ns1:PostPublicationResponse xmlns:ns1="http://www.openoandm.org/xml/ISBM/">
<ns1:MessageID>$1</ns1:MessageID>
</ns1:PostPublicationResponse>
</format>
<args>
<arg expression="get-property('getMessageIDFromClassMed')"/>
</args>
</payloadFactory>
<send/>
</then>
<else>
<log level="full">
<property name="FilterNotRunning" value="----------FilterNotRunning------------------"/>
</log>
<drop/>
</else>
</filter>**
</then>
<else>
<drop/>
</else>
</filter>
</else>
</filter>
</inSequence>
<endpoint>
<address uri="jms:/myQueue?&transport.jms.DestinationType=queue"/>
</endpoint>
So i want to get the value of <property name="sessionIDFromClassMediator" expression="get-property('SessionID')" scope="default" type="STRING"/> so that i can use this property value to match with Other Property after
<class name="wso2.org.postPublication.PostPublication">
<property name="topic" value="Sports"/>
<property name="sessionID" value="session_001"/>
<property name="messagecontent" value="Cricket on air"/>
<property name="expiry" value="Monday"/>
</class>
and after that i am sending message to Message broker but before that i want to associate a payload which should be send to the queue of message broker. I want to implement payload inside
I AM NOT ABLE TO GET THE PROPERTY VALUE OF sessionIDFromClassMediator SO MY FILTER NEVER GETS TRUE AND CAN'T GET INSIDE THE FILTER
**<filter xpath="get-property('sessionIDFromClassMediator') = get-property('SessionID')">
<then>
<log level="custom">
<property name="STATE" value="message is sent to queue"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<payloadFactory>
<format>
<ns1:PostPublicationResponse xmlns:ns1="http://www.openoandm.org/xml/ISBM/">
<ns1:MessageID>$1</ns1:MessageID>
</ns1:PostPublicationResponse>
</format>
<args>
<arg expression="get-property('getMessageIDFromClassMed')"/>
</args>
</payloadFactory>
<send/>
</then>
<else>
<log level="full">
<property name="FilterNotRunning" value="----------FilterNotRunning------------------"/>
</log>
<drop/>
</else>
</filter>**
part.THE MAIN PROBLEM IS THAT THE FIRST FILTER IS EXECUTED WHEN I ENVOKE OPERATION OPENPUBLICATION, AND WHEN I ENVOKE THE SECOND OPERATION ALL THE PROPERTY VALUE GET RESET. SO HOW CAN I MAKE PROPERTY VALUE PERSISTENT SO THAT IT IS NEVER LOST? Hope you understand my question and looking forward to your solutions. Thanks in advance
Try to add some logs of your property to see if it is there or not:
<log level="custom">
<property name="your property" expression="get-property('sessionIDFromClassMediator'))"/>
</log>
Keep in mind the different levels of the properties (transport, axis2, axis2-client).
I also had quite some problems with the filter mediator using the xpath attribute. I don't use it anymore and always use the combination of "source" and "regex".
Example:
<filter source="$body/anElementInTheBody" regex="true">
So for your case you can create an additional property (just before the filter) that will contain the boolean value if it should be filtered or not. Then with the regex=true you will enter the filter.
This is just a pseudo code of your example - maybe need some corrections:
<property name="filterCondition" expression="get-property('sessionIDFromClassMediator') = get-property('SessionID')"/>
<filter source="get-property('filterCondition')" regex="true">