Why does Send Mediator not execute? - wso2

<?xml version="1.0" encoding="UTF-8" ?>
<proxy name="VFS_RTDB_Proxy" serviceGroup="" startOnLoad="true" trace="enable" transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<payloadFactory media-type="json">
<format>{rtdatas:$1}</format>
<args>
<arg expression="get-property('rtDataSets')" />
</args>
</payloadFactory>
<send>
<endpoint>
<address format="rest" statistics="enable" trace="enable" uri="http://211.154.164.28:9666/services/oge/vzdb/post/history" />
</endpoint>
</send>
</inSequence>
</target>
<parameter name="transport.vfs.Streaming">true</parameter>
<parameter name="transport.PollInterval">2</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.ActionAfterProces">MOVE</parameter>
<parameter name="transport.vfs.FileURI">D:\exportRTDB</parameter>
<parameter name="transport.vfs.FileURI">G:\MoveAfterFailure</parameter>
<parameter name="transport.vfs.MoveAfterFailure">G:\MoveAfterFailure</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.csv</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
</proxy>
Why does Send Mediator not execute? When I set Address Endpoint wrapped in Call Mediator, this doesn't execute either. How can I solve this?
When wrapped in Call Mediator, I get follow error:
[2016-03-30 20:31:25,550] INFO - BuilderUtil OMException in
getSOAPBuilder org.apache.axiom.soap.SOAPProcessingException: First
Element must contain the local name, Envelope , but found html
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:305)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:252)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:234)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(StAXSOAPModelBuilder.java:154)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(StAXSOAPModelBuilder.java:140)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:659)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:206)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:146)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:109)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:68)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:348)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:445)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.sendReceive(BlockingMsgSender.java:254)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.send(BlockingMsgSender.java:175)
at org.apache.synapse.mediators.builtin.CallMediator.handleBlockingCall(CallMediator.java:113)
at org.apache.synapse.mediators.builtin.CallMediator.mediate(CallMediator.java:85)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:149)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:185)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.axis2.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:328)
at org.apache.synapse.transport.vfs.VFSTransportListener.processFile(VFSTransportListener.java:751)
at org.apache.synapse.transport.vfs.VFSTransportListener.scanFileOrDirectory(VFSTransportListener.java:407)
at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:177)
at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:124)
at org.apache.axis2.transport.base.AbstractPollingTransportListener$1$1.run(AbstractPollingTransportListener.java:67)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745) [2016-03-30 20:31:25,635] INFO - BuilderUtil Remaining input stream :[]
[2016-03-30 20:31:25,635] WARN - FaultHandler ERROR_CODE : 401000
[2016-03-30 20:31:25,651] WARN - FaultHandler ERROR_MESSAGE : First
Element must contain the local name, Envelope , but found html
[2016-03-30 20:31:25,651] WARN - FaultHandler ERROR_DETAIL :
[2016-03-30 20:31:25,651] WARN - FaultHandler ERROR_EXCEPTION :
org.apache.synapse.SynapseException: Error while performing the call
operation [2016-03-30 20:31:25,651] WARN - FaultHandler FaultHandler
: org.apache.synapse.mediators.MediatorFaultHandler#4207ac5d
[2016-03-30 20:31:25,651] WARN - MediatorFaultHandler Executing fault
handler mediator : org.apache.synapse.mediators.base.SequenceMediator

