Friday, March 23, 2012

OSB - Design Time Considerations

(From http://www.art2dec.com/documentation/docs/fmw11g1114documentation/core.1111/e10108/osb.htm)


Design Time Considerations for Proxy Applications

Consider the following design configurations for proxy applications based on your OSB usage and use case scenarios:
  • Avoid creating many OSB context variables that are used just once within another XQuery
    Context variables created using an Assign action are converted to XmlBeans and then reverted to the native XQuery format for the next XQuery. Multiple "Assign" actions can be collapsed into a single Assign action using a FLWOR expression. Intermediate values can be created using "let" statements. Avoiding redundant context variable creation eliminates overheads associated with internal data format conversions. This benefit has to be balanced against visibility of the code and reuse of the variables.
  • Transforming contents of a context variable such as $body.
    Use a Replace action to complete the transformation in a single step. If the entire content of $body is to be replaced, leave the XPath field blank and select "Replace node contents". This is faster than pointing to the child node of $body (e.g. $body/Order) and selecting "Replace entire node". Leaving the XPath field blank eliminates an extra XQuery evaluation.
  • Use $body/*[1] to represent the contents of $body as an input to a Transformation (XQuery / XSLT) resource.
    OSB treats "$body/*[1]" as a special XPath that can be evaluated without invoking the XQuery engine. This is faster than specifying an absolute path pointing to the child of $body. A general XPath like "$body/Order" must be evaluated by the XQuery engine before the primary transformation resource is executed.
  • Enable Streaming for pure Content-Based Routing scenarios.
    Read-only scenarios such as Content-Based Routing can derive better performance from enabling streaming. OSB leverages the partial parsing capabilities of the XQuery engine when streaming is used in conjunction with indexed XPaths. Thus, the payload is parsed and processed only to the field referred to in the XPath. Other than partial parsing, an additional benefit for read-only scenarios is that streaming eliminates the overhead associated with parsing and serialization of XmlBeans.
    The gains from streaming can be negated if the payload is accessed a large number of times for reading multiple fields. If all fields read are located in a single subsection of the XML document, a hybrid approach provides the best performance. (See "Design Considerations for XQuery Tuning" for additional details.)
    The output of a transformation is stored in a compressed buffer format either in memory or on disk. Therefore, streaming should be avoided when running out of memory is not a concern.
  • Set the appropriate QOS level and transaction settings.
    Do not set XA or Exactly-Once unless the reliability level required is once and only once and its possible to use the setting (it is not possible if the client is a HTTP client). If OSB initiates a transaction, it is possible to replace XA with LLR to achieve the same level of reliability.
    OSB can invoke a back end HTTP service asynchronously if the QOS is "Best- Effort". Asynchronous invocation allows OSB to scale better with long running back-end services. It also allows Publish over HTTP to be truly fire-and-forget.
  • Disable or delete all log actions.
    Log actions add an I/O overhead. Logging also involves an XQuery evaluation which can be expensive. Writing to a single device (resource or directory) can also result in lock contentions.


Design Considerations for XQuery Tuning

OSB uses XQuery and XPath extensively for various actions like Assign, Replace, and Routing Table. The following XML structure ($body) is used to explain XQuery and XPath tuning concepts:
<soap-env:Body>
<Order>
<CtrlArea>
<CustName>Mary</CustName>
</CtrlArea>
<ItemList>
<Item name="ACE_Car" >20000 </Item>
<Item name=" Ext_Warranty" >1500</Item>
…. a large number of items
</ItemList>
<Summary>
<Total>70000</Total>
<Status>Shipped</Status>
<Shipping>My Shipping Firm </Shipping>
</Summary>
</Order>
</soap-env:Body>
  • Avoid the use of double front slashes ("//") in XPaths.
    $body//CustName while returning the same value as $body/Order/CtrlArea/CustName will perform a lot worse than the latter expression. "//" implies all occurrences of a node irrespective of the location in an XML tree. Thus, the entire depth and breadth of the XML tree has to be searched for the pattern specified after a "//". Use "//" only if the exact location of a node is not known at design time.
  • Index XPaths where applicable.
    An XPath can be indexed by simply adding "[1]" after each node of the path. XQuery is a declarative language and an XPath can return more than one node; it can return an array of nodes. $body/Order/CtrlArea/CustName implies returning all instances Order under $body and all instances of CtrlArea under Order. Therefore, the entire document has to be read in order to correctly process the above XPath. If you know that there is a single instance of Order under $body and a single instance of CtrlArea under Order, we could rewrite the above XPath as $body/Order[1]/CtrlArea[1]/CustName[1].
    The second XPath implies returning the first instances of the child nodes. Thus, only the top part of the document needs to be processed by the XQuery engine resulting in better performance. Indexing is key to processing only what is needed.
    Note:
    Indexing should not be used when the expected return value is an array of nodes. For example, $body/Order[1]/ItemList[1]/Item returns all "Item" nodes, but $body/Order[1]/ItemList[1]/Item[1] only returns the first item node. Another example is an XPath used to split a document in a "for" action.
  • Extract frequently used parts of a large XML document as intermediate variables within a FLWOR expression
    An intermediate variable can be used to store the common context for multiple values. Sample XPaths with common context:
    $body/Order[1]/Summary[1]/Total, $body/Order[1]/Summary[1]/Status,$body/Order[1]/Summary[1]/Shipping
    
    The above XPaths can be changed to use an intermediate variable:
    let $summary := $body/Order[1]/Summary[1]
    $summary/Total, $ summary/Status, $summary/Shipping
    
    Using intermediate variables consumes more memory but reduces redundant XPath processing.
  • Using a Hybrid Approach for read-only scenarios with Streaming
    The gains from streaming can be negated if the payload is accessed a large number of times for reading multiple fields. If all fields read are located in a single subsection of the XML document, a hybrid approach provides the best performance. The hybrid approach includes enabling streaming at the proxy level and Assigning the relevant subsection to a context variable, The individual fields can then be accessed from this context variable.
    The fields "Total" and "Status" can be retrieved using three Assign actions:
    Assign "$body/Order[1]/Summary[1]" to "foo"
    Assign "$foo/Total" to "total"
    Assign "$foo/Status" to "total"

Thursday, March 01, 2012

XML Schema - Structure Style

XML Schema  Design Pattern: Russian Doll, Salami Slice, Venetian Blind, and Garden of Eden

Russian Doll
The Russian Doll design approach has a schema structure mirroring the instance document structure, e.g., declare a Book element and within it declare a Title element followed by a Publisher element:

<xsd:element name="Book">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Publisher" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</element>

The instance document has all its components bundled together. Likewise, the schema is designed to bundle together all its element declarations.


Salami Slice
Salami Slice design disassembles the instance document into its individual components. In the schema, we define each component (as an element declaration), and then assemble them together:


<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Publisher" type="xsd:string"/>
<xsd:element name="Book">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="Title"/>
<xsd:element ref="Publisher"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>


Note how the schema declared each component individually (Title, and Publisher) and then assembled them together in the creation of the Book component


Venetian Blind

Similar to the Russian Doll approach in that they both use a single global element.  The Venetian Blind approach describes a modular approach by naming and defining all type definitions globally (as opposed to the Salami Slice approach which declares elements globally and types locally).  Each globally defined type describes an individual "slat" and can be reused by other components.  In addition, all the locally declared elements can be namespace qualified or namespace unqualified (the slats can be "opened" or "closed") depending on the elementFormDefault attribute setting at the top of the schema.  If the namespace is unqualified then the local elements in the instance document must not be qualified with the prefix of the namespace.


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="TargetNamespace" xmlns:TN="TargetNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
   <xs:element name="Book" type="TN:BookType" maxOccurs="unbounded"/>
   <xs:complexType name="BookType">
       <xs:sequence>
           <xs:element name="Title" type="xsd:string"/>
           <xs:element name="Publisher"type="xsd:string"/>
           <xs:element name="PeopleInvolved" type="TN:PeopleInvolvedType" maxOccurs="unbounded"/>
       </xs:sequence>
   </xs:complexType>
   <xs:complexType name="PeopleInvolvedType">
       <xs:sequence>
           <xs:element name="Author"type="xsd:string"/>
       </xs:sequence>
   </xs:complexType>
</xs:schema>




Garden of Eden
The Garden of Eden design is a combination of Venetian Blind and Salami Slice. You define all the elements and types in the global namespace and refer to the elements as required.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="TargetNamespace" xmlns:TN="TargetNamespace"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
   <xs:complexType name="BookType">
       <xs:sequence>
           <xs:element ref="Title"/>
           <xs:element ref="Publisher"/>
           <xs:element ref="PeopleInvolved" maxOccurs="unbounded"/>
       </xs:sequence>
   </xs:complexType>
   <xs:complexType name="PeopleInvolvedType">
       <xs:sequence>
           <xs:element ref="Author"/>
       </xs:sequence>
   </xs:complexType>
   <xsd:element name="PeopleInvolved type="TN:PeopleInvolvedType"/>
   <xs:element name="Title" type="xsd:string"/>
   <xs:element name="Publisher"type="xsd:string"/>
   <xs:element name="Author"type="xsd:string"/>
   <xs:element name="Book" type="TN:BookType" maxOccurs="unbounded"/>
</xs:schema>

Because it exposes all its elements and types globally, Garden of Eden, like Salami Slice, is completely reusable. However, because Garden of Eden exposes multiple elements as global ones, there are many potential root elements.



Tuesday, February 14, 2012

BPEL - XSL testing in SOA Suite

In SOA suite, we need to use XSL doing transformation. After the mapping in XSL, by right click on the white space in the middle of mapping, a popup menu will show up. Click the 'Test", a Test XSL Map window pops up. By this window, you can generate source XML and target XML to test the transformation.


If you confirm the default setting is correct, click the OK button to see the testing result. If there is any error, the transformation will be failed and the target XML will not be able to be generated.

Friday, February 10, 2012

Abstract WSDL vs. Concrete WSDL

Abstract WSDL(definitions )

An Abstract WSDL contains only Messages, PortTypes, and Operations
Abstract WSDL consists of the structure of the message that is like what operation, what is the input, what is the ouput and what is the fault message used by each operation to communicate with the web service, and their format.
An abstract WSDL document describes what the web service does, but not how it does it or how to contact it. An abstract WSDL document defines: the operations provided by the web service.


Concrete WSDL(implementation)
Concrete WSDL has all the things that the abstract wsdl has in addition it has transport(http,jms) details to tell how the web service communicates and where you can reach it.  A concrete WSDL document contains the abstract WSDL definitions, and also defines: the communication protocols and data encodings used by the web service, the port address that must be used to contact the web service. SOAP clients must retrieve the concrete WSDL file before sending a SOAP request to the service.


Abstract WSDL:- Used on server side,contains request,response and type of operation performed.
Concrete WSDL:- Used on client side,contains abstract wsdl and transport used.

Thursday, February 09, 2012

BPEL - How to handle an embeded XML message in a fault

In the development, the third part service returns a fault with a XML as a fault detail.
In order to get the real error message, I have to parse this XML to get the error code and error message.

In SOA Suite, there is a function named as parseXML.

parseXML
This function parses a string to a DOM element.
Signature: 
oratext:parseXML(contentString)
Arguments: 
contentString - The string that this function parses to a DOM element.
Property IDs: 
namespace-uri: http://schemas.oracle.com/xpath/extension
namespace-prefix: oratext

First, I need to get the XML message in the element <WL_FAULT_DETAIL>. The code is the follow. By this, I will be able to get a XML element <WL_FAULT_DETAIL>, which contains a XML string.
oraext:parseXML($RuntimeFault.detail)

The follow code will parse the XML string held by element <WL_FAULT_DETAIL> to a XML.
oraext:parseXML(oraext:parseXML($RuntimeFault.detail))

The above expression means:
1. Parse the detail to a XML and this XML contains another XML string like the follow.
<ser:ServiceFault xmlns:ser="http://rci.rogers.com/schemas/ServiceFault"><ser:Error id="1" lang="en"><ser:ErrorCode>SYSTEM FAILURE</ser:ErrorCode><ser:Description>[com.bea.nonxml.common.MFLException.create(MFLException.java:221) at com.bea.nonxml.common.MFLException.create(MFLException.java:344) at com.bea.nonxml.readers.NonXMLReaderVisitor.nextToken(NonXMLReaderVisitor.java:155) at com.bea.nonxml.readers.TokenNonXMLReader.nextToken(TokenNonXMLReader.java:44) at com.bea.wli.variables.util.ProcessXMLTokenReader.next(ProcessXMLTokenReader.java:56) at com.bea.wli.variables.util.TokenSourceSerializer.process(TokenSourceSerializer.java:284) at com.bea.wli.variables.ProcessXML.storeXML(ProcessXML.java:338) at com.bea.wli.variables.ProcessXML.storeTokenSource(ProcessXML.java:349) at com.bea.wli.variables.ProcessXML.&lt;init>(ProcessXML.java:124) at com.bea.wli.variables.XmlObjectVariableFactory.createProxy(XmlObjectVariableFactory.java:332) at com.bea.wli.variables.XmlObjectVariableFactory.createProxy(XmlObjectVariableFactory.java:298) at com.bea.wli.variables.MflObject.convertToXmlObject(MflObject.java:299) 
...
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) a...]</ser:Description><ser:Value>RSSP</ser:Value></ser:Error></ser:ServiceFault>.

2. Pass the above text as a string to parseXML to get another XML and the root element will be <ser:ServiceFault>.

Then, it will be very esay to get the error code and error message by getChildElement function.
Error Code is
ora:getChildElement(ora:getChildElement(oraext:parseXML(oraext:parseXML($RuntimeFault.detail)),1),1)
Error Message is
ora:getChildElement(ora:getChildElement(oraext:parseXML(oraext:parseXML($RuntimeFault.detail)),1),2)

Tuesday, February 07, 2012

OSB - System Error Code - BEA-38000x

Server found but service not available, a BEA-380000 error code will be got with Not Found in description:

<con:fault   xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-380000</con:errorCode>
<con:reason>Not Found</con:reason>
<con:location>
<con:node>RouteNode1</con:node>
<con:path>response-pipeline</con:path>
</con:location>
</con:fault>

Server not running on same port, a BEA-380000 error code will be got with Socket Closed in description:

<con:fault   xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-380000</con:errorCode>
<con:reason>General runtime error: Socket Closed</con:reason>
<con:location>
<con:node>RouteNode1</con:node>
<con:path>request-pipeline</con:path>
</con:location>
</con:fault>

Timeout set on Business Service triggering (Target service still processing and Socket gets closed because of preconfigured timeout value on BS), a BEA-380000 error code will be got with SocketTimeOut exception stacktrace in Description.

<con:fault   xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-380000</con:errorCode>
<con:reason>
[WliSbTransports:381304]Exception in HttpOutboundMessageContext.RetrieveHttpResponseWork.run: java.net.SocketTimeoutException
java.net.SocketTimeoutException
 at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse$SocketTimeoutNotification.<clinit>(AsyncResponseHandler.java:551)
 at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse.handleTimeout(AsyncResponseHandler.java:396)
 at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse.timeout(AsyncResponseHandler.java:502)
 at weblogic.socket.SocketMuxer$TimerListenerImpl.timerExpired(SocketMuxer.java:1052)
 at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
 at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
</con:reason>
<con:location>
<con:node>RouteNode1</con:node>
<con:path>response-pipeline</con:path>
</con:location>
</con:fault>

Timeout while obtaining connection to remote server, a BEA-380000 error code will be got with Connect Timed Out in Description.

<con:fault   xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-380000</con:errorCode>
<con:reason>General runtime error: connect timed out</con:reason>
<con:location>
<con:node>RouteNode1</con:node>
<con:path>request-pipeline</con:path>
</con:location>
</con:fault>

OSB got some exception from the routing, a fault with error code BEA-380001 and message Internal Server Error will be created and save in fault.
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
  <con:errorCode>BEA-380001</con:errorCode>
  <con:reason>Internal Server Error</con:reason>
  <con:location>
    <con:node>Route to RoutingFaultHandlingBusinessService</con:node>
    <con:path>response-pipeline</con:path>
  </con:location>

</con:fault>

OSB cannot connect to service provider
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
  <con:errorCode>BEA-380002</con:errorCode>
  <con:reason>Tried all: '1' addresses, but could not connect over HTTP to server: '10.9.232.68', port: '8888'</con:reason>
  <con:location>
    <con:node>EntryPipelinePairNode4Entitlements</con:node>
    <con:pipeline>EntryPipelinePairNode4Entitlements_request</con:pipeline>
    <con:stage>RequestStage4Entitlements</con:stage>
    <con:path>request-pipeline</con:path>
  </con:location>

</con:fault>>


The follow message will be help on the problem investigation.
fn-bea:inlinedXML($body/soap-env:Fault/detail)

References
http://docs.tpu.ru/docs/oracle/en/fmw/11.1.1.6.0/apirefs.1111/e15034/TransportKernel.html
http://docs.tpu.ru/docs/oracle/en/fmw/11.1.1.6.0/apirefs.1111/e15034/toc.htm
http://docs.oracle.com/cd/E13171_01/alsb/docs25/consolehelp/errorcodes.html
http://docs.oracle.com/cd/E13171_01/alsb/docs25/consolehelp/errorcodes.html


Thursday, February 02, 2012

Subversion for Oracle WebLogic workshop.

Reference http://blogs.oracle.com/simonthorpe/entry/subversion_source_control_in_o

Now that the server is up and running, I want to enable my development environment to use it. I have installed on my workstation the 10g release of Workshop for Weblogic. You have two choices for this environment, Subclipse and Subversive. I decided on Subclipse for no other reason than it was listed first :)

Before we do anything with Workshop, I actually ran into a bug which limits the ability to install Subclipse via the "Software Updates" mechanism directly in the IDE. There is a workaround for this problem detailed below.

Comment out the com.* import lines in your %BEA_HOME%\wlportal_10.3\eclipse\features\com.bea.wlp_10.3.0\feature.xml, like this:


<requires>
<import plugin="org.eclipse.core.runtime" version="3.3" match="compatible"/>
<import plugin="org.eclipse.ui" version="3.3" match="compatible"/>
<!--
<import feature="com.m7.nitrox" version="1.0.20" match="compatible"/>
<import feature="com.bea.workshop.cmdline.feature" version="1.0.30" match="compatible"/>
<import feature="com.bea.workshop.common.feature" version="1.1.40" match="compatible"/>
<import feature="com.bea.workshop.upgrade81.feature" version="1.0.30" match="compatible"/>
<import feature="com.bea.workshop.web.feature" version="1.0.20" match="compatible"/>
<import feature="com.bea.workshop.wls.feature" version="1.1.30" match="compatible"/>
<import feature="com.bea.workshop.xmlbeans.feature" version="1.0.30" match="compatible"/>
-->
</requires>



Then restart Workshop
Once you've done this follow these instructions to download and install the subversion client.
Start Workshop for WebLogic and go to "Help > Software Updates > Find and Install..." then select Search for new features to install. Click on New Remote Site and enter;
  • Name = subclipse 1.6
  • URL = http://subclipse.tigris.org/update_1.6.x
Once added, ensure that this site is the only one checked in the sites to include in the search and hit Finish. You will be presented with a tree to choose the components, I selected the following;
workshop_subclipse01.gif

Agree to the licenses

workshop_subclipse02.gif

Accept the optional component;

workshop_subclipse03.gif

Finally hit finish to install everything. Note these are not signed packages so you'll need to agree also to install the unsigned components. At the end you'll be asked to restart Workshop.

workshop_subclipse04.gif

Checkout test project from subversion in Workshop for WebLogic


Ok, nearly there. Now its time to checkout that test repository I created during the server setup.
In Workshop go to "File > New > Other" and in the resulting dialog find the SVN section and choose Checkout Projects from SVN.


workshop_subclipse05.gif


Select Create a new repository location. It now asks for the URL to the server, remember this is in the format SVN://servername/respository my example is shown below. The client will attempt to connect after which you can select the URL to get to the Check Out As dialog.


workshop_subclipse06.gif


The check out dialog now asks what you want to do with the project. If you want you can create a new project using the Workshop's wizard. However I just wanted to add a vanilla project so selected Check out as a project in the workspace, like below and hit Finish. It also warns me that i'm checking out the entire root which is fine for this test.


workshop_subclipse07.gif


You will now have an empty project folder in Workshop. You can take a look at all the version control options now by right clicking on the project and selecting the Team menu. Here you have access to all the branching, merging etc features.

Thursday, January 26, 2012

OSB - How to change the logging level

Problem:
I created a proxy service and added a Log action to log out the message body, but I didn't see the log on WebLogic console.

Solution:
The problem is related with log level as the default level is higher than info level. Change the log level will solve  it.

1. Enter the WSL admin console
2. Click on Environment->Servers
3. Click on Admin Server (or the appropriate server name of yours)
4. Select Logging tab
5. Click Advanced
6. Set Severity Level of Standard Out to Debug.
7. Click Save

After that, maybe a restart is needed.

OSB - XQuery expression validation failed.

Problem:
OSB fault cannot be used directly in exception hanlder and got an error message as "Xquery expression validation failed: The variable "fault" cannot be used here. "

Solution:
In the exception handler, first use "Assign" to assign the $fault to a variable, e.g. $myFault, then you can use the variable as what you need.

Friday, January 20, 2012

BPEL - Handle variables in a 'Assign'

Recently, I worked on a project and used array to save all of exceptions catched in a loop. I set the value to the array used a variable as index, but it doesn't work. I tested it with a number directly, it works well. By the colleague help, I eventually fixed this issue and make the array work with a variable as index.

The tricky thing is the table on the edit assign supports right click and can pop up a menu. The menu is the magic.


From the menu, select the insertMissingToData, then the array setting will work.
The change to the element is
<copy bpelx:insertMissingToData="yes">

This is not the only tricky thing as it is not only apply to the variable in an array, for any variable is same if the XML document is not initialized by some operation already. You have to set insertMissingToData="yes".

Another tricky thing is the generated XML. The order of XML elements is related with the order of assigning.

Monday, November 21, 2011

Using Preference in Oracle SOA 11g

In the Oracle SOA 11g, how can we config the timeout of a callback service at runtime? Where can we put these property? A preferences in composite.xml will solve these questions in BPEL process.


Where to add?
In the composite.xml, locate the component element.

  <component name="SubmitOrder" version="2.0">
    <implementation.bpel src="SubmitOrder.bpel"/>
    <property name="bpel.preference.timeout">PT90S</property>
  </component>


Then we can use the function ora:getPreference(preferenceName) in a bpel process.

Note: The preference have a prefix and you doesn't need it when you reference it. The prefix is 'bpel.preference'.

How to config it in production?
In Oracle SOA Suite 11g, we can change the value of prefences with Enterprise Manager, which url is http://hostname:port/em.

1. Find the SOA domain, in my example, it is Farm_soa_domain\Weblogic Domain\soa_domain
2. Right click on the domain name and select ‘System MBean Browser’ from the popup menu.
4. From the right frame, locate your component. The navigate path is
Application Defined MBeans\oracle.soa.config\Server:{server name}\SCAComposite\{project name}\SCAComposite.SCAComponent\{component name}.

5. Click on the Attribute 'Properties', the preference will be displayed.

You can modified it and apply the new value to that property.

Monday, October 17, 2011

What does BPM/BPMN add to SOA Suite?

Oracle has just released Oracle SOA Suite and Oracle BPM Suite 11.1.1.4 (often referred to as ‘Patch Set 3,’) the second release that includes comprehensive support for both Business Process Modeling Notation (BPMN) and Business Process Execution Language (BPEL) for modeling and executing business processes.


For the detail, you can find at http://redstack.wordpress.com/2011/01/15/what-bpm-adds-to-soa-suite/.

Thursday, October 13, 2011

Calling Java Classes from SOA Suite 11g

(From http://niallcblogs.blogspot.com/2009/11/calling-java-classes-from-soa-suite-11g.html)

Essentially the same procedure, from a development perspective, as in 10g -
but under the hood we're using the 11g Infrastructure layer.

The Oracle documentation can be found at
http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10224/bp_java.htm#BABCBEJJ

Here's a simple example based on WSDL Java binding, later posts will cover bpel:exec etc. -

1. Create a generic Application/Project in Jdev 11g

1.1. Add 2 classes - Cust & Greeting

Cust -

package cccwsif;

public class Cust {

private String custName1;
private String custName2;
private String custXMASgreeting;

public Cust() {
super();
}

public void setCustName1(String custName1) {
this.custName1 = custName1;
}

public String getCustName1() {
return custName1;
}

public void setCustName2(String custName2) {
this.custName2 = custName2;
}

public String getCustName2() {
return custName2;
}

public void setCustXMASgreeting(String custXMASgreeting) {
this.custXMASgreeting = custXMASgreeting;
}

public String getCustXMASgreeting() {
return custXMASgreeting;
}
}

Greeting - 

package cccwsif;

public class Greeting {
public Greeting() {
super();
}

public Cust XMASgreet(Cust c){
String g = "Happy Christmas " + c.getCustName1() + " " +
c.getCustName2();
c.setCustXMASgreeting(g);
return c;
}
}

1.2. expose Greeting as a Web Service
1.2.1. Right-mouse click on Greeting
1.2.2. Then select "Create Web Service..."


1.2.3. Accept defaults for all steps up until step 9.
1.2.4. Additional Classes --> Include "Cust" class


1.2.5. open the wsdl file and set nillable=false


1.2.6. open the GreetingService-java-wsdl-mapping.xml file
1.2.7. check the mapping order

1.3. Add the Java Binding to the WSDL
1.3.1. Open the wsdl in "Design" mode
1.3.2. Click the + by Bindings


1.3.3. Click the Map button
1.3.4. select the Cust class


1.3.5. Amend the Service entry in the WSDL as follows -

1.4. Jar up the project
1.4.1. File --> New --> Deployment Profile --> Jar
1.4.2. Deploy to Jar


2. Create a SOA App in JDev 11g

2.1. Copy the WSDL into the project


2.2. Drop a BPEL service component onto the designer
2.2.1. Set input / output as follows -



2.3. Add a partner Link to the process, pointing to the imported WSDL
2.3.1. Add Assign - Invoke - Assign Activities



2.3.2 Assign input / output vars in the 2 Assigns
2.4. Copy the Jar file from the previous project to the SOA Project sca-inf\lib directory


2.5. Deploy the SOA App

Test




SOA Suite 11g - FTP Adapter

(From http://niallcblogs.blogspot.com/2011/07/soa-suite-11g-ftp-adapter.html)

Here is a simple lab demonstrating use of the FTP adapter.
I'm using FileZilla as my FTP Server.
I created the following directories


FTP Server Configuration

I create a user NiallC/NiallC
and configure the shared folders as follows -


Create FTP Adapter artifacts using WLS Console

Deployments --> FtpAdapter --> Configuration --> Outbound Connection Pools --> New

Edit the properties as follows -

host=localhost
password=NiallC
port=21
username=NiallC
serverType=win





Create a new SOA app


In this example I read in an(GET) order and then write it out (PUT).


Configure the read adapter as follows -




Configure the write adapter as follows -



Add the Mediator and specify the transformation.

That's it.

App at
https://docs.google.com/leaf?id=0B7YrnfO7h717ODc1ZTY2MTgtMTMzNS00ZTM4LWFkM2UtYjcyNjExMWMzOWIy&hl=en_US