OK,

Sending back to the http client (with the mail part commented out)
works.

But trying to send to just the SMTP endpoint (with the http endpoint
commented out) still sends to the http client.

<definitions xmlns="http://ws.apache.org/ns/synapse";>
    <in>
        <log level="full"/>
        <filter source="get-property('To')"
regex="http://localhost:9000.*";>
            <send/>
        </filter>
    </in>

    <out>
        <!-- sent to original client -->
<!--
        <send/>
-->
        
        <!-- copy payload to mail transport -->
        <send>
            <endpoint>
                <address uri="mailto:[EMAIL PROTECTED]"/>
            </endpoint>
        </send>
    </out>
</definitions>

If I understood your last message, the header needs to be re-written,
and it does not look like it is happening implicitly based on the
endpoint.


-----Original Message-----
From: Ruwan Linton [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 21, 2007 10:16 AM
To: [email protected]
Cc: [EMAIL PROTECTED]
Subject: Re: How do I send a SMTP payload?

Yes Gary,

This is because when you do a send on a particular message context it
will
put the transfer-encoding on that message context and when you try to do
the
second send it will try to write the same header which is already
present
because this second mediator also tries to access the same message
context
(reference). At the same time there can be conflicts in this case
because
the http sender and smtp sender both tries to write headers to the same
message context.

I also suggest to try the simple scenario working first, that is to get
the
response back to the client without the mail transport. Then try to get
the
message only through the mail transport (in both cases 1 send mediator
on
the out). If you have succeeded in both here is the configuration that
you
should try to achieve both.

<out>
 <clone>
  <target><sequence><send/></sequence></target>
  <target endpoint="reference_to_mailto:endpoint"/>
 </clone>
</out>

If you encounter any problems in one of these three steps (only to
client,
only through mail, both) report them to us so that we can help you
through.

Thanks,
Ruwan

On 9/21/07, Paul Fremantle <[EMAIL PROTECTED]> wrote:
>
> Gary
>
> I think you need to use a "clone" mediator to do what you want (i.e.
> sending a copy of the response message to the mail destination). It
> also seems possible there is a bug.
>
> We have such a mediator (Ruwan wrote one), but can you try a simpler
> scenario first - just route the original request to mail?
>
> Paul
>
> On 9/20/07, Geiglein, Gary <[EMAIL PROTECTED]> wrote:
> > I thought it would be this simple, but this generates several
errors.
> >
> > 111661 [HttpClientWorker-1] ERROR ServerHandler
(ServerHandler.java:291)
> > - Unexpected HTTP protocol error : Transfer-encoding header already
> > present
> > org.apache.http.ProtocolException: Transfer-encoding header already
> > present
> >         at
> >
org.apache.http.protocol.ResponseContent.process(ResponseContent.java:66
> > )
> > ...
> >
> >
> > 111723 [HttpClientWorker-1] ERROR HttpCoreNIOSender
> > (HttpCoreNIOSender.java:456) - IO Error sending response message
> > org.apache.axis2.AxisFault: Pipe closed
> >         at
> >
org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessage
> > Formatter.java:59)
> >
> > ...
> >
> > 111801 [HttpClientWorker-1] ERROR Axis2Sender (Axis2Sender.java:104)
-
> > Unexpected error during Sending message back
> > org.apache.axis2.AxisFault: IO Error sending response message
> >
> > It looks like the mail transport is not being used, the classes that
are
> > throwing the exceptions org.apache.http.protocol.ResponseContent and
> > org.apache.axis2.transport.http.SOAPMessageFormatter are in HTTP
> > packages and I don't see anything coming from
> > org.apache.axis2.transport.mail
> >
> > The entire log files for running both with & without mail configured
in
> > synapse.xml, along with the config files can be found @
> > http://deais.nci.nih.gov/Public/Synapse/
> >
> > -----Original Message-----
> > From: Upul Godage [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, September 19, 2007 5:34 AM
> > To: [email protected]
> > Subject: Re: How do I send a SMTP payload?
> >
> > Hi Geiglein,
> >
> > You can have the synapse configuration as follows.
> >
> > <definitions xmlns="http://ws.apache.org/ns/synapse";>
> >     <!-- log all attributes of messages passing through -->
> >     <log level="full"/>
> >     <send>
> >         <endpoint>
> >             <address uri="mailto:[EMAIL PROTECTED]"/>
> >         </endpoint>
> >     </send>
> >     <!-- Send the messageto implicit destination -->
> >     <send/>
> > </definitions>
> >
> > Hope this helps.
> >
> > Upul
> >
> >
> > On 9/18/07, Geiglein, Gary <[EMAIL PROTECTED]> wrote:
> > >
> > > I understand the axis2 configuration. I guess my problem is
defining
> > the
> > > endpoint for synapse.
> > >
> > > How do I configure an endpoint to use the "mailto" transport
> > configured
> > > in axis. I would like to change the delivered synapse.xml to
receive
> > the
> > > request as configured in the quick start, then both return the
result
> > to
> > > the client, and email a copy through the configured mailto
transport
> > > sender.
> > >
> > > -----Original Message-----
> > > From: Asankha C. Perera [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, September 18, 2007 3:55 AM
> > > To: [email protected]
> > > Subject: Re: How do I send a SMTP payload?
> > >
> > > Hi Geiglein
> > >
> > > You need to enable the mail transport in your axis2.xml by
> > uncommenting
> > > the following and configuring the elements according to your
> > > environment. Also check the following links for more information.
From
> > > within Synapse, you just use a mail EPR to send it via the mail
> > > transport.
> > >
> > > Let me know if you run into any issues
> > > asankha
> > >
> > > http://ws.apache.org/axis2/1_3/mail-configuration.html
> > > http://wso2.org/library/2537
> > >
> > >     <!-- Mail Transport Listener  -->
> > >     <!-- This is a sample configuration. It assumes a mail server
> > > running in localhost.
> > >          Listener pops  messages that comes to the email address
> > > [EMAIL PROTECTED] Users
> > >          password is red. Listener connect to the server every
3000
> > > milliseconds.
> > >          Parameters with "transport." prefix is Axis2 specific.
Others
> > > are all from Java Mail API.
> > >          http://people.apache.org/~pzf/SMTPBase64Binding-0.2.html
> > >      -->
> > >    <!--<transportReceiver name="mailto"
> > > class="org.apache.axis2.transport.mail.SimpleMailListener">
> > >         <parameter name="mail.pop3.host">localhost</parameter>
> > >         <parameter name="mail.pop3.user">red</parameter>
> > >         <parameter name="mail.store.protocol">pop3</parameter>
> > >         <parameter
name="transport.mail.pop3.password">red</parameter>
> > >         <parameter
> > > name="transport.mail.replyToAddress">[EMAIL PROTECTED]</parameter>
> > >         <parameter
name="transport.listener.interval">3000</parameter>
> > >     </transportReceiver>-->
> > >
> > > ......
> > >     <!-- Mail Transport Sender  -->
> > >     <!--Only need to uncomment the sender. Configuration is
achieved
> > > with every client.
> > >         At any instant mail host should be given. Sample
configuration
> > > has been given.
> > >
http://people.apache.org/~pzf/SMTPBase64Binding-0.2.html-->
> > >     <!-- ================================================= -->
> > >     <!--<transportSender name="mailto"
> > > class="org.apache.axis2.transport.mail.MailTransportSender">
> > >         <parameter name="mail.smtp.host">localhost</parameter>
> > >     </transportSender>-->
> > >
> > >
> > >
> > > Geiglein, Gary wrote:
> > > > The introduction says that you support SMTP but I don't see
anything
> > > in
> > > > the documentation, examples, or tests to give a clue how to set
this
> > > up.
> > > >
> > > >
> > > >
> > >
> > >
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> [EMAIL PROTECTED]
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to