The follow is changed proxy config, Get error By follow config;I have not publish proxy as WSDL,so I did not found web Page....
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="VFS_RTDB_Proxy" serviceGroup="" startOnLoad="true"
trace="enable" transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
<localEntry key="smooks-key" src="file:repository/samples/resources/smooks/smooks-config.xml"/>
<target>
<inSequence>
<class description="" name="cn.oge.kdm.mediator.RTDataSetMediator"/>
<!-- <log description="" level="custom">
<property expression="get-property('rtDataSets')" name="RTDATASET"/>
</log> -->
<payloadFactory media-type="json">
<format>{"rtdatas":$1}</format>
<args>
<arg expression="get-property('rtDataSets')"/>
</args>
</payloadFactory>
<call blocking="true">
<endpoint>
<address statistics="enable" trace="enable" uri="http://211.154.164.98:9766/services/oge/vzdb/post/history"/>
</endpoint>
</call>
</inSequence>
<outSequence>
<!-- <log level="full"/> -->
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<property
expression="fn:concat(fn:substring-after(get-property('MessageID'), 'urn:uuid:'), '.xml')"
name="transport.vfs.ReplyFileName" scope="transport" type="STRING"/>
</outSequence>
<faultSequence>
<!-- <class description="" name="cn.oge.kdm.mediator.DecompressionMediator"/> -->
<log level="full"/>
</faultSequence>
</target>
<parameter name="transport.vfs.Streaming">true</parameter>
<parameter name="transport.PollInterval">2</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.ActionAfterProces">MOVE</parameter>
<parameter name="transport.vfs.FileURI">D:\exportRTDB</parameter>
<parameter name="transport.vfs.MoveAfterProcess">vfs:ftp://ProEditor:****#211.154.164.99/</parameter>
<parameter name="transport.vfs.MoveAfterFailure">G:\MoveAfterFailure</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.csv</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
</proxy>

Related

Use WSO2 EI to send an email

