Search code examples
eclipseweb-servicesauthenticationbpelbpelxexec

Reading values from a file txt or xml


I'm developing a simple bpel process that takes data from an external file (txt or xml). In detail, i'm trying to develop a process that takes in input 2 strings (user and pass) and checks if they are in my "Account" file. If so, output return 'true', if not 'false'.

I'm using eclipse and i can't find anything that could help me. I read something about 'file adapter', but, in eclipse, palette view doesn't show this option. Any idea ?


Solution

  • There are two possibilities:

    1. If your BPEL engine supports XPath 2.0, you can use the doc() function to load an XML document and look for certain entries.

      doc("users.xml")/users/user[@id = $uid and @password = $password] should return the user node where id and password attributes match the values stored in the BPEL variables $id and $password. You can place that expression in an if activity.

    2. If your engine does not support XPath 2.0 and you need to stick to standard BPEL, you should write a simple Web service that performs the lookup. Use an invoke activity to call this Web service.