Thursday, May 19, 2011
Creating Business Mashups using a webservice in Webcenter PS3
Let’s build a data control from a webservice and render that on a WebCenter Spaces page.
In this example we will create a simple currency converter task flow, consuming a web service and make a data control out of it. From there we will display it on the Spaces page.
The service url is: http://www.webservicex.net/CurrencyConvertor.asmx?WSDL
Here are the Steps :
1. Logon to your Space as an admin user.
2. From you Space navigate to Manage > All Settings
3. Go to the spaces resource Management tab and navigate to the Data Controls
4. Then create a Data Control by selecting the webservice option. Select Create > Web Service. Provide the details for the data control Name (Currency Converter), Description and provide the WSDL details. Ensure you provide Proxy details as well if needed and click connect.
5. Select the method to be consumed Click Create to finish
6. Click Edit and select the "show" attribute for the Data control to be visible from the Composer/Business Dictionary
7. Create a Taskflow with a Blank Mashup style
8. Edit the task flow by selecting Edit > Edit
9. Select Add Content and Select the Mash-Ups folder
10. Select Data Controls
11. Select Currency Converter
12. Select Add > ADF Button
13. Select Conversion Rate to drill into the Currency Converter Data Control
14. Select the Add > ADF Output Formatted w/Label
15. Select ToCurrency Add > ADF Input Text w/Label
16. Select FromCurrency Add > ADF Input Text w/Label
17. Then select Close
18. Select View and choose Source
19. Select the element InputText: ConversionRate_ToCurrency element and select Edit
20. Change the Input Text Label to “To Currency” then OK
21. Repeat the process again for the FromCurrency InputText element and change the Label to “From Currency” then OK
22. Now select the panelLabelandReturn text element and change the Label to “Exchange rate” then OK
23. Finally select the commandButton and change the Text to “Get Exchange Rate” then OK
24. Select the Box element then select Edit and order the “To Currency” Input text element to the top then OK
25. Save and Close the Task Flow editor
26. Select Edit > Show to display the Task Flow in the Business Catalogue
27. Now we need to create a new page to display this task flow
28. Select Pages > Create Page, name it MashUp select a blank template
29. Select Add Content > Mash-Ups > Task Flows and choose to Add the CurrencyConverterTF task flow to the page.
30. Select Save and Close
31. Run a test and Enter USD in the To Currency field and AUD in the From Currency field and press the Get Exchange Rate button
Gotta love the value of the Australian dollar right now. Time to go shopping :-)
That was a quick tutorial on how to add webservice capabilities to your WebCenter deployment.
Many thanks to Vijaykumar Yenne for his original viewlet.
Cheers
Andrew Rosson
Perth, Western Australia
JVM settings: Handy hints
The Java Virtual Machine (JVM) is a virtual “execution engine” instance that executes the bytecodes in compiled Java class files. Java programs are compiled into a form called Java bytecodes. To the JVM, a stream of bytecodes is a sequence of instructions.
Tuning the JVM to achieve optimal application performance is one of the most critical aspects of WebLogic Server performance.
Oracle recommends to use:
• Oracle JRockit JVM for production servers
• Sun HotSpot JVM for development servers and for running other WLS utilities
Setting Weblogic Server JVM Arguments:
If we want to use different JVM after domain creation is possible by setting some WLS JVM arguments.
Start JVM with Custom JVM settings.
export JAVA_VENDOR=”Oracle”
export USER_MEM_ARGS=”-Xms512m –Xmx1g”
./startWebLogic.sh
- “Oracle” indicates that you are using the JRockit SDK. It is valid only on platforms that supportJRockit.
- “Sun” indicates that you are using the Sun SDK.
- “HP” and “IBM” indicate that you are using SDKs that Hewlett Packard or IBM have provided. These values are valid only on platforms that support HP or IBM SDKs.
Basic Sun JVM Arguments :
- -XX:NewSize (default 2 MB): Default size of new generation (in bytes)
- -XX:MaxNewSize: Maximum size of new generation (in bytes). Since 1.4, MaxNewSize is computed as a function of NewRatio.
- -XX:NewRatio (default = 2): Ratio of new to old generation sizes
- -XX:SurvivorRatio (default = 8): Ratio of Eden size to one survivor space size.
- -XX:TargetSurvivorRatio (default = 50%): Desired percentage of survivor space used after scavenge
- -XX:MaxPermSize: Size of the permanent generation
Basic JRockit JVM Arguments:
- -Xms The initial amount of heap allocated to the JVM
- -Xmx The maximum amount of heap that this JVM can allocate
- -Xns Size of the nursery generation in the heap
- -XgcPrio A priority level that helps to determine which GC algorithms the JVM will use at run time:
- throughput: Maximize application throughput
- pausetime: Minimize how long GC runs
- deterministic: Consistent response times
- -XXcompactRatio The percentage of the heap
Common JVM Issues:
Out of Memory : JVMs trigger java.lang.OutOfMemoryError when there is insufficient memory to perform some task . An out-of-memory condition can occur when there is free memory available in the heap but it is too fragmented and not contiguously located to store the object being allocated or moved (as part of a garbage collection cycle).
Memory Leak : Are a common cause of out-of-memory errors, can occur because of excessive caching.
JVM Crash: We can identify and troubleshoot a JVM crash by the diagnostic files that are generated by the JVM. A snapshot is created
that captures that state of the JVM process at the time of the error.
This binary file contains information about the entire JVM process and needs to be opened using debugging tools.
The gdb debugging tool, popular on Linux, can extract useful information from core files. The Dr.Watson tool on Windows provides similar capabilities.
On the Sun JVM, the log file is named hs_err_pid
Basic JVM Tools:
– Stack Trace
– Thread Dump
– Verbose GC
– Sun Profiler Agent
– Sun Diagnostic Tools
– JVisualVM