I use WSO2 EI to send an email but I get an error message below.
2019-01-24 17:53:12,353 To:
/services/SimpleProxy2.SimpleProxy2HttpSoap12Endpoint, WSAction:
urn:mediate, SOAPAction: urn:mediate, MessageID:
urn:uuid:06891289-318c-49b1-83bd-bc71c7590078, Direction: request,
MESSAGE = Executing default 'fault' sequence, ERROR_CODE = 0,
ERROR_MESSAGE = Unexpected error during sending message out, Envelope:
Hello
WSO2.....!
2019-01-24 17:53:12,347 Suspending endpoint : AnonymousEndpoint with address mailto:zoehuang#asqimacau.com - current suspend duration
is : 30000ms - Next retry after : Thu Jan 24 17:53:42 CST 2019
2019-01-24 17:53:12,347 Endpoint : AnonymousEndpoint with address mailto:zoehuang#asqimacau.com will be marked SUSPENDED as it failed
2019-01-24 17:53:12,308 Unexpected error during sending message out
2019-01-24 17:53:12,302 Error generating mail message
2019-01-24 17:53:12,284 Error creating mail message or sending it to the configured server
2019-01-24 17:51:26,988 Unable to sendViaPost to url[http://asqi-vm:8280/services/SimpleProxy2.SimpleProxy2HttpSoap12Endpoint]
2019-01-24 17:50:27,008 This engine will expire all callbacks after GLOBAL_TIMEOUT: 1200 seconds, irrespective of the timeout
action, after the specified or optional timeout
2019-01-24 17:50:26,990 To: /services/SimpleProxy2.SimpleProxy2HttpSoap12Endpoint, WSAction:
urn:mediate, SOAPAction: urn:mediate, MessageID:
urn:uuid:06891289-318c-49b1-83bd-bc71c7590078, Direction: request,
Envelope: Hello
WSO2.....!
configuration file setting in EI_HOME\conf\axis2\axis2.xml
<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
<parameter name="mail.smtp.host">xxxx-mail1.com</parameter>
<parameter name="mail.smtp.port">465</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
<parameter name="mail.smtp.user">xxxxx#xxxxx.com</parameter>
<parameter name="mail.smtp.password">password</parameter>
<parameter name="mail.smtp.from">xxxxx#xxxxx.com</parameter>
</transportSender>
My proxy service code in EI
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="SimpleProxy2"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<property name="messageType"
scope="axis2"
type="STRING"
value="text/html"/>
<property name="ContentType" scope="axis2" value="text/html"/>
<property name="Subject" scope="transport" value="Testing ESB"/>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
<payloadFactory media-type="xml">
<format>
<ns:text xmlns:ns="http://ws.apache.org/commons/ns/payload">$1</ns:text>
</format>
<args>
<arg value="Hello WSO2.....!"/>
</args>
</payloadFactory>
<log level="full"/>
<send>
<endpoint>
<address uri="mailto:xxxxx#xxxxx.com"/>
</endpoint>
</send>
<log level="full"/>
</inSequence>
<outSequence>
</outSequence>
</target>
<description/>
</proxy>
I expected I can use WSO2 EI to send an e-mail and receive an e-mail.
If you can refer to the documentation in [1] we can observe the following sample configuration for the mail transport
<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
<parameter name="mail.smtp.host">smtp.gmail.com</parameter>
<parameter name="mail.smtp.port">587</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
<parameter name="mail.smtp.user">synapse.demo.0</parameter>
<parameter name="mail.smtp.password">mailpassword</parameter>
<parameter name="mail.smtp.from">synapse.demo.0#gmail.com</parameter>
</transportSender>
Please refer to the following parameters in your configuration. In the following can you please modify the smtp.user value to xxxxx (synapse.demo.0 in above) rather than xxxxx#xxxxx.com
<parameter name="mail.smtp.user">xxxxx#xxxxx.com</parameter>
<parameter name="mail.smtp.from">xxxxx#xxxxx.com</parameter>
[1]-https://docs.wso2.com/display/EI640/MailTo+Transport

WSO2 ESB endpoint jms uri syntax-format in proxy service

In my proxy service, am trying to create endpoint with JMS-ActiveMQ and it fails in the uri. Is my JMS Endpoint uri correct? am using ActiveMQ with EI611 on tooling380.
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="CSVProcessor" startOnLoad="true" transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<log level="full"/>
<smooks config-key="smooks-config" description="GetSmooks">
<input type="text"/>
<output type="xml"/>
</smooks>
<log description="GetData" level="full"/>
<datamapper config="gov:datamapper/NewConfig.dmc" description="MapPriceData" inputSchema="gov:datamapper/NewConfig_inputSchema.json" inputType="XML" outputSchema="gov:datamapper/NewConfig_outputSchema.json" outputType="XML"/>
<log description="LogDataMapper" level="full"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<send>
<endpoint>
<address uri="jms:/foo.bar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
</endpoint>
</send>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
<parameter name="transport.PollInterval">5</parameter>
<parameter name="transport.vfs.FileURI">file://c:\test-data\in</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.MoveAfterFailure">file://c:\test-data\original</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.csv</parameter>
<parameter name="transport.vfs.MoveAfterProcess">file://c:\test-data\out</parameter>
</proxy>
Error :
[2017-10-19 17:20:30,944] [] ERROR - ClientUtils The system cannot infer the transport information from the jms:/foo.bar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue URL.
[2017-10-19 17:20:30,948] [] ERROR - Axis2Sender Unexpected error during sending message out
org.apache.axis2.AxisFault: The system cannot infer the transport information from the jms:/foo.bar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue URL.
at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)
at org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClient.java:288)
at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:249)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:595)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:83)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:548)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:382)
at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:65)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:121)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:213)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.axis2.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:328)
at org.apache.synapse.transport.vfs.VFSTransportListener.processFile(VFSTransportListener.java:824)
at org.apache.synapse.transport.vfs.VFSTransportListener.scanFileOrDirectory(VFSTransportListener.java:472)
at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:188)
at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:134)
at org.apache.axis2.transport.base.AbstractPollingTransportListener$1$1.run(AbstractPollingTransportListener.java:67)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[2017-10-19 17:20:30,958] [] WARN - EndpointContext Endpoint : AnonymousEndpoint with address jms:/foo.bar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue will be marked SUSPENDED as it failed
Ok, that was my bad.
I did not fully uncomment the below entry in axis2.xml(in C:\wso2ei-6.1.1\conf\axis2), which resulted in this error. I uncommented the leading <!-- but not the trailing -->. Am an idiot, for sure.
<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>
After uncommenting, the data transformed from the source CSV file into a new XML format, was sent to the destination jms queue of ActiveMQ, as desired.

Correct configuration for transport Sender & Receiver JMS?

