Thursday, February 5, 2015

coherence adapter in osb 12c

Recently I started working with 12c , At weblogic level all looks same except for the new look and feel. Coherence adapters looked new, so I was trying it out in the osb. The only issue I faced was on how to assign the coherence key

You can use an insert operation to populate the jca.coherence.key value in the jca headers.
Rest of the steps are similar to how you do in BPEL which is well documented.






Log:
outbound: <con:endpoint name="BusinessService$HelloWorld$GetFromCache" xmlns:con="http://www.bea.com/wli/sb/context">
  <con:service>
    <con:operation>Get</con:operation>
  </con:service>
  <con:transport>
    <con:mode>request-response</con:mode>
    <con:qualityOfService>best-effort</con:qualityOfService>
    <con:request xsi:type="jca:JCARequestMetaDataXML" xmlns:jca="http://www.bea.com/wli/sb/transports/jca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <tran:headers xsi:type="jca:JCARequestHeadersXML" xmlns:tran="http://www.bea.com/wli/sb/transports">
        <jca:SOAPAction>"Get"</jca:SOAPAction>
        <jca:Content-Type>text/xml</jca:Content-Type>
        <jca:jca.coherence.Key>4009</jca:jca.coherence.Key>
      </tran:headers>
    </con:request>
  </con:transport>
  <con:security>
    <con:doOutboundWss>true</con:doOutboundWss>
  </con:security>
</con:endpoint>>

3 comments:

Anonymous said...

Thank you!! You saved my day

venkat chakka said...

Hi Thomas,

Is this a bug in 12c ? Please suggest the solution for this.

We have couple of OSB services exposed as REST which will be consumed by REST APIs. We have proper error handling in place to handle all the error scenarios.
For below scenarios we are not able to propagate JSON error response to API :

1. Whenever OSB engine populates context fault ($fault) at runtime. for eg: service callout faults , validate action faults.
2. Whenever we throw error manually using Raise Error action.

Is this a bug in 12c ? Please suggest the solution for this.


### Steps to Reproduce ###
1.Expose a proxy service as REST with JSON structure for request, response and fault.
2.Use Raise Error action in message flow with custom error code and handle it in service level handler.
3.Use validate action for schema validation and raise error when validation fails.
4.Use service callout to call a SOAP web service.
5.Test REST proxy from SOAP UI , for above 3 scenarios ,xml error will be returned which doesn't obey with fault schema defined in OSB .Instead we should receive JSON error with the structure defined in fault schema.

-Venkat

George Thomas said...

his is how osb works.
I usually have a global fault handler which gets all the errors and transforms to the json format as per the spec.