You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by De Vleeschauwer Nele <Ne...@nbb.be> on 2011/08/01 11:54:02 UTC

Question about email endpoint

Hi,

With Apache Synapse, I've configured a proxy service which receives an
xml message and sends it out via SMTP:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="emailOut"
transports="http" startOnLoad="true" trace="disable">
    <target endpoint="myMailbox" faultSequence="fault">
        <inSequence>
            <log level="custom">
                <property name="MESSAGE" value="*** message received
***"/>
            </log>
            <property name="FORCE_SC_ACCEPTED" value="true"
scope="axis2"/>
            <property name="OUT_ONLY" value="true" scope="default"/>
        </inSequence>
    </target>
</proxy>

and my endpoint:
<?xml version="1.0" encoding="UTF-8"?>
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="myMailbox">
    <address uri="mailto:nele.devleeschauwer@nbb.be"/>
    <property name="Subject" value="Message from Apache Synapse"
scope="transport"/>
</endpoint>

Although the SMTP works fine (client receives the mail message), I
always see the following exception in my log:
[2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Proxy
Service emailOut received a new message from : 10.49.1.19
[2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Message
To: /services/emailOut
[2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
SOAPAction: null
[2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
WSA-Action: null
[2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Setting
the fault-sequence to :
org.apache.synapse.mediators.base.SequenceMediator@2ee6ea
[2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Using the
anonymous in-sequence of the proxy service for mediation
[2011-08-01 11:49:01,545] DEBUG - SequenceMediator Start : Sequence
<anonymous>
[2011-08-01 11:49:01,545] DEBUG - SequenceMediator Sequence
<SequenceMediator> :: mediate()
[2011-08-01 11:49:01,545] DEBUG - LogMediator Start : Log mediator
[2011-08-01 11:49:01,545]  INFO - LogMediator MESSAGE = *** message
received ***
[2011-08-01 11:49:01,545] DEBUG - LogMediator End : Log mediator
[2011-08-01 11:49:01,545] DEBUG - PropertyMediator Start : Property
mediator
[2011-08-01 11:49:01,545] DEBUG - PropertyMediator Setting property :
FORCE_SC_ACCEPTED at scope : axis2 to : true (i.e. constant : true)
[2011-08-01 11:49:01,561] DEBUG - PropertyMediator End : Property
mediator
[2011-08-01 11:49:01,561] DEBUG - PropertyMediator Start : Property
mediator
[2011-08-01 11:49:01,561] DEBUG - PropertyMediator Setting property :
OUT_ONLY at scope : default to : true (i.e. constant : true)
[2011-08-01 11:49:01,561] DEBUG - PropertyMediator End : Property
mediator
[2011-08-01 11:49:01,561] DEBUG - SequenceMediator End : Sequence
<anonymous>
[2011-08-01 11:49:01,576] DEBUG - ProxyServiceMessageReceiver Forwarding
message to the endpoint : myMailbox
[2011-08-01 11:49:01,576] DEBUG - EndpointContext Checking if endpoint :
myMailbox currently at state ACTIVE can be used now?
[2011-08-01 11:49:01,576] DEBUG - AddressEndpoint Sending message
through endpoint : myMailbox resolving to address =
mailto:nele.devleeschauwer@nbb.be
[2011-08-01 11:49:01,576] DEBUG - AddressEndpoint SOAPAction: null
[2011-08-01 11:49:01,576] DEBUG - AddressEndpoint WSA-Action: null
[2011-08-01 11:49:01,576] DEBUG - Axis2FlexibleMEPClient Sending [add =
false] [sec = false] [rm = false] [mtom = false] [swa = false] [format =
null] [force soap11=false] [force soap12=false] [pox=false] [get=false]
[encoding=null] [to=mailto:nele.devleeschauwer@nbb.be]
[2011-08-01 11:49:01,576] DEBUG - Axis2FlexibleMEPClient Message
[Original Request Message ID :
urn:uuid:ac6b00a4-012f-4cf0-a36b-bfd5d21302e3] [New Cloned Request
Message ID : urn:uuid:2837cfd4-19f2-4785-a73a-da92c2afb61e]
[2011-08-01 11:49:01,576]  INFO - BuilderUtil OMException in
getSOAPBuilder
org.apache.axiom.soap.SOAPProcessingException: First Element must
contain the local name, Envelope , but found huisdier
	at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(St
AXSOAPModelBuilder.java:305)
	at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(
StAXSOAPModelBuilder.java:252)
	at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElem
ent(StAXSOAPModelBuilder.java:234)
	at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:2
49)
	at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(
StAXSOAPModelBuilder.java:204)
	at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPM
odelBuilder.java:154)
	at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPM
odelBuilder.java:140)
	at
org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:691
)
	at
org.apache.axis2.transport.TransportUtils.createDocumentElement(Transpor
tUtils.java:197)
	at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUti
ls.java:145)
	at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReques
t(HTTPTransportUtils.java:167)
	at
org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMe
thod(ServerWorker.java:408)
	at
org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:25
9)
	at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWor
