Wednesday, March 20, 2013

#231 - Oracle learning resources for Oracle Business Rules

Check it out here

#230 OSB frontending Fusion CRM

Continuing from post # 227.

In this scenario the OSB proxy service will not be based on the Fusion CRM SalesLead WSDL.
We don't want our SOA developers to have to concern themselves with those complexities.

We have a simple canonical message for creating a new SalesLead -


This is all our SOA developers need to know.

We have a "canonical" wsdl -

  I import the WSDL and the XSD into my OSB project


I now create a new Proxy Service based on the newly imported WSDL.

Here is the Message Flow -

Map Message -

Essentially the first 3 Assigns take the 3 values from the input message and save them to local variables.

The 3 are -

I then create a new variable with the Fusion CRM conform SOAP Request -

Notice the placeholders for the 3 variables e.g. {($v_custId)} etc.

 I then Replace $body with this structure.
The Routing node takes care of the rest.

Test -

View in Fusion CRM -

Friday, March 15, 2013

#229 - Fusion CRM WS --> find opportunities for a specific customer

That's my opportunity - here's the request payload to retrieve it.
I use the OpportunityService, operation findOpportunity
All you need is the customer's (in this case, Limerick Ham Ltd) PartyId.

That value is then used as the TargetPartyId in the following SOAP Request -

You can restrict so as only to return the OptyId and name -

The Response - 

#228 SOA DB Performance tuning whitepaper on OTN

Here it is

Thanks Simone!

Tuesday, March 12, 2013

# 227 exposing Fusion CRM web services via OSB

Again I am using the SalesLead Service.
The idea is to create a Business service thru which I can create a new Sales Lead.

Step 1 - Create a new OSB project

Step 2 - Import the required XSDs/ WSDL into your OSB project

Step 3 - Create a keystore in the following OSB directory

Step 4 - Add the Fusion CRM cert to this keystore

Step 5 - Configure this keystore as a provider in EM 

Step 6 - Configure CSF-Key in EM 
Here we essentially create a key based on the username / password of our Fusion CRM user.

I created the key - matt-key

Now that we have done the security setup...

Step 7 - Configure the Business Service WSM policy

Step 8 - Configure the Business Service Security to use matt-key

 Here I set csf-key to matt-key

Step 9 - Test with the following payload

 Step 10 - Validate in Fusion CRM

Step 11 - Create a Proxy Service

 Service Type = Any XML Service

Add the following to the proxy

In this particular example, we don't need to map variables.
We will use the exact same payload as when testing the business service.

All we need to configure is the Routing

Test the proxy

Validate in CRM

Friday, March 8, 2013

#226 Creating a Fusion CRM Sales Lead via Oracle BPM

This is a very simple scenario - that I hope one can extrapolate from.
Here we need to create a new Sales Lead from within a BPM process.

The SalesLeadService wsdl is available at

It would be very tempting to simply address this directly in your BPM process.
i.e. By adding a Web Service reference to the composite.

There are some compelling reasons not to do this -

1. the service reference will include a list of all operations, which may be confuse
    the BPM developer.

2. Data mapping - one sees the full list of SalesLead attributes - which again may confuse the
BPM developer. All she wants to do is create a very basic sales lead for a particular customer.

3. tight coupling

4. one has to concern oneself with the relevant security policies.

So I adopted this approach -

Create a Web Service Proxy in JDeveloper based on the Sales Lead WSDL.

During creation, specify the following WSM policy "oracle/wss_username_token_over_ssl_client_policy"

The generated client will be called SalesLeadServiceSoapHttpPortClient
You can add some code to it to test the connection to Fusion CRM.

        MklLead lead = new MklLead();
            long leadId;

            leadId = 300000000123456L;
            System.out.println("Lead name " + salesLeadService.getSalesLead(leadId).getName());


I see my lead -

corresponding to the 4th Lead in Fusion CRM -

Create a new class to expose createLead functionality and expose as a web service

I now create a new class based on SalesLeadServiceSoapHttpPortClient.
I essentially amend to include a method createLead()

the code to create the lead-

        Long customerId = new Long(custId);
             MklLead salesLead = new MklLead();
             JAXBElement newCustId = null;
             String newSalesLead = leadName;
             JAXBElement newSalesLeadDesc = null;
              ObjectFactory factory = new ObjectFactory();  
                 newSalesLeadDesc = factory.createMklLeadDescription(leadDesc);
                 newCustId = factory.createMklLeadCustomerId(customerId);

I now expose this class as a web service and deploy to WLS.
I imported the Fusion CRM security certificate into the WLS DemoIdentity.jks.

I validate in Fusion CRM -

So now I simply leverage this web service in BPM -

Simple data mappings -

No security setup required.
Deploy and test

We could, of course, leverage OSB for the brokering.

Monday, March 4, 2013

#224 Fusion CRM Web Services --> Create Appointment

The relevant wsdl is available at -

Here's the SOAP request to create an Appointment related to an Opportunity -

The mandatory fields are -
SourceObjectCd - in this case, we set this to OPPORTUNITY
SourceObjectId - in this case, we set this to the ID of the OPPORTUNITY

ActivityDescription is not mandatory, but advisable.

Here is the SOAP Request