This discussion is archived
3 Replies Latest reply: Oct 9, 2013 4:02 PM by Riaan.Ingram RSS

MFL and email's subject: how to

Fairlie Newbie
Currently Being Moderated

Hi,

I'm just arrived in OSB family and some things are difficult for me.

 

I have to transform from non-xml to xml the email contents.

I have already created a service account, proxy service following the Eric Elzinga's cookbook recipes.

I can read the body contents very easily (thanks Eric!) but I do not know how to read the email's subject.

 

Do I have to create another MFL for it? Or just add other fields to Body MFL transformation file?

Someone have already done this?

 

Thanks for your help.

  • 1. Re: MFL and email's subject: how to
    Riaan.Ingram Explorer
    Currently Being Moderated

    Email transport detail is provided in the $inbound variable out of the box in OSB when you choose email transport:

     

    $inbound/ctx:transport/ctx:request/tp:headers/email:To
    $inbound/ctx:transport/ctx:request/tp:headers/email:From
    $inbound/ctx:transport/ctx:request/tp:headers/email:CC
    $inbound/ctx:transport/ctx:request/tp:headers/email:BCC
    $inbound/ctx:transport/ctx:request/tp:headers/email:Subject

     

    So you can just simply use the "Assign" activity to assign a variable to "$inbound/ctx:transport/ctx:request/tp:headers/email:Subject" (xquery) to get the subject.

  • 2. Re: MFL and email's subject: how to
    Fairlie Newbie
    Currently Being Moderated

    Hi Riaan,

    thanks for your suggestions.

    One more question please: how can I can pass this variable in a soap message?

    I have to use this variables to call another service and my request has to be in a soap message(xml format).

    Can I read them into a java class? If yes, how?

     

    (sorry for the dummies questions but It's my first time with OSB)

  • 3. Re: MFL and email's subject: how to
    Riaan.Ingram Explorer
    Currently Being Moderated

    You can use a service callout or a route to another soap web service. Before the service callout, replace or assign the contents (fn:data() or /text()) 'this' (email subject) variable into the service callout request variable or do similar into the $body variable if you use a route to call a soap web service.

     

    "The Definitive Guide to SOA: Oracle Service Bus (second edition)" is a good book to help you get started. Or you can go to the examples pages which also have tuts: https://java.net/projects/oraclesoasuite11g/pages/OSB. There is a java callout example in there which you can have a look at. 

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points