kerPool.java:173)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:908)
	at java.lang.Thread.run(Thread.java:662)

How can I avoid this ?

And another question:
The message is always passed as attachment of the mail message ? Is it
also possible to manipulate the body of the mail message ?

Thanks for your response...





-----------------------------------------
Visit our website! http://www.nbb.be

"DISCLAIMER: The content of this e-mail message should not be
construed as binding on the part of the National Bank of Belgium
(NBB) unless otherwise and previously stated. The opinions
expressed in this message are solely those of the author and do not
necessarily reflect NBB viewpoints, particularly when the content
of this message, or part thereof, is private by nature or does not
fall within the professional scope of its author."

RE: Question about email endpoint

Posted by De Vleeschauwer Nele <Ne...@nbb.be>.
Hi Sadeep,

Thanks for the link... This really helped a lot !

-----Original Message-----
From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com] 
Sent: dinsdag 2 augustus 2011 12:06
To: user@synapse.apache.org
Subject: Re: Question about email endpoint

Hi,

You might find [1] useful. It discusses how to manipulate the body of
the
mail message.

[1]
http://heshans.blogspot.com/2010/10/send-html-format-email-from-wso2-esb
.html

Thanks,
Sadeep

On Tue, Aug 2, 2011 at 3:18 PM, De Vleeschauwer Nele <
Nele.DeVleeschauwer@nbb.be> wrote:

> I've adapted my proxy service as follows:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <proxy xmlns="http://ws.apache.org/ns/synapse" name="emailOut"
> transports="http" startOnLoad="true" trace="disable">
>    <target endpoint="myMailbox" faultSequence="fault">
>        <inSequence>
>            <log level="custom">
>                <property name="MESSAGE" value="*** message received
> ***"/>
>            </log>
>            <property name="FORCE_SC_ACCEPTED" value="true"
> scope="axis2"/>
>            <property name="OUT_ONLY" value="true" scope="default"/>
>             <property name="messageType" value="text/plain"
> scope="axis2"/>
>        </inSequence>
>    </target>
> </proxy>
>
> but this doesn't change a thing... Should I enable a particular
message
> formatter in the axis config file ?
>
> This proxy service is triggered via an incoming HTTP request. The
> payload is in xml format (content type: application/xml).
>
>
> -----Original Message-----
> From: Ruwan Linton [mailto:ruwan.linton@gmail.com]
> Sent: maandag 1 augustus 2011 17:06
> To: user@synapse.apache.org
> Subject: Re: Question about email endpoint
>
> You need to use the property mediator and set the property named
> "messageType" with value "text/plain" which will trigger the
> TextFormatter
> and the message will be in the email body. The configuration that you
> are
> having tried to write the message as a SOAP message and SOAP is always
> treated as an attachment.
>
> Also, you may do a transformation to send a text message instead of
XML
> if
> you want to.
>
> How ever the exception stack looks a bit odd to me. How do you receive
> messages to this proxy and in which format?
>
> Ruwan
>
> On Mon, Aug 1, 2011 at 3:24 PM, De Vleeschauwer Nele <
> Nele.DeVleeschauwer@nbb.be> wrote:
>
> > Hi,
> >
> > With Apache Synapse, I've configured a proxy service which receives
an
> > xml message and sends it out via SMTP:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <proxy xmlns="http://ws.apache.org/ns/synapse" name="emailOut"
> > transports="http" startOnLoad="true" trace="disable">
> >    <target endpoint="myMailbox" faultSequence="fault">
> >        <inSequence>
> >            <log level="custom">
> >                <property name="MESSAGE" value="*** message received
> > ***"/>
> >            </log>
> >            <property name="FORCE_SC_ACCEPTED" value="true"
> > scope="axis2"/>
> >            <property name="OUT_ONLY" value="true" scope="default"/>
> >        </inSequence>
> >    </target>
> > </proxy>
> >
> > and my endpoint:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <endpoint xmlns="http://ws.apache.org/ns/synapse" name="myMailbox">
> >    <address uri="mailto:nele.devleeschauwer@nbb.be"/>
> >    <property name="Subject" value="Message from Apache Synapse"
> > scope="transport"/>
> > </endpoint>
> >
> > Although the SMTP works fine (client receives the mail message), I
> > always see the following exception in my log:
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Proxy
> > Service emailOut received a new message from : 10.49.1.19
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
Message
> > To: /services/emailOut
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
> > SOAPAction: null
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
> > WSA-Action: null
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
Setting
> > the fault-sequence to :
> > org.apache.synapse.mediators.base.SequenceMediator@2ee6ea
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Using
> the
> > anonymous in-sequence of the proxy service for mediation
> > [2011-08-01 11:49:01,545] DEBUG - SequenceMediator Start : Sequence
> > <anonymous>
> > [2011-08-01 11:49:01,545] DEBUG - SequenceMediator Sequence
> > <SequenceMediator> :: mediate()
> > [2011-08-01 11:49:01,545] DEBUG - LogMediator Start : Log mediator
> > [2011-08-01 11:49:01,545]  INFO - LogMediator MESSAGE = *** message
> > received ***
> > [2011-08-01 11:49:01,545] DEBUG - LogMediator End : Log mediator
> > [2011-08-01 11:49:01,545] DEBUG - PropertyMediator Start : Property
> > mediator
> > [2011-08-01 11:49:01,545] DEBUG - PropertyMediator Setting property
:
> > FORCE_SC_ACCEPTED at scope : axis2 to : true (i.e. constant : true)
> > [2011-08-01 11:49:01,561] DEBUG - PropertyMediator End : Property
> > mediator
> > [2011-08-01 11:49:01,561] DEBUG - PropertyMediator Start : Property
> > mediator
> > [2011-08-01 11:49:01,561] DEBUG - PropertyMediator Setting property
:
> > OUT_ONLY at scope : default to : true (i.e. constant : true)
> > [2011-08-01 11:49:01,561] DEBUG - PropertyMediator End : Property
> > mediator
> > [2011-08-01 11:49:01,561] DEBUG - SequenceMediator End : Sequence
> > <anonymous>
> > [2011-08-01 11:49:01,576] DEBUG - ProxyServiceMessageReceiver
> Forwarding
> > message to the endpoint : myMailbox
> > [2011-08-01 11:49:01,576] DEBUG - EndpointContext Checking if
endpoint
> :
> > myMailbox currently at state ACTIVE can be used now?
> > [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint Sending message
> > through endpoint : myMailbox resolving to address =
> > mailto:nele.devleeschauwer@nbb.be
> > [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint SOAPAction: null
> > [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint WSA-Action: null
> > [2011-08-01 11:49:01,576] DEBUG - Axis2FlexibleMEPClient Sending
[add
> =
> > false] [sec = false] [rm = false] [mtom = false] [swa = false]
[format
> =
> > null] [force soap11=false] [force soap12=false] [pox=false]
> [get=false]
> > [encoding=null] [to=mailto:nele.devleeschauwer@nbb.be]
> > [2011-08-01 11:49:01,576] DEBUG - Axis2FlexibleMEPClient Message
> > [Original Request Message ID :
> > urn:uuid:ac6b00a4-012f-4cf0-a36b-bfd5d21302e3] [New Cloned Request
> > Message ID : urn:uuid:2837cfd4-19f2-4785-a73a-da92c2afb61e]
> > [2011-08-01 11:49:01,576]  INFO - BuilderUtil OMException in
> > getSOAPBuilder
> > org.apache.axiom.soap.SOAPProcessingException: First Element must
> > contain the local name, Envelope , but found huisdier
> >        at
> >
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(St
> > AXSOAPModelBuilder.java:305)
> >        at
> >
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(
> > StAXSOAPModelBuilder.java:252)
> >        at
> >
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElem
> > ent(StAXSOAPModelBuilder.java:234)
> >        at
> >
>
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:2
> > 49)
> >        at
> >
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(
> > StAXSOAPModelBuilder.java:204)
> >        at
> >
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPM
> > odelBuilder.java:154)
> >        at
> >
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPM
> > odelBuilder.java:140)
> >        at
> >
>
org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:691
> > )
> >        at
> >
>
org.apache.axis2.transport.TransportUtils.createDocumentElement(Transpor
> > tUtils.java:197)
> >        at
> >
>
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUti
> > ls.java:145)
> >        at
> >
>
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReques
> > t(HTTPTransportUtils.java:167)
> >        at
> >
>
org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMe
> > thod(ServerWorker.java:408)
> >        at
> >
>
org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:25
> > 9)
> >        at
> >
>
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWor
> > kerPool.java:173)
> >        at
> >
>
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
> > r.java:886)
> >        at
> >
>
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
> > va:908)
> >        at java.lang.Thread.run(Thread.java:662)
> >
> > How can I avoid this ?
> >
> > And another question:
> > The message is always passed as attachment of the mail message ? Is
it
> > also possible to manipulate the body of the mail message ?
> >
> > Thanks for your response...
> >
> >
> >
> >
> >
> > -----------------------------------------
> > Visit our website! http://www.nbb.be
> >
> > "DISCLAIMER: The content of this e-mail message should not be
> > construed as binding on the part of the National Bank of Belgium
> > (NBB) unless otherwise and previously stated. The opinions
> > expressed in this message are solely those of the author and do not
> > necessarily reflect NBB viewpoints, particularly when the content
> > of this message, or part thereof, is private by nature or does not
> > fall within the professional scope of its author."
>
>
>
>
> --
> Ruwan Linton
> Member, Apache Software Foundation; http://www.apache.org
> <http://wso2.org>
>
> phone: +94 11 282 7532
> email: ruwan@blindvision.org; cell: +94 77 341 3097
> blog: http://blog.ruwan.org
> linkedin: http://www.linkedin.com/in/ruwanlinton
> google: http://www.google.com/profiles/ruwan.linton
> tweet: http://twitter.com/ruwanlinton
>