I have some questions because documentation is not clear..
How should I setup WSO2 ESB environment to be able to read and write messages form WSO2 MessageBroker.
I followed ConfigurewithWSO2MessageBroker
I have ESB and MB on same server (MB has Offset=2)
/repository/conf/axis2/axis2.xml
....
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="JMSTopic" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
</parameter>
<parameter name="JMSQueue" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
<parameter name="default" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
</transportReceiver>
...
and sender part
<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender">
<parameter name="default" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ConnectionFactory</parameter>
</parameter>
</transportSender>
jndi.properties files
connectionfactory.QueueConnectionFactory = amqp://admin:admin#clientID/carbon?brokerlist='tcp://gst-esb-qa-01:5674'
connectionfactory.TopicConnectionFactory = amqp://admin:admin#clientID/carbon?brokerlist='tcp://gst-esb-qa-01:5674'
connectionfactory.ConnectionFactory = amqp://admin:admin#clientID/carbon?brokerlist='tcp://gst-esb-qa-01:5674'
queue.myQueue = myQueue
queue.testQueue= testQueue
topic.MyTopic = MyTopic
My proxy
<proxy name="SendMessagetoJMSProxy" transports="http" startOnLoad="true">
<target>
<endpoint>
<address uri="jms:/myQueue?&transport.jms.DestinationType=queue"/>
</endpoint>
<inSequence>
<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"/>
</inSequence>
<outSequence/>
</target>
</proxy>
my SOAP UI call
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">
<soapenv:Header/>
<soapenv:Body>
<ser:dummy>
<xsd:symbol>IBM</xsd:symbol>
</ser:dummy>
</soapenv:Body>
</soapenv:Envelope>
According to doc I should see the message in JMS Message Broker BUT I get
Error while building Passthrough stream
TID[-1234] [ESB] [2017-05-16 12:52:47,137] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} - Error while building Passthrough stream org.apache.axiom.om.impl.builder.StAXOMBuilder.lookahead(StAXOMBuilder.java:711) org.apache.axiom.soap.impl.llom.SOAPBodyImpl.hasLookahead(SOAPBodyImpl.java:191) org.apache.axiom.soap.impl.llom.SOAPBodyImpl.getFirstElementLocalName(SOAPBodyImpl.java:217) org.apache.axiom.soap.impl.llom.SOAPBodyImpl.hasFault(SOAPBodyImpl.java:99) org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.hasFault(SOAPEnvelopeImpl.java:305) org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:189) org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:137) org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:100) org.apache.synapse.mediators.AbstractListMediator.buildMessage(AbstractListMediator.java:140) org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:83) org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59) org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158) org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:210) org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:403) org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151) org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745)
AND
Endpoint : AnonymousEndpoint with address jms:/myQueue?&transport.jms.DestinationType=queue will be marked SUSPENDED as it failed
First question :
java.naming.provider.url param in axis2.xml is it relative to [ESB Home] location ?
Im my case server folder structure looks like ...
maybe that should look like ....????
<parameter name="java.naming.provider.url" locked="false">file:/home/wso2admin/wso2esb-5.0.0/repository/conf/jndi.properties</parameter>
SECOND :
is this error related to Message Builder and Formater ????
any help would be nice ...couse Im stuck for days ...
First Question:java.naming.provider.url param in axis2.xml is it relative to [ESB Home] location ?
No, you dont need to add ESB home location.
Second Question: is this error related to Message Builder and Formater ????
Yes, you are getting an error with message builders.
Just verify whether you added client jars and verify your proxy. Please create a proxy as follow and try it.
Sample Proxy:
<proxy name="QueueProxy" startOnLoad="true" transports="jms">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<send>
<endpoint>
<address uri="jms:/MyQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties"/>
</endpoint>
</send>
</inSequence>
</target>
</proxy>
Reference: https://docs.wso2.com/display/ESB500/ESB+as+a+JMS+Producer
Please try the below proxy and check the URL format you are using
<proxy xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteProxy" transports="http">
<target>
<inSequence>
<property action="set" name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="jms:/myQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
for more
https://docs.wso2.com/display/ESB500/ESB+as+a+JMS+Producer
https://docs.wso2.com/display/MB310/Integrating+WSO2+ESB
Thanks to Rajjaz and Jan ...
I created a proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="SendMessagetoJMSProxy"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<log level="custom">
<property name="STATE" value="message is sent to myQueue"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
</inSequence>
<outSequence/>
<endpoint>
<address uri="jms:/myQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties"/>
</endpoint>
</target>
<description/>
</proxy>
also I figure out that if you have define default JMS configuration part in axis2.xml for transportReceiver it is enough to put name of Queue
so this is also working
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="SendMessagetoJMSProxy2"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<log level="custom">
<property name="STATE" value="message is sent to GST_TMS_ASSOCIATE_LEASE Queue"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
</inSequence>
<outSequence/>
<endpoint>
<address uri="jms:/myQueue"/>
</endpoint>
</target>
<description/>
</proxy>
and now I can publish a message to JMS queue with proxy ...
Im little confused (still) where all this log in System logs coming from and why ?!?]1

