webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Email Poller for text/plain

    Posted Mon October 30, 2017 06:31 AM

    Hi all,

    We are using an email poller for retrieving mails. Every time service with input “contentStream” (object type) is invoked and it works perfect until we got email with Content-Type = text/plain. For this content type service input is null (input variable contentStream is null). We tried to save pipeline and we discovered that on pipeline appeared variable, which name was email body:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <IDataXMLCoder version="1.0">
    <record javaclass="com.wm.util.Values">
    <value name="fileName">emailPoller1x</value>
    <null name="This is message body"/>
    </record>
    </IDataXMLCoder>

    When we tried to resotre pipeline, we saw variable “This is message body” with null value.

    Service getTransportInfo does not provide body content of email, but others informations are available (like “to”, “from”, dates, “subject” etc).

    Does anyone know how to handle this? Is this a bug?


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: Email Poller for text/plain

    Posted Mon October 30, 2017 03:54 PM

    How to process Email is defined in method “wm.server.net.EmailTransaction.processMessage()”.

    
    public void processMessage()
    throws Exception
    {
    String mainType = this.msg.getContentType().toLowerCase();
    String subject = this.msg.getSubject();
    
    JournalLogger.logDebugPlus(2, 26, 68, mainType, this.finalService);
    if (this.test) {
    System.out.println("Content type: " + mainType + "\n" + "Subject: " + subject);
    }
    if ((this.processMultipartMsgs) && (mainType.startsWith("multipart"))) {
    processMultiPart();
    } else if ((!this.urlEncodedBody) || (!mainType.startsWith("text/plain")) || (this.msg.getFileName() != null)) {
    processSingleMsg();
    } else {
    processNoFileMsg();
    }
    }

    When the content-type is “text/plain”, method “processNoFileMsg()” might be triggered, and a method “com.wm.app.b2b.server.CGIBinCoder.decode()” would be invoked to decode the message body.
    This decode method will tokenize the message body with separator “&” and “=” to parse the inputs. For example the message body “&param1=value1&param2=value2” would be parsed to two parameters and pass to the service.

    So I guess this decoder must retrieve all your message body as the key name, since you don’t have “=” in your message.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Email Poller for text/plain

    Posted Tue October 31, 2017 05:47 AM

    Hi Xiaowei Wang,

    Thank you very much for quick response. It gave us clue what did we make wrong. It appeared that flag indicating variable “urlEncodedBody” was set to true, which made this strange behaviour (strange to this point).

    In attachment is included configuration which shows appropiate flag, which change to false make everything works like charm.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Email Poller for text/plain

    Posted Tue October 31, 2017 02:14 PM