-- 
Sadeep

Re: Question about email endpoint

Posted by Sadeep Jayasumana <ga...@gmail.com>.
Hi,

You might find [1] useful. It discusses how to manipulate the body of the
mail message.

[1]
http://heshans.blogspot.com/2010/10/send-html-format-email-from-wso2-esb.html

Thanks,
Sadeep

On Tue, Aug 2, 2011 at 3:18 PM, De Vleeschauwer Nele <
Nele.DeVleeschauwer@nbb.be> wrote:

> I've adapted my proxy service as follows:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <proxy xmlns="http://ws.apache.org/ns/synapse" name="emailOut"
> transports="http" startOnLoad="true" trace="disable">
>    <target endpoint="myMailbox" faultSequence="fault">
>        <inSequence>
>            <log level="custom">
>                <property name="MESSAGE" value="*** message received
> ***"/>
>            </log>
>            <property name="FORCE_SC_ACCEPTED" value="true"
> scope="axis2"/>
>            <property name="OUT_ONLY" value="true" scope="default"/>
>             <property name="messageType" value="text/plain"
> scope="axis2"/>
>        </inSequence>
>    </target>
> </proxy>
>
> but this doesn't change a thing... Should I enable a particular message
> formatter in the axis config file ?
>
> This proxy service is triggered via an incoming HTTP request. The
> payload is in xml format (content type: application/xml).
>
>
> -----Original Message-----
> From: Ruwan Linton [mailto:ruwan.linton@gmail.com]
> Sent: maandag 1 augustus 2011 17:06
> To: user@synapse.apache.org
> Subject: Re: Question about email endpoint
>
> You need to use the property mediator and set the property named
> "messageType" with value "text/plain" which will trigger the
> TextFormatter
> and the message will be in the email body. The configuration that you
> are
> having tried to write the message as a SOAP message and SOAP is always
> treated as an attachment.
>
> Also, you may do a transformation to send a text message instead of XML
> if
> you want to.
>
> How ever the exception stack looks a bit odd to me. How do you receive
> messages to this proxy and in which format?
>
> Ruwan
>
> On Mon, Aug 1, 2011 at 3:24 PM, De Vleeschauwer Nele <
> Nele.DeVleeschauwer@nbb.be> wrote:
>
> > Hi,
> >
> > With Apache Synapse, I've configured a proxy service which receives an
> > xml message and sends it out via SMTP:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <proxy xmlns="http://ws.apache.org/ns/synapse" name="emailOut"
> > transports="http" startOnLoad="true" trace="disable">
> >    <target endpoint="myMailbox" faultSequence="fault">
> >        <inSequence>
> >            <log level="custom">
> >                <property name="MESSAGE" value="*** message received
> > ***"/>
> >            </log>
> >            <property name="FORCE_SC_ACCEPTED" value="true"
> > scope="axis2"/>
> >            <property name="OUT_ONLY" value="true" scope="default"/>
> >        </inSequence>
> >    </target>
> > </proxy>
> >
> > and my endpoint:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <endpoint xmlns="http://ws.apache.org/ns/synapse" name="myMailbox">
> >    <address uri="mailto:nele.devleeschauwer@nbb.be"/>
> >    <property name="Subject" value="Message from Apache Synapse"
> > scope="transport"/>
> > </endpoint>
> >
> > Although the SMTP works fine (client receives the mail message), I
> > always see the following exception in my log:
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Proxy
> > Service emailOut received a new message from : 10.49.1.19
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Message
> > To: /services/emailOut
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
> > SOAPAction: null
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
> > WSA-Action: null
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Setting
> > the fault-sequence to :
> > org.apache.synapse.mediators.base.SequenceMediator@2ee6ea
> > [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Using
> the
> > anonymous in-sequence of the proxy service for mediation
> > [2011-08-01 11:49:01,545] DEBUG - SequenceMediator Start : Sequence
> > <anonymous>
> > [2011-08-01 11:49:01,545] DEBUG - SequenceMediator Sequence
> > <SequenceMediator> :: mediate()
> > [2011-08-01 11:49:01,545] DEBUG - LogMediator Start : Log mediator
> > [2011-08-01 11:49:01,545]  INFO - LogMediator MESSAGE = *** message
> > received ***
> > [2011-08-01 11:49:01,545] DEBUG - LogMediator End : Log mediator
> > [2011-08-01 11:49:01,545] DEBUG - PropertyMediator Start : Property
> > mediator
> > [2011-08-01 11:49:01,545] DEBUG - PropertyMediator Setting property :
> > FORCE_SC_ACCEPTED at scope : axis2 to : true (i.e. constant : true)
> > [2011-08-01 11:49:01,561] DEBUG - PropertyMediator End : Property
> > mediator
> > [2011-08-01 11:49:01,561] DEBUG - PropertyMediator Start : Property
> > mediator
> > [2011-08-01 11:49:01,561] DEBUG - PropertyMediator Setting property :
> > OUT_ONLY at scope : default to : true (i.e. constant : true)
> > [2011-08-01 11:49:01,561] DEBUG - PropertyMediator End : Property
> > mediator
> > [2011-08-01 11:49:01,561] DEBUG - SequenceMediator End : Sequence
> > <anonymous>
> > [2011-08-01 11:49:01,576] DEBUG - ProxyServiceMessageReceiver
> Forwarding
> > message to the endpoint : myMailbox
> > [2011-08-01 11:49:01,576] DEBUG - EndpointContext Checking if endpoint
> :
> > myMailbox currently at state ACTIVE can be used now?
> > [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint Sending message
> > through endpoint : myMailbox resolving to address =
> > mailto:nele.devleeschauwer@nbb.be
> > [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint SOAPAction: null
> > [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint WSA-Action: null
> > [2011-08-01 11:49:01,576] DEBUG - Axis2FlexibleMEPClient Sending [add
> =
> > false] [sec = false] [rm = false] [mtom = false] [swa = false] [format
> =
> > null] [force soap11=false] [force soap12=false] [pox=false]
> [get=false]
> > [encoding=null] [to=mailto:nele.devleeschauwer@nbb.be]
> > [2011-08-01 11:49:01,576] DEBUG - Axis2FlexibleMEPClient Message
> > [Original Request Message ID :
> > urn:uuid:ac6b00a4-012f-4cf0-a36b-bfd5d21302e3] [New Cloned Request
> > Message ID : urn:uuid:2837cfd4-19f2-4785-a73a-da92c2afb61e]
> > [2011-08-01 11:49:01,576]  INFO - BuilderUtil OMException in
> > getSOAPBuilder
> > org.apache.axiom.soap.SOAPProcessingException: First Element must
> > contain the local name, Envelope , but found huisdier
> >        at
> >
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(St
> > AXSOAPModelBuilder.java:305)
> >        at
> >
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(
> > StAXSOAPModelBuilder.java:252)
> >        at
> >
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElem
> > ent(StAXSOAPModelBuilder.java:234)
> >        at
> >
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:2
> > 49)
> >        at
> >
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(
> > StAXSOAPModelBuilder.java:204)
> >        at
> >
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPM
> > odelBuilder.java:154)
> >        at
> >
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPM
> > odelBuilder.java:140)
> >        at
> >
> org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:691
> > )
> >        at
> >
> org.apache.axis2.transport.TransportUtils.createDocumentElement(Transpor
> > tUtils.java:197)
> >        at
> >
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUti
> > ls.java:145)
> >        at
> >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReques
> > t(HTTPTransportUtils.java:167)
> >        at
> >
> org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMe
> > thod(ServerWorker.java:408)
> >        at
> >
> org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:25
> > 9)
> >        at
> >
> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWor
> > kerPool.java:173)
> >        at
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
> > r.java:886)
> >        at
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
> > va:908)
> >        at java.lang.Thread.run(Thread.java:662)
> >
> > How can I avoid this ?
> >
> > And another question:
> > The message is always passed as attachment of the mail message ? Is it
> > also possible to manipulate the body of the mail message ?
> >
> > Thanks for your response...
> >
> >
> >
> >
> >
> > -----------------------------------------
> > Visit our website! http://www.nbb.be
> >
> > "DISCLAIMER: The content of this e-mail message should not be
> > construed as binding on the part of the National Bank of Belgium
> > (NBB) unless otherwise and previously stated. The opinions
> > expressed in this message are solely those of the author and do not
> > necessarily reflect NBB viewpoints, particularly when the content
> > of this message, or part thereof, is private by nature or does not
> > fall within the professional scope of its author."
>
>
>
>
> --
> Ruwan Linton
> Member, Apache Software Foundation; http://www.apache.org
> <http://wso2.org>
>
> phone: +94 11 282 7532
> email: ruwan@blindvision.org; cell: +94 77 341 3097
> blog: http://blog.ruwan.org
> linkedin: http://www.linkedin.com/in/ruwanlinton
> google: http://www.google.com/profiles/ruwan.linton
> tweet: http://twitter.com/ruwanlinton
>



