You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Sam Joseph <ga...@yha.att.ne.jp> on 2001/01/19 02:40:46 UTC

SMTP architecture

Hi,

Has anyone been playing around with the SOAP SMTP stuff?

I understand that it is supposed to route the mail stuff to an HTTP
server and then send a mail back, but I am unclear if I need to set up a
SMTP/POP3 server on my local machine.  I have access to SMTP/POP3
servers at my service provider, but without access to the SOAP classes,
these won't be able to decode the message, right? Further they won't be
able to forward the query to my local HTTP server (Tomcat on my local
machine), and they won't be able to see it, because it's not open to the
outside world - although that's just my problem.

Is it perhaps that the nature of the email sent to the mail server will
mean that it is automatically forwarded to the specified HTTP server?

Or perhaps I have to set up a mail server with classpath access to the
SOAP classes?

Thanks in advance.

CHEERS> SAM


Re: SMTP architecture

Posted by Sam Joseph <ga...@yha.att.ne.jp>.
Hi Again,

In a follow up to my own mail, I've been playing around with the SOAP SMTP
stuff.
I downloaded JAMES (the apache mail server), and got that running locally.

I then  downloaded pop3 and smtp packages from alphaworks.
Then I tried to get the thing to work with the stockquote example.
By snooping the appropriate port I found that the GetQuoteSMTP class was
sending the following data to the mail server.

HELO [192.168.0.2]
MAIL FROM:<sa...@localhost>
RCPT TO:</soap/servlet/rpcrouter>
DATA
From: sam@localhost
To: </soap/servlet/rpcrouter>
MIME-Version: 1.0
Subject: SOAP Request
Content-Type: text/xml
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:getQuote xmlns:ns1="urn:xmltoday-delayed-quotes"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<symbol xsi:type="xsd:string">MSFT</symbol>
</ns1:getQuote>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

it wasn't sending that right away, the initial MAIL FROM and RCPT TO headers
needed a little syntax modification beforeJAMES would accept them.  I'm not
sure if this is a fault with JAMES or with the SOAP/alphaworks classes as I
am no SMTP expert.

Anyway, JAMES still rejected the RCPT TO header, so I tried all manner of
permutations

@localhost
@localhost:8080
localhost
localhost:8080
http://localhost:8080/
@http://localhost:8080/
http://localhost:8080/soap/servlet/rpcrouter
@http://localhost:8080/soap/servlet/rpcrouter
/soap/servlet/rpcrouter@localhost:8080
soap/servlet/rpcrouter@localhost
rpcrouter@localhost