How to send an email on my personal email id fro WSO2 ESB

I am trying to send an email from the WSO2 ESB and configured as per one wos2 blog. I am getting error " MailTransportListener Checking mail for account : synapse.demo.1#gmail.com". I a not sure what is wrong in code and can I also send am email on my personal email id so that I can come to know that everything is working fine.
Synapse Code:
<proxy name="StockQuoteProxy" transports="mailto">
<parameter name="transport.mail.Address">synapse.demo.1#gmail.com</parameter>
<parameter name="transport.mail.Protocol">pop3</parameter>
<parameter name="transport.PollInterval">5</parameter>
<parameter name="mail.pop3.host">pop.gmail.com</parameter>
<parameter name="mail.pop3.port">995</parameter>
<parameter name="mail.pop3.user">synapse.demo.1</parameter>
<parameter name="mail.pop3.password">mailpassword</parameter>
<parameter name="mail.pop3.socketFactory.class">javax.net.ssl.SSLSocketFactory</parameter>
<parameter name="mail.pop3.socketFactory.fallback">false</parameter>
<parameter name="mail.pop3.socketFactory.port">995</parameter>
<parameter name="transport.mail.ContentType">application/xml</parameter>
<target>
<inSequence>
<property name="senderAddress" expression="get-property('transport', 'From')"/>
<log level="full">
<property name="Sender Address" expression="get-property('senderAddress')"/>
</log>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<property name="Subject" value="Custom Subject for Response" scope="transport"/>
<property name="messageType" value="text/plain" scope="axis2-client"/>
<script language="js"><![CDATA[
mc.setPayloadXML(<ns:text xmlns:ns="http://ws.apache.org/commons/ns/payload">Plain text received!</ns:text>);
]]></script>
<header name="To" expression="fn:concat('mailto:', get-property('senderAddress'))"/>
<log level="full">
<property name="message" value="Response message"/>
<property name="Sender Address" expression="get-property('senderAddress')"/>
</log>
<send/>
</outSequence>
</target>
<publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
Thanks for your response. All I want is to send an email once I hit this service. my new code is :
<proxy name="SendEmailService" transports="http" startOnLoad="true" statistics="enable" trace="disable">
<target inSequence="SendEmailService_IN" />
<publishWSDL key="SendEmailService_wsdl"/>
</proxy>
<localEntry key="SendEmailService_wsdl" src="file:repository/conf/employee/OverseaseEmployee.wsdl"/>
<sequence name="SendEmailService_IN">
<property name="Subject" value="Custom Subject for Response" scope="transport"/>
<property name="ContentType" value="text/plain" scope="axis2"/>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
<send>
<endpoint>
<address uri="06.shrikant#gmail.com"/>
</endpoint>
</send>
<parameter name="mail.smtp.user">shrikant</parameter>
<parameter name="transport.mail.Protocol">smtp</parameter>
<parameter name="transport.mail.Address">06.shrikant#gmail.com</parameter>
<parameter name="mail.smtp.port">587</parameter>
<parameter name="mail.smtp.password">pass</parameter>
<parameter name="transport.mail.ContentType">text/plain</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
<parameter name="mail.smtp.from">06.shrikant#gmail.com</parameter>
<parameter name="mail.smtp.host">smtp.gmail.com</parameter>
<send/>
</sequence>
Here is a working proxy to call a service and send the response to an email address. Here, transports="http,https" should be changed depending on how you want to call the proxy service.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="MyPxy"
transports="http,https"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<send>
<endpoint>
<address uri="http://www.mocky.io/v2/57cd173e1200008620bb7826"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<property name="Subject"
value="Custom Subject for Response"
scope="transport"/>
<property name="ContentType" value="text/plain" scope="axis2"/>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
<send>
<endpoint>
<address uri="mailto:toemailuser#gmail.com"/>
</endpoint>
</send>
<respond/>
</outSequence>
</target>
<parameter name="mail.smtp.user">fromemailuser</parameter>
<parameter name="transport.mail.Protocol">smtp</parameter>
<parameter name="transport.mail.Address">fromemailuser#gmail.com</parameter>
<parameter name="mail.smtp.port">587</parameter>
<parameter name="mail.smtp.password">pass</parameter>
<parameter name="transport.mail.ContentType">text/plain</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
<parameter name="mail.smtp.from">fromemailuser#gmail.com</parameter>
<parameter name="mail.smtp.host">smtp.gmail.com</parameter>
<description/>
</proxy>
You can refer this blog for sending email with wso2 esb http://elilsivanesan.blogspot.com/2016/06/mail-transport-with-wso2-esb.html