-- 
Sadeep

RE: Question about email endpoint

Posted by De Vleeschauwer Nele <Ne...@nbb.be>.
I've adapted my proxy service as follows:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="emailOut"
transports="http" startOnLoad="true" trace="disable">
    <target endpoint="myMailbox" faultSequence="fault">
        <inSequence>
            <log level="custom">
                <property name="MESSAGE" value="*** message received
***"/>
            </log>
            <property name="FORCE_SC_ACCEPTED" value="true"
scope="axis2"/>
            <property name="OUT_ONLY" value="true" scope="default"/>
            <property name="messageType" value="text/plain"
scope="axis2"/>
        </inSequence>
    </target>
</proxy>

but this doesn't change a thing... Should I enable a particular message
formatter in the axis config file ?

This proxy service is triggered via an incoming HTTP request. The
payload is in xml format (content type: application/xml).


-----Original Message-----
From: Ruwan Linton [mailto:ruwan.linton@gmail.com] 
Sent: maandag 1 augustus 2011 17:06
To: user@synapse.apache.org
Subject: Re: Question about email endpoint

You need to use the property mediator and set the property named
"messageType" with value "text/plain" which will trigger the
TextFormatter
and the message will be in the email body. The configuration that you
are
having tried to write the message as a SOAP message and SOAP is always
treated as an attachment.

