Skip navigation.

Angelo Santagata

Syndicate content
Architect & Technology Evangelist - If its middleware I'm interested
Updated: 5 hours 4 min ago

Deploying JAXWS to JCS?? Getting "java.lang.ClassNotFoundException: org.apache.xalan.processor.TransformerFactoryImpl" error

Thu, 2014-04-17 06:21

Hey all,

  • Problem
  • The issue
    • Its a bug on Java Cloud Server (bug#18241690), basically JCS is picking up the wrong XSL transformer
  •  Solution
    • In your code simply put the following piece of java code to execute when your application starts up

System.setProperty("javax.xml.transform.TransformerFactory",
        "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");

 And all should be fine :-)


How to restrict data coming back from a SOAP Call

Thu, 2014-04-10 09:51

In sales cloud a big positive of the SOAP interface is that lots of related data is returned by issuing a single query, including master-detail data (ie multiple email addresses in contacts) however these payloads can be very very large, e.g. In my system querying single person you get 305 Lines(!), whereas I only want the firstName,LastName and partyId which is 3 lines per record..

Solution

For each findCriteria element you can add multiple <findAttribute> element indicating what elements you want to return. By default if you provide <findAttribute> entries then only those attributes are returned, and this functionality can be reversed by setting the <excludeAttributes> to true.


Example 1 :  only retrieving PersonLastName,PersonFirstName,PartyId

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/applicationModule/types/" xmlns:typ1="http://xmlns.oracle.com/adf/svc/types/">

   <soapenv:Header/>

   <soapenv:Body>

      <typ:findPerson>

         <typ:findCriteria xsi:type="typ1:FindCriteria" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

                <typ1:fetchStart>0</typ1:fetchStart>

                <typ1:fetchSize>100</typ1:fetchSize>

<typ1:findAttribute>PersonLastName</typ1:findAttribute>

                <typ1:findAttribute>PersonFirstName</typ1:findAttribute>

                <typ1:findAttribute>PartyId</typ1:findAttribute>

            <typ1:excludeAttribute>false</typ1:excludeAttribute>

         </typ:findCriteria>

      </typ:findPerson>

   </soapenv:Body>

</soapenv:Envelope>

Notes

findAttributes work on the level1 attributes of that findCriteria, the value can be a attribute or an element

If you want to restrict SubElements you can use childFindCriterias for that subelement and then add findAttributes within that

Example 2 :  Only Retrieving PartyId, and within Email element only EmailAddress     

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/applicationModule/types/" xmlns:typ1="http://xmlns.oracle.com/adf/svc/types/">

   <soapenv:Header/>

   <soapenv:Body>

      <typ:findPerson>

         <typ:findControl>

            <typ1:retrieveAllTranslations/>

         </typ:findControl>

         <typ:findCriteria xsi:type="typ1:FindCriteria" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <typ1:fetchStart>0</typ1:fetchStart>

            <typ1:fetchSize>100</typ1:fetchSize>

<typ1:findAttribute>PartyId</typ1:findAttribute>

            <typ1:findAttribute>Email</typ1:findAttribute>

            <typ1:excludeAttribute>false</typ1:excludeAttribute>

<typ1:childFindCriteria>

               <typ1:fetchStart>0</typ1:fetchStart>

               <typ1:fetchSize>10</typ1:fetchSize>

<typ1:findAttribute>EmailAddress</typ1:findAttribute>

               <typ1:excludeAttribute>false</typ1:excludeAttribute>

               <typ1:childAttrName>Email</typ1:childAttrName>

</typ1:childFindCriteria>

         </typ:findCriteria>

      </typ:findPerson>

   </soapenv:Body>

</soapenv:Envelope>

Notes

For a childFindCriteria to work you must query it in the parent, which is why “Email” is referenced in a findAttribute on line 14

Passing data between apps using URL Query parameters???

Thu, 2014-03-27 05:12

If so then you need to be careful about private data.. It can be secure but remember security is only as good as the weakest link.. This article is a nice summary of what's possible , whats secure and what isnt....

https://blog.httpwatch.com/2009/02/20/how-secure-are-query-strings-over-https/

Developing apps in the cloud? Then you need docs

Mon, 2014-03-03 15:19

Over the last couple of months I've been busy working with our documentation people helping them build a set of documentation aimed at partners, specifically around the topic of technical integration with Oracle Sales Cloud. The aim here is to convey our knowledge, and experience of working with partners and come up with some documentation detailing the various use-cases and specifically how it can be implemented.. technically...

All of these documents are now available on http://docs.oracle.com/cloud and specifically the doc I contributed to is the Sales Cloud Use Cases Implementation.

However note that in true Cloud style, this is only the first set of docs in a much larger collection of documents which we [Oracle] are planning to release.

Stay tuned and if you have any suggestions for future doc topics let me know!

SOA Community Event

Fri, 2014-02-21 02:34