Writing on a text file using VFS in WSO2 ESB 4.8.1

I am using VFS transport to poll a simple text file and then i send the text of a file to a queue. This flow works fine but in case of error scenario when fault sequence is executed , i want to write my error message to a simple text file and it is not Working.
Note:
I am using WSO2 ESB Version 4.8.1.
I have enabled the VFS transport in my "axis2.xml" file.
I have also tried all the solutions provided in this question which is related to mine.
My Service Code:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="FileWriteTest"
transports="vfs"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<log level="full"
separator="******************FileWrite In Sequence Start*************"/>
</inSequence>
<outSequence/>
<faultSequence>
<payloadFactory media-type="xml">
<format>
<MessageFormat xmlns="">
<ECode>$1</ECode>
<EMsg>$2</EMsg>
<EDetail>$3</EDetail>
<EException>$4</EException>
</MessageFormat>
</format>
<args>
<arg evaluator="xml" expression="get-property('ERROR_CODE')"/>
<arg evaluator="xml" expression="get-property('ERROR_MESSAGE')"/>
<arg evaluator="xml" expression="get-property('ERROR_DETAIL')"/>
<arg evaluator="xml" expression="get-property('ERROR_EXCEPTION')"/>
</args>
</payloadFactory>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
<property name="ClientApiNonBlocking" scope="axis2" action="remove"/>
<send>
<endpoint>
<address uri="vfs:file:///home/omerkhalid/Documents/WSO2Test/FileWrite/Errorlog.txt"/>
</endpoint>
</send>
</faultSequence>
<endpoint>
<address uri="jms:/FileWriterResponse?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:6616&transport.jms.DestinationType=queue"/>
</endpoint>
</target>
<parameter name="transport.PollInterval">10</parameter>
<parameter name="transport.vfs.FileURI">file://home/omerkhalid/Documents/WSO2Test/FileWrite/InTest</parameter>
<parameter name="transport.vfs.MoveAfterProcess">file://home/omerkhalid/Documents/WSO2Test/FileWrite/DoneTest</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.txt</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<parameter name="serviceType">proxy</parameter>
<description/>
</proxy>
Problem Area:
The problem is in the following area of code, where i am defining my endpoint for Fault Sequence. It does create an file on that particular location but that file remains empty.
<send>
<endpoint>
<address uri="vfs:file:///home/omerkhalid/Documents/WSO2Test/FileWrite/Errorlog.txt"/>
</endpoint>
</send>
Exception:
org.apache.axis2.AxisFault: The system cannot infer the transport information from the file:///home/omerkhalid/Documents/WSO2Test/FileWrite/Errorlog.txt URL.
at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)
at org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClient.java:288)
at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:249)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:482)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:59)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:338)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:333)
at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:59)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
at org.apache.synapse.mediators.MediatorFaultHandler.onFault(MediatorFaultHandler.java:85)
at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:54)
at org.apache.synapse.endpoints.AbstractEndpoint.invokeNextFaultHandler(AbstractEndpoint.java:640)
at org.apache.synapse.endpoints.AbstractEndpoint.onFault(AbstractEndpoint.java:475)
at org.apache.synapse.endpoints.AddressEndpoint.onFault(AddressEndpoint.java:43)
at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:102)
at org.apache.synapse.core.axis2.AsyncCallback.onError(AsyncCallback.java:67)
at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:643)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Change your message in payloadFactory from your faultSequence :
The root node of your message must be : <text xmlns="http://ws.apache.org/commons/ns/payload">
and the content of this node will be the text value sent to your file