Also, you may do a transformation to send a text message instead of XML
if
you want to.

How ever the exception stack looks a bit odd to me. How do you receive
messages to this proxy and in which format?

Ruwan

On Mon, Aug 1, 2011 at 3:24 PM, De Vleeschauwer Nele <
Nele.DeVleeschauwer@nbb.be> wrote:

> Hi,
>
> With Apache Synapse, I've configured a proxy service which receives an
> xml message and sends it out via SMTP:
> <?xml version="1.0" encoding="UTF-8"?>
> <proxy xmlns="http://ws.apache.org/ns/synapse" name="emailOut"
> transports="http" startOnLoad="true" trace="disable">
>    <target endpoint="myMailbox" faultSequence="fault">
>        <inSequence>
>            <log level="custom">
>                <property name="MESSAGE" value="*** message received
> ***"/>
>            </log>
>            <property name="FORCE_SC_ACCEPTED" value="true"
> scope="axis2"/>
>            <property name="OUT_ONLY" value="true" scope="default"/>
>        </inSequence>
>    </target>
> </proxy>
>
> and my endpoint:
> <?xml version="1.0" encoding="UTF-8"?>
> <endpoint xmlns="http://ws.apache.org/ns/synapse" name="myMailbox">
>    <address uri="mailto:nele.devleeschauwer@nbb.be"/>
>    <property name="Subject" value="Message from Apache Synapse"
> scope="transport"/>
> </endpoint>
>
> Although the SMTP works fine (client receives the mail message), I
> always see the following exception in my log:
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Proxy
> Service emailOut received a new message from : 10.49.1.19
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Message
> To: /services/emailOut
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
> SOAPAction: null
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
> WSA-Action: null
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Setting
> the fault-sequence to :
> org.apache.synapse.mediators.base.SequenceMediator@2ee6ea
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Using
the
> anonymous in-sequence of the proxy service for mediation
> [2011-08-01 11:49:01,545] DEBUG - SequenceMediator Start : Sequence
> <anonymous>
> [2011-08-01 11:49:01,545] DEBUG - SequenceMediator Sequence
> <SequenceMediator> :: mediate()
> [2011-08-01 11:49:01,545] DEBUG - LogMediator Start : Log mediator
> [2011-08-01 11:49:01,545]  INFO - LogMediator MESSAGE = *** message
> received ***
> [2011-08-01 11:49:01,545] DEBUG - LogMediator End : Log mediator
> [2011-08-01 11:49:01,545] DEBUG - PropertyMediator Start : Property
> mediator
> [2011-08-01 11:49:01,545] DEBUG - PropertyMediator Setting property :
> FORCE_SC_ACCEPTED at scope : axis2 to : true (i.e. constant : true)
> [2011-08-01 11:49:01,561] DEBUG - PropertyMediator End : Property
> mediator
> [2011-08-01 11:49:01,561] DEBUG - PropertyMediator Start : Property
> mediator
> [2011-08-01 11:49:01,561] DEBUG - PropertyMediator Setting property :
> OUT_ONLY at scope : default to : true (i.e. constant : true)
> [2011-08-01 11:49:01,561] DEBUG - PropertyMediator End : Property
> mediator
> [2011-08-01 11:49:01,561] DEBUG - SequenceMediator End : Sequence
> <anonymous>
> [2011-08-01 11:49:01,576] DEBUG - ProxyServiceMessageReceiver
Forwarding
> message to the endpoint : myMailbox
> [2011-08-01 11:49:01,576] DEBUG - EndpointContext Checking if endpoint
:
> myMailbox currently at state ACTIVE can be used now?
> [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint Sending message
> through endpoint : myMailbox resolving to address =
> mailto:nele.devleeschauwer@nbb.be
> [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint SOAPAction: null
> [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint WSA-Action: null
> [2011-08-01 11:49:01,576] DEBUG - Axis2FlexibleMEPClient Sending [add
=
> false] [sec = false] [rm = false] [mtom = false] [swa = false] [format
=
> null] [force soap11=false] [force soap12=false] [pox=false]
[get=false]
> [encoding=null] [to=mailto:nele.devleeschauwer@nbb.be]
> [2011-08-01 11:49:01,576] DEBUG - Axis2FlexibleMEPClient Message
> [Original Request Message ID :
> urn:uuid:ac6b00a4-012f-4cf0-a36b-bfd5d21302e3] [New Cloned Request
> Message ID : urn:uuid:2837cfd4-19f2-4785-a73a-da92c2afb61e]
> [2011-08-01 11:49:01,576]  INFO - BuilderUtil OMException in
> getSOAPBuilder
> org.apache.axiom.soap.SOAPProcessingException: First Element must
> contain the local name, Envelope , but found huisdier
>        at
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(St
> AXSOAPModelBuilder.java:305)
>        at
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(
> StAXSOAPModelBuilder.java:252)
>        at
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElem
> ent(StAXSOAPModelBuilder.java:234)
>        at
>
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:2
> 49)
>        at
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(
> StAXSOAPModelBuilder.java:204)
>        at
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPM
> odelBuilder.java:154)
>        at
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPM
> odelBuilder.java:140)
>        at
>
org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:691
> )
>        at
>
org.apache.axis2.transport.TransportUtils.createDocumentElement(Transpor
> tUtils.java:197)
>        at
>
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUti
> ls.java:145)
>        at
>
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReques
> t(HTTPTransportUtils.java:167)
>        at
>
org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMe
> thod(ServerWorker.java:408)
>        at
>
org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:25
> 9)
>        at
>
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWor
> kerPool.java:173)
>        at
>
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
> r.java:886)
>        at
>
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
> va:908)
>        at java.lang.Thread.run(Thread.java:662)
>
> How can I avoid this ?
>
> And another question:
> The message is always passed as attachment of the mail message ? Is it
> also possible to manipulate the body of the mail message ?
>
> Thanks for your response...
>
>
>
>
>
> -----------------------------------------
> Visit our website! http://www.nbb.be
>
> "DISCLAIMER: The content of this e-mail message should not be
> construed as binding on the part of the National Bank of Belgium
> (NBB) unless otherwise and previously stated. The opinions
> expressed in this message are solely those of the author and do not
> necessarily reflect NBB viewpoints, particularly when the content
> of this message, or part thereof, is private by nature or does not
> fall within the professional scope of its author."