there are some combinations left but I got kind of sick of trying them all
:-(

what I did find was that if I stuck some other *valid* address in the RCPT
TO field then JAMES would accept the post and the rest of the SOAP message
would be passed to JAMES, and then the stock quote example would start
polling the sam@localhost pop3 account I had created.

It could certainly read from the pop3 account, as it picked up some of my
test messages, but unsurprisingly once I had removed them, nothing else was
forthcoming.

So I am getting the idea that the mail server should be trying to forward
the SMTP soap request to the HTTP server, and as a consequence the HTTP
server (and associated router) would pick up the request, process it and
then send it back to the recipient mail address so that the result can be
received and displayed.

It seems I am doing something wrong.  It also seems that a RCPT TO with the
contents </soap/servlet/rpcrouter> does not contain enough information to
specify where the message should be forwarded to, and even if it did surely
it would be trying to use port 25 to do it.  Perhaps this is a flaw in the
alphaworks code, or maybe a deficiency in the JAMES server, or maybe I am
making some crucial error somewhere.

Does the mail server perhapst need some kind of plug in that will tell it
where to forward the mail to?

Any help greatly appreciated.

CHEERS> SAM

Sam Joseph wrote:

> Hi,
>
> Has anyone been playing around with the SOAP SMTP stuff?
>
> I understand that it is supposed to route the mail stuff to an HTTP
> server and then send a mail back, but I am unclear if I need to set up a
> SMTP/POP3 server on my local machine.  I have access to SMTP/POP3
> servers at my service provider, but without access to the SOAP classes,
> these won't be able to decode the message, right? Further they won't be
> able to forward the query to my local HTTP server (Tomcat on my local
> machine), and they won't be able to see it, because it's not open to the
> outside world - although that's just my problem.
>
> Is it perhaps that the nature of the email sent to the mail server will
> mean that it is automatically forwarded to the specified HTTP server?
>
> Or perhaps I have to set up a mail server with classpath access to the
> SOAP classes?
>
> Thanks in advance.
>
> CHEERS> SAM
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


Re: SMTP architecture

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
I agree with you totally that the docs are totally inadequate. Can you
help write some docs to go into the upcoming 2.1 release?

BTW, yes of course you need two addresses - the reply address is
where the response goes back to for the requestor and the other
address is where requests are sent to.

Thanks,

Sanjiva.

----- Original Message -----
From: "Sam Joseph" <ga...@yha.att.ne.jp>
To: <so...@xml.apache.org>
Sent: Monday, January 22, 2001 12:32 AM
Subject: Re: SMTP architecture


> Hi Sanjiva,
>
> Thanks for the explanation, I really appreciate it.
>
> What you seem to be saying is that the mail server just saves the incoming
> message to the pop3 account and that the forwarding to the HTTP server
doesn't
> take place until the message has been saved and then read from the pop3
> account by the bridge.
>
> I found the HTTP-SMTP bridge org.apache.soap.server.SMTP2HTTPBridge
> I think that the docs might benefit from explaining that the bridge is
> actually a separate program that has to be setup and run on the server side
> (that much is said, but it is not clear where the bridge is, I originally
> assumed that it was part of the already running programs - rather than
> requiring a separate JVM).  Or perhaps just an inclusion of the sample
startup
> in the readme file for the stockquote example:
>
> java org.apache.soap.server.SMTP2HTTPBridge 5000 a_pop3host myname
mypassword
>  http://ahost:8080/soap/servlet/rpcrouter an_smtphost
>
> Anyway I got it all to work without a little playing around, but it seems
like
> I needed to actually create two accounts, one to receive the incoming
message
> (that the Bridge reads from) and another to receive the result (and be read
by
> the final part of the GetQuoteSMTP program).
>
> If we are hoping that other people will be able to replicate this setup, we
> might think about revising the docs, and maybe even adding a diagram to make
> it clear what infrastructure is needed.
>
> As you say, it needs reworking for async operation, and perhaps some thought
> about whether the bridge might be replaced with a mailet that called the
SOAP
> operations directly.
>
> CHEERS> SAM
>
>
> Sanjiva Weerawarana wrote:
>
> > Here's how it works: When you make a SOAP call with an SMTP
> > transport, it is sent via email to the address you give.
> >
> > On the server side, you need a SOAP engine at that mail server.
> > The solution in Apache SOAP is to have a bridge server that
> > reads off the SOAP emails (via POP3) and turns around and
> > invokes an HTTP SOAP server to actually process the request.
> > The response is then sent via email (SMTP) to the Reply-To:
> > address of the original email.
> >
> > On the client side, after sending the request the client starts
> > polling its email account to wait for the response.
> >
> > So services are only deployed on the http server; the smtp
> > bridge just reads the email and forwards it to the http-based
> > soap server.
> >
> > All of this needs to be re-thought for proper async operation;
> > the current implementation was a quick impl to verify the ability
> > to carry SOAP cleanly over SMTP and no one has done any
> > work on it since my original implementation now more than
> > 6-7 months ago!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>


Re: SMTP architecture

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
I agree with you totally that the docs are totally inadequate. Can you
help write some docs to go into the upcoming 2.1 release?

BTW, yes of course you need two addresses - the reply address is
where the response goes back to for the requestor and the other
address is where requests are sent to.

Thanks,

Sanjiva.

----- Original Message -----
From: "Sam Joseph" <ga...@yha.att.ne.jp>
To: <so...@xml.apache.org>
Sent: Monday, January 22, 2001 12:32 AM
Subject: Re: SMTP architecture


> Hi Sanjiva,
>
> Thanks for the explanation, I really appreciate it.
>
> What you seem to be saying is that the mail server just saves the incoming
> message to the pop3 account and that the forwarding to the HTTP server
doesn't
> take place until the message has been saved and then read from the pop3
> account by the bridge.
>
> I found the HTTP-SMTP bridge org.apache.soap.server.SMTP2HTTPBridge
> I think that the docs might benefit from explaining that the bridge is
> actually a separate program that has to be setup and run on the server side
> (that much is said, but it is not clear where the bridge is, I originally
> assumed that it was part of the already running programs - rather than
> requiring a separate JVM).  Or perhaps just an inclusion of the sample
startup
> in the readme file for the stockquote example:
>
> java org.apache.soap.server.SMTP2HTTPBridge 5000 a_pop3host myname
mypassword
>  http://ahost:8080/soap/servlet/rpcrouter an_smtphost
>
> Anyway I got it all to work without a little playing around, but it seems
like
> I needed to actually create two accounts, one to receive the incoming
message
> (that the Bridge reads from) and another to receive the result (and be read
by
> the final part of the GetQuoteSMTP program).
>
> If we are hoping that other people will be able to replicate this setup, we
> might think about revising the docs, and maybe even adding a diagram to make
> it clear what infrastructure is needed.
>
> As you say, it needs reworking for async operation, and perhaps some thought
> about whether the bridge might be replaced with a mailet that called the
SOAP
> operations directly.
>
> CHEERS> SAM
>
>
> Sanjiva Weerawarana wrote:
>
> > Here's how it works: When you make a SOAP call with an SMTP
> > transport, it is sent via email to the address you give.
> >
> > On the server side, you need a SOAP engine at that mail server.
> > The solution in Apache SOAP is to have a bridge server that
> > reads off the SOAP emails (via POP3) and turns around and
> > invokes an HTTP SOAP server to actually process the request.
> > The response is then sent via email (SMTP) to the Reply-To:
> > address of the original email.
> >
> > On the client side, after sending the request the client starts
> > polling its email account to wait for the response.
> >
> > So services are only deployed on the http server; the smtp
> > bridge just reads the email and forwards it to the http-based
> > soap server.
> >
> > All of this needs to be re-thought for proper async operation;
> > the current implementation was a quick impl to verify the ability
> > to carry SOAP cleanly over SMTP and no one has done any
> > work on it since my original implementation now more than
> > 6-7 months ago!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>


Re: SMTP architecture

Posted by Sam Joseph <ga...@yha.att.ne.jp>.
Hi Sanjiva,

Thanks for the explanation, I really appreciate it.

What you seem to be saying is that the mail server just saves the incoming
message to the pop3 account and that the forwarding to the HTTP server doesn't
take place until the message has been saved and then read from the pop3
account by the bridge.

I found the HTTP-SMTP bridge org.apache.soap.server.SMTP2HTTPBridge
I think that the docs might benefit from explaining that the bridge is
actually a separate program that has to be setup and run on the server side
(that much is said, but it is not clear where the bridge is, I originally
assumed that it was part of the already running programs - rather than
requiring a separate JVM).  Or perhaps just an inclusion of the sample startup
in the readme file for the stockquote example:

java org.apache.soap.server.SMTP2HTTPBridge 5000 a_pop3host myname mypassword
 http://ahost:8080/soap/servlet/rpcrouter an_smtphost

Anyway I got it all to work without a little playing around, but it seems like
I needed to actually create two accounts, one to receive the incoming message
(that the Bridge reads from) and another to receive the result (and be read by
the final part of the GetQuoteSMTP program).

If we are hoping that other people will be able to replicate this setup, we
might think about revising the docs, and maybe even adding a diagram to make
it clear what infrastructure is needed.

As you say, it needs reworking for async operation, and perhaps some thought
about whether the bridge might be replaced with a mailet that called the SOAP
operations directly.

CHEERS> SAM


Sanjiva Weerawarana wrote:

> Here's how it works: When you make a SOAP call with an SMTP
> transport, it is sent via email to the address you give.
>
> On the server side, you need a SOAP engine at that mail server.
> The solution in Apache SOAP is to have a bridge server that
> reads off the SOAP emails (via POP3) and turns around and
> invokes an HTTP SOAP server to actually process the request.
> The response is then sent via email (SMTP) to the Reply-To:
> address of the original email.
>
> On the client side, after sending the request the client starts
> polling its email account to wait for the response.
>
> So services are only deployed on the http server; the smtp
> bridge just reads the email and forwards it to the http-based
> soap server.
>
> All of this needs to be re-thought for proper async operation;
> the current implementation was a quick impl to verify the ability
> to carry SOAP cleanly over SMTP and no one has done any
> work on it since my original implementation now more than
> 6-7 months ago!


Re: SMTP architecture

Posted by Sam Joseph <ga...@yha.att.ne.jp>.
Hi Sanjiva,

Thanks for the explanation, I really appreciate it.

What you seem to be saying is that the mail server just saves the incoming
message to the pop3 account and that the forwarding to the HTTP server doesn't
take place until the message has been saved and then read from the pop3
account by the bridge.

I found the HTTP-SMTP bridge org.apache.soap.server.SMTP2HTTPBridge
I think that the docs might benefit from explaining that the bridge is
actually a separate program that has to be setup and run on the server side
(that much is said, but it is not clear where the bridge is, I originally
assumed that it was part of the already running programs - rather than
requiring a separate JVM).  Or perhaps just an inclusion of the sample startup
in the readme file for the stockquote example:

java org.apache.soap.server.SMTP2HTTPBridge 5000 a_pop3host myname mypassword
 http://ahost:8080/soap/servlet/rpcrouter an_smtphost

Anyway I got it all to work without a little playing around, but it seems like
I needed to actually create two accounts, one to receive the incoming message
(that the Bridge reads from) and another to receive the result (and be read by
the final part of the GetQuoteSMTP program).

If we are hoping that other people will be able to replicate this setup, we
might think about revising the docs, and maybe even adding a diagram to make
it clear what infrastructure is needed.

As you say, it needs reworking for async operation, and perhaps some thought
about whether the bridge might be replaced with a mailet that called the SOAP
operations directly.

CHEERS> SAM


Sanjiva Weerawarana wrote:

> Here's how it works: When you make a SOAP call with an SMTP
> transport, it is sent via email to the address you give.
>
> On the server side, you need a SOAP engine at that mail server.
> The solution in Apache SOAP is to have a bridge server that
> reads off the SOAP emails (via POP3) and turns around and
> invokes an HTTP SOAP server to actually process the request.
> The response is then sent via email (SMTP) to the Reply-To:
> address of the original email.
>
> On the client side, after sending the request the client starts
> polling its email account to wait for the response.
>
> So services are only deployed on the http server; the smtp
> bridge just reads the email and forwards it to the http-based
> soap server.
>
> All of this needs to be re-thought for proper async operation;
> the current implementation was a quick impl to verify the ability
> to carry SOAP cleanly over SMTP and no one has done any
> work on it since my original implementation now more than
> 6-7 months ago!


Re: SMTP architecture

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
Here's how it works: When you make a SOAP call with an SMTP
transport, it is sent via email to the address you give.  

On the server side, you need a SOAP engine at that mail server.
The solution in Apache SOAP is to have a bridge server that
reads off the SOAP emails (via POP3) and turns around and
invokes an HTTP SOAP server to actually process the request.
The response is then sent via email (SMTP) to the Reply-To:
address of the original email. 

On the client side, after sending the request the client starts
polling its email account to wait for the response.

So services are only deployed on the http server; the smtp
bridge just reads the email and forwards it to the http-based
soap server.

All of this needs to be re-thought for proper async operation;
the current implementation was a quick impl to verify the ability
to carry SOAP cleanly over SMTP and no one has done any
work on it since my original implementation now more than
6-7 months ago!

Sanjiva.


----- Original Message ----- 
From: "Sam Joseph" <ga...@yha.att.ne.jp>
To: "SOAP" <so...@xml.apache.org>
Cc: <sa...@watson.ibm.com>
Sent: Thursday, January 18, 2001 8:40 PM
Subject: SMTP architecture


> Hi,
> 
> Has anyone been playing around with the SOAP SMTP stuff?
> 
> I understand that it is supposed to route the mail stuff to an HTTP
> server and then send a mail back, but I am unclear if I need to set up a
> SMTP/POP3 server on my local machine.  I have access to SMTP/POP3
> servers at my service provider, but without access to the SOAP classes,
> these won't be able to decode the message, right? Further they won't be
> able to forward the query to my local HTTP server (Tomcat on my local
> machine), and they won't be able to see it, because it's not open to the
> outside world - although that's just my problem.
> 
> Is it perhaps that the nature of the email sent to the mail server will
> mean that it is automatically forwarded to the specified HTTP server?
> 
> Or perhaps I have to set up a mail server with classpath access to the
> SOAP classes?
> 
> Thanks in advance.
> 
> CHEERS> SAM
> 


Re: SMTP architecture

Posted by Sam Joseph <ga...@yha.att.ne.jp>.
Hi Again,

In a follow up to my own mail, I've been playing around with the SOAP SMTP
stuff.
I downloaded JAMES (the apache mail server), and got that running locally.

I then  downloaded pop3 and smtp packages from alphaworks.
Then I tried to get the thing to work with the stockquote example.
By snooping the appropriate port I found that the GetQuoteSMTP class was
sending the following data to the mail server.

HELO [192.168.0.2]
MAIL FROM:<sa...@localhost>
RCPT TO:</soap/servlet/rpcrouter>
DATA
From: sam@localhost
To: </soap/servlet/rpcrouter>
MIME-Version: 1.0
Subject: SOAP Request
Content-Type: text/xml
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:getQuote xmlns:ns1="urn:xmltoday-delayed-quotes"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<symbol xsi:type="xsd:string">MSFT</symbol>
</ns1:getQuote>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

it wasn't sending that right away, the initial MAIL FROM and RCPT TO headers
needed a little syntax modification beforeJAMES would accept them.  I'm not
sure if this is a fault with JAMES or with the SOAP/alphaworks classes as I
am no SMTP expert.

Anyway, JAMES still rejected the RCPT TO header, so I tried all manner of
permutations

@localhost
@localhost:8080
localhost
localhost:8080
http://localhost:8080/
@http://localhost:8080/
http://localhost:8080/soap/servlet/rpcrouter
@http://localhost:8080/soap/servlet/rpcrouter
/soap/servlet/rpcrouter@localhost:8080
soap/servlet/rpcrouter@localhost
rpcrouter@localhost

there are some combinations left but I got kind of sick of trying them all
:-(

what I did find was that if I stuck some other *valid* address in the RCPT
TO field then JAMES would accept the post and the rest of the SOAP message
would be passed to JAMES, and then the stock quote example would start
polling the sam@localhost pop3 account I had created.

It could certainly read from the pop3 account, as it picked up some of my
test messages, but unsurprisingly once I had removed them, nothing else was
forthcoming.

So I am getting the idea that the mail server should be trying to forward
the SMTP soap request to the HTTP server, and as a consequence the HTTP
server (and associated router) would pick up the request, process it and
then send it back to the recipient mail address so that the result can be
received and displayed.

It seems I am doing something wrong.  It also seems that a RCPT TO with the
contents </soap/servlet/rpcrouter> does not contain enough information to
specify where the message should be forwarded to, and even if it did surely
it would be trying to use port 25 to do it.  Perhaps this is a flaw in the
alphaworks code, or maybe a deficiency in the JAMES server, or maybe I am
making some crucial error somewhere.

Does the mail server perhapst need some kind of plug in that will tell it
where to forward the mail to?

Any help greatly appreciated.

CHEERS> SAM

Sam Joseph wrote:

> Hi,
>
> Has anyone been playing around with the SOAP SMTP stuff?
>
> I understand that it is supposed to route the mail stuff to an HTTP
> server and then send a mail back, but I am unclear if I need to set up a
> SMTP/POP3 server on my local machine.  I have access to SMTP/POP3
> servers at my service provider, but without access to the SOAP classes,
> these won't be able to decode the message, right? Further they won't be
> able to forward the query to my local HTTP server (Tomcat on my local
> machine), and they won't be able to see it, because it's not open to the
> outside world - although that's just my problem.
>
> Is it perhaps that the nature of the email sent to the mail server will
> mean that it is automatically forwarded to the specified HTTP server?
>
> Or perhaps I have to set up a mail server with classpath access to the
> SOAP classes?
>
> Thanks in advance.
>
> CHEERS> SAM
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


Re: SMTP architecture

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
Here's how it works: When you make a SOAP call with an SMTP
transport, it is sent via email to the address you give.  

On the server side, you need a SOAP engine at that mail server.
The solution in Apache SOAP is to have a bridge server that
reads off the SOAP emails (via POP3) and turns around and
invokes an HTTP SOAP server to actually process the request.
The response is then sent via email (SMTP) to the Reply-To:
address of the original email. 

On the client side, after sending the request the client starts
polling its email account to wait for the response.

So services are only deployed on the http server; the smtp
bridge just reads the email and forwards it to the http-based
soap server.

All of this needs to be re-thought for proper async operation;
the current implementation was a quick impl to verify the ability
to carry SOAP cleanly over SMTP and no one has done any
work on it since my original implementation now more than
6-7 months ago!

Sanjiva.


----- Original Message ----- 
From: "Sam Joseph" <ga...@yha.att.ne.jp>
To: "SOAP" <so...@xml.apache.org>
Cc: <sa...@watson.ibm.com>
Sent: Thursday, January 18, 2001 8:40 PM
Subject: SMTP architecture


> Hi,
> 
> Has anyone been playing around with the SOAP SMTP stuff?
> 
> I understand that it is supposed to route the mail stuff to an HTTP
> server and then send a mail back, but I am unclear if I need to set up a
> SMTP/POP3 server on my local machine.  I have access to SMTP/POP3
> servers at my service provider, but without access to the SOAP classes,
> these won't be able to decode the message, right? Further they won't be
> able to forward the query to my local HTTP server (Tomcat on my local
> machine), and they won't be able to see it, because it's not open to the
> outside world - although that's just my problem.
> 
> Is it perhaps that the nature of the email sent to the mail server will
> mean that it is automatically forwarded to the specified HTTP server?
> 
> Or perhaps I have to set up a mail server with classpath access to the
> SOAP classes?
> 
> Thanks in advance.
> 
> CHEERS> SAM
>