The SMTP listener is written as a SMTP event sink, as the SMTP Service processes the SMTP protocol, it can raise events to components that are configured to receive such events. The listener uses the OnArival event to examine the payload, pass the SOAP request off to the dispatcher, and generate a new email with the response.
cscript smtpreg.vbs /add 1 OnArrival soapListener 4s4c.smtpSoap "rcpt firstname.lastname@example.org"the 1 (after /add) is the virtual SMTP service, if you have the default single SMTP server install, this will be fine, if you have installed multiple virtual services, you'll need to select the correct one here. The last item "rcpt email@example.com" is a filter, the event will only be generated when the message passes this filter, in this case, the email must be addressed to firstname.lastname@example.org. You should replace this with the correct address for your installation.
cscript smtpreg.vbs /remove 1 OnArrival soapListeneryou can use the following to display the registered sinks
cscript smtpreg.vbs /enumThe SMTP listener expects to find the config.xml file in the same directory as the smtpSoap.dll (typically 4s4c\smtp)
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'> <SOAP-ENV:Body> <m:Add xmlns:m="http://simon.fell.com/calc"> <a>16</a> <b>26</b> </m:Add> </SOAP-ENV:Body> </SOAP-ENV:Envelope>and it should email you back the response.
<?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:AddResponse xmlns:m="http://simon.fell.com/calc"> <added xsi:type="xsd:int">42</added> </m:AddResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>