Table of Contents
Sub-orchestrations
- In Oracle SOA it is possible to create BPEL processes that are usable by other BPEL processes. This allows to create service compositions.
- Connect the two processes as depicted in the image.
- Think if compositing services may be helpful for the project.
SAUDE 365
- SAUDE 365 report format (xsd, xml)
- Report files are output to input folder (e.g. /tmp/input) to simulate patient arrival
- Example Java application to generate random names
- Can be extended to generate patient reports
/** Generate a random name */
public String nextName() {
int i = random.nextInt(names.size());
int j = random.nextInt(surnames.size());
return names.get(i) + " " + surnames.get(j);
}
CTT Addresses Validation
- CTT has a REST interface. This means that we can use it using the HTTP protocol.
- In your browser make a HTTP request to the following URL:
http://www.ctt.pt/pdcp/xml_pdcp?indistrito=viana+castelo&inlocal=lisboa - Observe the result. Note you can obtain more information at:
http://www.ctt.pt/fectt/wcmservlet/system/galleries/download/servicosonline/conteudosextra/man_util_xml_v15.pdf - Create a web service to validate the address using the CTT online services.
Infarmed
- Web site address: http://www.infarmed.pt/infomed/pesquisa.php
- Please do not overload the server. Make a 5 second pause between each access.
- Web scraping consists in download the HTML page and extracting the desired information by parsing the web page and relying on existing structure
- The parsing can be done with custom code or using a helper library
- Create a web service to validate the information, encapsulating the web scraping .
JDeveloper Java Web Services tutorial
Example code: HTTP Post
import java.io.*;
import java.net.*;
class HttpPost {
public static void main(String args[]) throws Exception {
if(args.length < 1) {
System.err.println("Please specify an address like http://hostname:80/cgi");
return;
}
final String address = args[0];
System.out.println("Posting to " + address);
// Construct data
String data = URLEncoder.encode("name", "UTF-8") + "=" + URLEncoder.encode("friend", "UTF-8");
//data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");
// Send data
URL url = new URL(address);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
// No caching
conn.setUseCaches (false);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
// Get the response
int responseCode = ((HttpURLConnection)conn).getResponseCode();
System.out.println("Response code is " + responseCode);
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
System.out.println("Response:");
while ((line = rd.readLine()) != null) {
System.out.println(line);
if(args.length > 1) {
FileWriter fw = new FileWriter(responseCode + "-" + args[1], true);
fw.write(line);
fw.write(System.getProperty("line.separator"));
fw.close();
}
}
wr.close();
rd.close();
}
}
Example helpful library: jsoup