Im at the Fusion Middleware Community Event today in Malta, about 3pm I'll be presenting "Mobile Design Patterns for Apps Integration". 

I'll be posting the powerpoint here later, but if your around, say hello, if your not around Id be curious to hear your own design patterns. 


Inserting a interaction into Sales Cloud using Java

Mon, 2014-02-10 12:47

Hey all,

Quick snippet of code showing how to create an interaction for an opportunity using Java.

This is only a snippet, I assume/note :

  • You've already created a Web-service proxy for the Interaction Service  (ie http://host/appCmmnCompInteractions/InteractionService) and added it to the project dependencie
  • You've tested a simple getInteraction() works fine
  • If you run standalone Java client, then make sure you import the Sales Cloud certificates into your keystore
  • If you run this as within Weblogic Server then the step of importing the Sales Cloud certificates isn't require
  • Tested and works on Sales Cloud R7
  • XML Payload is shown at the end
  • This is sample code

 

Java

package oracle.fusion.pts.samples.clients;
import com.oracle.xmlns.apps.crmcommon.interactions.interactionservice.Interaction;
import com.oracle.xmlns.apps.crmcommon.interactions.interactionservice.InteractionAssociation;
import com.oracle.xmlns.apps.crmcommon.interactions.interactionservice.InteractionParticipant;
import com.oracle.xmlns.apps.crmcommon.interactions.interactionservice.ObjectFactory;

import com.sun.xml.ws.api.addressing.AddressingVersion;
import com.sun.xml.ws.developer.WSBindingProvider;

import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Map;

import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.ws.WebServiceRef;

import oracle.pts.fusion.samples.interaction.InteractionService;
import oracle.pts.fusion.samples.interaction.InteractionService_Service;
import oracle.pts.fusion.samples.interaction.ServiceException;

import weblogic.wsee.jws.jaxws.owsm.SecurityPolicyFeature;


public class createInteraction {

    @WebServiceRef
    //Define the security policy
    private static final SecurityPolicyFeature[] securityFeature =
        new SecurityPolicyFeature[] { new SecurityPolicyFeature("oracle/wss_username_token_over_ssl_client_policy") };

   
    private static final AddressingVersion WS_ADDR_VER = AddressingVersion.W3C;


    public static void main(String[] args) {
   
        // Default Values
        String username = "matt.hooper";
        String password = "somepassword";
        String url="https://yourhost:443/appCmmnCompInteractions/InteractionService";
        // Sample data, in a real system these would be either parameters to the function or queried as part of the code
        Long participantPartyId = new Long("100000000099058");
        String opportunityId="300000000667205";
        Long customerId= new Long("300000000592745");
        
        // Setup the webservice interface
        InteractionService_Service interactionService_Service = new InteractionService_Service();
        InteractionService interactionService = interactionService_Service.getInteractionServiceSoapHttpPort(securityFeature);
        // Get the request context to set the outgoing addressing properties
        WSBindingProvider wsbp = (WSBindingProvider)interactionService;
        Map<String, Object> requestContext = wsbp.getRequestContext();
        requestContext.put(WSBindingProvider.USERNAME_PROPERTY, username);
        requestContext.put(WSBindingProvider.PASSWORD_PROPERTY, password);
        requestContext.put(WSBindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);

        System.out.println("Example of creating an interaction on a opportunity");
        
        // Create Payload        
        ObjectFactory factory = new ObjectFactory();
        Interaction newInteraction=factory.createInteraction();
        // Create XMLGregorianCalendar Object with todays date/time
        DatatypeFactory dtf=null;
        Date today= new Date();
        try {
            dtf = DatatypeFactory.newInstance();
        } catch (DatatypeConfigurationException e) {
            e.printStackTrace(); // Duh error
            System.exit(1);
        }
        GregorianCalendar gc=new GregorianCalendar();
        gc.setTimeInMillis(today.getTime());
        // Set Date
        newInteraction.setInteractionStartDate(dtf.newXMLGregorianCalendar(gc));
        newInteraction.setCustomerId(customerId);   // CustomerId can be obtained from TargetPartyId from the opportunity
        newInteraction.setInteractionDescription(factory.createInteractionInteractionDescription("Angelos Test Interaction "+today.toString()));        
        newInteraction.setOutcomeCode(factory.createInteractionOutcomeCode("SUCCESSFUL"));  // Configured in Setup/maintenance
        newInteraction.setInteractionTypeCode("EMAIL");         // Custom types can be configured
        newInteraction.setDirectionCode("INBOUND");             // INBOUND or OUTBOUND
        newInteraction.setMediaItemId(0L);                      // Default =0 
        newInteraction.setMediaTypeCode(factory.createInteractionMediaTypeCode(""));// Leave Empty
        // Create & Add Participant, can be RESOURCE and/or CONTACT        
        InteractionParticipant participant= factory.createInteractionParticipant();
        participant.setParticipantId(participantPartyId);
        participant.setParticipantTypeCode("RESOURCE");
        newInteraction.getInteractionParticipant().add(participant);
        // Create  & Add Association, this links it back to Opportunity
        InteractionAssociation association = factory.createInteractionAssociation();
        association.setAssociatedObjectCode("OPPORTUNITY");
        association.setAssociatedObjectUid(opportunityId);
        newInteraction.getInteractionAssociation().add(association);
        // Do the insert
        Interaction result=null;
        try {
            result = interactionService.createInteraction(newInteraction);
        } catch (ServiceException e) {
            e.printStackTrace();
        }
        System.out.println("end - interaction "+result.getInteractionId()+" created");
    }
}

 

XML

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/crmCommon/interactions/interactionService/types/" xmlns:int="http://xmlns.oracle.com/apps/crmCommon/interactions/interactionService/">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:createInteraction>
         <typ:interaction>
            <int:InteractionStartDate>2013-04-27T04:41:11.259-07:00</int:InteractionStartDate>
            <int:InteractionEndDate xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<!-- CustomerID= SalesParty Customer, also known as TargetPartyId in Opportunity -->
            <int:CustomerId>300000000592745</int:CustomerId>
            <int:InteractionDescription>CTI Detected customer callback </int:InteractionDescription>
            <int:OutcomeCode>SUCCESSFUL</int:OutcomeCode>
<!-- InteractionTypeCode is part of the standard Lookup types -->
            <int:InteractionTypeCode>EMAIL</int:InteractionTypeCode>
            <int:DirectionCode>OUTBOUND</int:DirectionCode>
            <int:MediaItemId>0</int:MediaItemId>
            <int:MediaTypeCode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <int:InteractionParticipant>
<!-- ParticipantId is partyID for contact -->
               <int:ParticipantId>100000000099058</int:ParticipantId>
               <int:ParticipantTypeCode>CONTACT</int:ParticipantTypeCode>
            </int:InteractionParticipant>
            <int:InteractionAssociation>
<!-- AssociatedObjectUid is OPPORTUNITY you want to assocaite this with -->
               <int:AssociatedObjectUid>300000000667205</int:AssociatedObjectUid>
               <int:AssociatedObjectCode>OPPORTUNITY</int:AssociatedObjectCode>
            </int:InteractionAssociation>
         </typ:interaction>
      </typ:createInteraction>
   </soapenv:Body>
</soapenv:Envelope>

 

More complete RESTful Services for Oracle Sales Cloud Sample/Demo Application

Mon, 2014-01-13 12:49

This sample code builds on the previous code examples in my blog showing how you can create a RESTful Facade for Oracle Sales Cloud. Specifically this example concentrates on the six main objects people tend to work with :

  • Opportunities
  • Leads
  • Locations
  • SalesParty
  • Person
  • Interactions

This application is an extension of a previous blog article https://blogs.oracle.com/angelo/entry/rest_enabling_oracle_fusion_sales, it is recommended that this article, and tutorial, are followed first. 

Please note this code is SAMPLEWARE and delivered with no guarantees, warranties or  support Functionality / Features
  • Supports Oracle Sales Cloud Release 7 and JDeveloper 11.1.1.7
  • Ability to query data in a RESTFul way (using GET/PUT verbs)
  • Data can be queried using JSON or XML data formats
  • URIs can contain parameters which reduce the amount of data which is returned , e.g. only bring back Opportunity IDs and Names
  • URI can contain SIMPLE queries, e.g. where OptyID=12323232
  • Complex queries can be passed in as a POST query when the URI ends in /xmlquery
  • User Credentials, CRM Server, FetchSize and FetchStart can be provided in httpHeaders, thus can be encrypted by SSL
  • Default Server can be setup so that credentials are not needed
  • Project can be extended to cover other objects
Limitations

  • Read only is implemented, if you want to issue writes (PUTS) or updates then I recommend custom methods for each operation you require.
  • In the future Oracle Sales Cloud will likely have support REST support natively; This software will work fine against future versions of Oracle Sales Cloud but you are probably better off using the native Oracle Sales Cloud REST support when it 


Material

New Book on Fusion Apps Development & Extensibility

Mon, 2014-01-06 10:46

If your doing anything with Oracle Fusion Apps, you really ought to read this newly released book. Its a great start, but just beware that some of the content isn't applicable to the "Cloud" variants of Fusion Apps, BUT it really helps to know how it works under the covers.. 

Its available on OReily Safari,  or you can also purchase the book on sites like Amazon

Using EL Expressions in Fusion Applications

Mon, 2014-01-06 10:11

Hey all,

Happy New Year!

If your using FusionApps, and are wondering what can you modify on the screen, its worth checking out this video. It demonstrates the usage of EL to hide/show fields based on values on the screen.

http://www.youtube.com/watch?v=bVWrIbf_82Q&list=PL1ZiAfFIniZclvZFvJudjDYmkhmosK13A