-- 
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
<http://wso2.org>

phone: +94 11 282 7532
email: ruwan@blindvision.org; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton

Re: Question about email endpoint

Posted by Ruwan Linton <ru...@gmail.com>.
You need to use the property mediator and set the property named
"messageType" with value "text/plain" which will trigger the TextFormatter
and the message will be in the email body. The configuration that you are
having tried to write the message as a SOAP message and SOAP is always
treated as an attachment.

Also, you may do a transformation to send a text message instead of XML if
you want to.

How ever the exception stack looks a bit odd to me. How do you receive
messages to this proxy and in which format?

Ruwan

On Mon, Aug 1, 2011 at 3:24 PM, De Vleeschauwer Nele <
Nele.DeVleeschauwer@nbb.be> wrote:

> Hi,
>
> With Apache Synapse, I've configured a proxy service which receives an
> xml message and sends it out via SMTP:
> <?xml version="1.0" encoding="UTF-8"?>
> <proxy xmlns="http://ws.apache.org/ns/synapse" name="emailOut"
> transports="http" startOnLoad="true" trace="disable">
>    <target endpoint="myMailbox" faultSequence="fault">
>        <inSequence>
>            <log level="custom">
>                <property name="MESSAGE" value="*** message received
> ***"/>
>            </log>
>            <property name="FORCE_SC_ACCEPTED" value="true"
> scope="axis2"/>
>            <property name="OUT_ONLY" value="true" scope="default"/>
>        </inSequence>
>    </target>
> </proxy>
>
> and my endpoint:
> <?xml version="1.0" encoding="UTF-8"?>
> <endpoint xmlns="http://ws.apache.org/ns/synapse" name="myMailbox">
>    <address uri="mailto:nele.devleeschauwer@nbb.be"/>
>    <property name="Subject" value="Message from Apache Synapse"
> scope="transport"/>
> </endpoint>
>
> Although the SMTP works fine (client receives the mail message), I
> always see the following exception in my log:
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Proxy
> Service emailOut received a new message from : 10.49.1.19
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Message
> To: /services/emailOut
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
> SOAPAction: null
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver
> WSA-Action: null
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Setting
> the fault-sequence to :
> org.apache.synapse.mediators.base.SequenceMediator@2ee6ea
> [2011-08-01 11:49:01,545] DEBUG - ProxyServiceMessageReceiver Using the
> anonymous in-sequence of the proxy service for mediation
> [2011-08-01 11:49:01,545] DEBUG - SequenceMediator Start : Sequence
> <anonymous>
> [2011-08-01 11:49:01,545] DEBUG - SequenceMediator Sequence
> <SequenceMediator> :: mediate()
> [2011-08-01 11:49:01,545] DEBUG - LogMediator Start : Log mediator
> [2011-08-01 11:49:01,545]  INFO - LogMediator MESSAGE = *** message
> received ***
> [2011-08-01 11:49:01,545] DEBUG - LogMediator End : Log mediator
> [2011-08-01 11:49:01,545] DEBUG - PropertyMediator Start : Property
> mediator
> [2011-08-01 11:49:01,545] DEBUG - PropertyMediator Setting property :
> FORCE_SC_ACCEPTED at scope : axis2 to : true (i.e. constant : true)
> [2011-08-01 11:49:01,561] DEBUG - PropertyMediator End : Property
> mediator
> [2011-08-01 11:49:01,561] DEBUG - PropertyMediator Start : Property
> mediator
> [2011-08-01 11:49:01,561] DEBUG - PropertyMediator Setting property :
> OUT_ONLY at scope : default to : true (i.e. constant : true)
> [2011-08-01 11:49:01,561] DEBUG - PropertyMediator End : Property
> mediator
> [2011-08-01 11:49:01,561] DEBUG - SequenceMediator End : Sequence
> <anonymous>
> [2011-08-01 11:49:01,576] DEBUG - ProxyServiceMessageReceiver Forwarding
> message to the endpoint : myMailbox
> [2011-08-01 11:49:01,576] DEBUG - EndpointContext Checking if endpoint :
> myMailbox currently at state ACTIVE can be used now?
> [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint Sending message
> through endpoint : myMailbox resolving to address =
> mailto:nele.devleeschauwer@nbb.be
> [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint SOAPAction: null
> [2011-08-01 11:49:01,576] DEBUG - AddressEndpoint WSA-Action: null
> [2011-08-01 11:49:01,576] DEBUG - Axis2FlexibleMEPClient Sending [add =
> false] [sec = false] [rm = false] [mtom = false] [swa = false] [format =
> null] [force soap11=false] [force soap12=false] [pox=false] [get=false]
> [encoding=null] [to=mailto:nele.devleeschauwer@nbb.be]
> [2011-08-01 11:49:01,576] DEBUG - Axis2FlexibleMEPClient Message
> [Original Request Message ID :
> urn:uuid:ac6b00a4-012f-4cf0-a36b-bfd5d21302e3] [New Cloned Request
> Message ID : urn:uuid:2837cfd4-19f2-4785-a73a-da92c2afb61e]
> [2011-08-01 11:49:01,576]  INFO - BuilderUtil OMException in
> getSOAPBuilder
> org.apache.axiom.soap.SOAPProcessingException: First Element must
> contain the local name, Envelope , but found huisdier
>        at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(St
> AXSOAPModelBuilder.java:305)
>        at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(
> StAXSOAPModelBuilder.java:252)
>        at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElem
> ent(StAXSOAPModelBuilder.java:234)
>        at
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:2
> 49)
>        at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(
> StAXSOAPModelBuilder.java:204)
>        at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPM
> odelBuilder.java:154)
>        at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPM
> odelBuilder.java:140)
>        at
> org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:691
> )
>        at
> org.apache.axis2.transport.TransportUtils.createDocumentElement(Transpor
> tUtils.java:197)
>        at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUti
> ls.java:145)
>        at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReques
> t(HTTPTransportUtils.java:167)
>        at
> org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMe
> thod(ServerWorker.java:408)
>        at
> org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:25
> 9)
>        at
> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWor
> kerPool.java:173)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
> r.java:886)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
> va:908)
>        at java.lang.Thread.run(Thread.java:662)
>
> How can I avoid this ?
>
> And another question:
> The message is always passed as attachment of the mail message ? Is it
> also possible to manipulate the body of the mail message ?
>
> Thanks for your response...
>
>
>
>
>
> -----------------------------------------
> Visit our website! http://www.nbb.be
>
> "DISCLAIMER: The content of this e-mail message should not be
> construed as binding on the part of the National Bank of Belgium
> (NBB) unless otherwise and previously stated. The opinions
> expressed in this message are solely those of the author and do not
> necessarily reflect NBB viewpoints, particularly when the content
> of this message, or part thereof, is private by nature or does not
> fall within the professional scope of its author."




-- 
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
<http://wso2.org>

phone: +94 11 282 7532
email: ruwan@blindvision.org; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton