Exception in HttpOutboundMessageContext.RetrieveHttpResponseWork.run: java.io.IOException: SocketMuxer detected socket closure while waiting for a response in OSB 12.2.1.0.0

Issue –> While calling an business service in OSB , i got the below error.

Error –>

Exception in HttpOutboundMessageContext.RetrieveHttpResponseWork.run: java.io.IOException: SocketMuxer detected socket closure while waiting for a response
Supplemental Detail java.io.IOException: SocketMuxer detected socket closure while waiting for a response
at weblogic.net.http.SocketClosedNotification.<clinit>(SocketClosedNotification.java:13)
at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse.handleError(AsyncResponseHandler.java:395)
at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse.hasException(AsyncResponseHandler.java:503)
at weblogic.socket.SocketMuxer.deliverExceptionAndCleanup(SocketMuxer.java:846)
at weblogic.socket.SocketMuxer.deliverHasException(SocketMuxer.java:780)
at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:957)
at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:916)
at weblogic.socket.NIOSocketMuxer.process(NIOSocketMuxer.java:596)
at weblogic.socket.NIOSocketMuxer.processSockets(NIOSocketMuxer.java:560)
at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:30)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:43)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:147)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:119)

Solution –>

This issue is resolved after changing the business service endpoint URL from load balancer URL to individual server URL.

OSB 12C-Unable to invoke endpoint URI “http://host:port/Service/PS_XXXX” successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 403 Forbidden from url

Issue –> I got the below error while calling a proxy service from BPEL process in SOA Suite 12c.

Error –>

Unable to invoke endpoint URI “http://host:port/testService/PS_GetEmp&#8221; successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 403 Forbidden from url

Solution –>

For resolving this issue, we have to set the Publish status as “Private” .proxypublish.JPG

Using Result caching in OSB

Result caching is a OSB feature to cache business service response for a given request.

OSB uses Coherence to support caching, if we enable caching g in correct way then it will increases applications performance.

When cache is enabled , if a request comes to the business service then it will first check in the cache and returns the output to the caller otherwise it will call the target service and get the output and and return it to the caller and store it in cache again.

The result caching mechanism that Oracle Service Bus uses is Oracle Coherence (Enterprise Edition), which is included with Oracle WebLogic Server.

Result caching works only with request/response operations.

For setting up the Result caching , open the business service and go to “Message Handling Configuration”

Expand Advanced Settings and in Result Caching select Supported.

resultcache.JPG

Set the Cache Token Expression: fn:data($body/tar:result/custinfo)

resultcache1

This will use the customer info as our unique token for the cache entry. Also, set the Expiration Time for 10 seconds.

Click Last >> and Save to confirm the Business Service modifications. You can activate the change session.

Now click Launch Test Console for CustInfoPS proxy service and let’s test our configurations.

For first time you execute the service, it will take nine seconds to execute and it will populate our cache entry. Click Back in the Test Console and try to execute again; it will show the results immediately, directly from a cache entry in the embedded Oracle Coherence Server running within Oracle Service Bus.

Using the transport headers to read the incoming filename in OSB

I have a scenario where i am reading a file from ftp server in OSB using Ftp protocol and sending it to target system.

As per my requirement , i have to send the file name to target system with the same name that i have received from source system.

For achieving this i have to use file name property.

Open the proxy service and go to route node and in Request actions add actions as “Set Transport Headers”.

In the “Transport Headers” name , select the name as “jca.ftp.FileName” and open the action and set it as “$inbound/ctx:transport/ctx:request/tp:headers/ftp:fileName

transport.JPG

Key mismatch error with sFTP protocol in OSB

Issue –> If you are using sFTP protocol in OSB proxy then you will get these kind of errors.

Error –> 

Error encountered while polling the resource for the service endpoint ProxyService$XXXXXX$Services$XXXXXXXXX:

com.bea.wli.sb.transports.TransportException: Key Mismatch for host XXXXXX.XXXX.XXXXXX,1.11.111.111
com.bea.wli.sb.transports.TransportException: Key Mismatch for host XXXXXXXX.XXXX.XXXXX,1.11.111.111

Cause –> If your target server public key has ssh-rsa and you have used ssh-dss in your known_Hosts file  , you will see this error.

Solution –> For resolving these errors we have to verify the public key which is used in known_hosts file and update it according to the target server’s public key.

Exposing a pipeline as a REST service in Oracle Service Bus 12C

In this post we will see how to expose a pipeline in oracle service bus 12c as a REST service.

Here we are exposing a pipeline as a REST service.

Create a proxy pipeline that’s based on WSDL document and unselect the option “Expose as a SOAP service” and click on Finish.

sbrest1.JPG

Now we have to expose this pipeline as a REST service. Right click on pipeline and “Expose As REST”.

sbrest2

Enter the service name and click on Next .Click on ‘Edit’ in operation binding .

sbrest3.JPGsbrest4.JPG

select the ‘HTTP Verb’ and in Request , select the schema input method.

sbrest5.JPG

Select the Response URL , by selecting the response from schema and click on Ok.

sbrest6

Click on Finish to complete the setup.

sbrest7

Once the setup is complete you will see the WADL file in your project .

That’s it, Rest Enable proxy is ready to use.

Using Work Managers in Oracle Service Bus

This is continuous to my previous post , in this post we will see how to create work managers and use it in our oracle service bus services.

To view my previous post clickhere

Using work managers we can restrict the number of requests to your service.

By using Work managers you can optimize the scheduled work of your service.

WebLogic Server prioritizes work and allocates threads based on an execution model that takes into account administrator-defined parameters and actual run-time performance and throughput.

Here we will see how to define work managers.

STEP 1–>

Login to your weblogic server console.

Create a session and navigate to domain structure and click on work managers .

wkm.JPG

In the Global Work Managers page , click on New.

wkm1.JPG

In the Work manager component page , select the ‘work manager‘ radio button and click on Next.

wkm2.JPG

Enter the Name and click on Next.

wkm3

Select the Targets and Click on Finish .

STEP 2 –>

Now click on New to create maximum threads constraint .

Enter the Name and Count and click on Next.

wkm6.JPG

Select the Targets to which you want to add these constraint and click on Finish.

STEP 3 –>

Now open the work manager that you created in STEP1 , and select the ‘Maximum threads constraint‘ that you created in STEP2 and click on SAVE.

wkm7

Click on Activate in the change center to Activate the changes. And restart the server.

STEP 4–>

Login to oracle service bus console and open your proxy or business service where you want to use this work manager.

Click on Edit and in “Http Transport Configuration” page , select the dispatch policy as “TestWkm” which we created in STEP1.

wkm8

Save the changes and click on Activate to update the changes.