Java call in OSB.
I am sorry if this seems like a basic question but I am new to OSB and middleware.
I have a Java class that transforms a CSV to XML that I need to call from OSB.
OSB needs to pick up the csv file from a folder, pass the file name into the java class, then notify another process that the xmls have been created.
Something like that.
Any help would be appreciated.
Create a Proxy Service like this:
Service Type Messaging Service
Request Message Type
Text
Response Message Type
None
Protocol file
Endpoint URI file:///c:/temp
Get All Headers No Headers
File Mask *.txt
Polling Interval 60
Read Limit 10
Sort By Arrival false
Scan SubDirectories false
Pass By Reference false
Post Read Action delete
Stage Directory file:///temp/stage
Error Directory file:///temp/error
Request encoding utf-8
Message Handling Configuration
Transaction Required Disabled
Same Transaction For Response Disabled
Content Streaming Disabled
(they are almost all default values)
When you log $body, you will see that it contains your file.
Just pass $body/* to a Java callout and do your transformation to XML.
MFL is an optional, but since you want to reuse your Java code, just do the Java Callout.
I am sure that if you google (or search on youtube) for
OSB java Callout
you will find plenty of tutorials.
Just define a Java static method
public static void processFileContent(String fileContent)
If you need to return your XML to OSB for further processing, you should return XmlObject rather than void.
I can teach you how to transform a XML String into a XmlObject
Similar Messages
-
in java call out in OSB, is it possilble to pass java object or java collection (like list,arraylist) as argument to the java method and during configuration at OSB proxy service is it possible to fetch the value from java object from java call out .I have tried it and i am able pass string and xml object as argument and get string type only.please guide me.
http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/pojo.html
"The input and return types for Java callouts are not restricted. However, any return types other than primitives, Strings, or XmlObjects can only be passed (unmodified) to other Java callouts. See Java Content in the body Variable for more information about storing and passing Java objects in the pipeline." -
OSB java call out with array parameters
Hi all,
I have a java call out with array parameters, follow the firm of java method:
logBody2(String category, XmlObject headerXml, String[] level, XmlObject[] xml)
The java call out have String[] and XmlObject[] arrays in intput, my question is how I can pass these arrays of values at java call out?
Thk
L.For array, comma-separated values should be passed. For e.g. -
If input parameter is of type String[] then passed values should be comma-separated strings like - 'Anuj','Dwivedi'
If input parameter is of type XmlObject[] then passed values should be comma-separated XmlObject like - <anuj/>,<dwivedi/>
Regards,
Anuj -
Hi,
Will there be any performace issues if we use Java CallOut in OSB.
Edited by: 791951 on Nov 29, 2010 8:25 AMI had some conversation on this topic with a couple of Oracle consultants and they said there is nothing to fear performance-wise using Java Callout in OSB.
See here http://www.javamonamour.org/2010/05/osb-and-java-callout-fierce-discussion.html for more details on the story,
and here http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/pojo.html for more on POJOs. -
How to Handle Multiple Thread in JAVA Callout with OSB 11g
Hi Team,
With My OSB 11g, I want create a static Thread when Java callout.
Java code as below.
private static Thread thread;
static {
* lazy load thread and with thread-safe ensure
if(thread == null){
synchronized (HornetQConnectionHelper.class) {
thread = new ConnectionRecoveryThread();
// Daemon thread, JVM level, Won't be interrupted, Safe!
thread.setDaemon(true);
thread.start();
When this class was first called in OSB, the thread start run. while when I redeploy it, the old Thread is still running, if call the class again, it will create a new Thread. The two threads will run at the same time.
Any body know how do configure it, so that there is only one static Thread in the Weblogic JVM.
Thanks.
Best Regards,
Raysen JiaHi Raysen Jia,
Create a weblogic startup class... See the references bellow...
Hope this is helpful...
http://jagadesh4java.blogspot.com.au/2010/05/working-with-weblogic-startup-shutdown.html
http://docs.oracle.com/cd/E23943_01/upgrade.1111/e10126/basic_upgrade.htm#FUPAS464
Cheers,
Vlad -
Problem with java callout in OSB
Hi guys,
i have a java class and when i am using that java class in osb using the java call out it is not returning the output.
My java class contains 2 parameters and return a string , when i am running the java program its working fine where as my osb is not returning anything.
I am passing the values to my parameters as xs:string('Transmission') and xs:string('sub_battery') , i tried in different ways of to pass the value to both the parameters still not returning anything.
please help me out in resolving this problem.
Thanks in advance.
Regards,
Shaikif you put logging in the java methods, do you see this output, in other words, does the call from osb to java work ?
-
Email sending through java callout in osb
In osb -- proxy service -- service callout -- i am getting a value using dbadapter select
Then i am using if then condition to perform some operations
After this step i need to notify this value to a user saying ... the account balance is this much
In our project already there is a java callout program to send emails to the concerned people ... it is used to notify some other thing like reprocessing activity etc., which was previously developed.
If i want to use that java callout option to send emails ... do i need to write a new java method and use that class file in this email sending java program and route my program to this service
Will this work ?
Thanks,
Rahuldo i need to write a new java method and use that class file in this email sending java program and route my program to this serviceYou may directly re-use that existing Java callout if it exposes a static method for starting execution. If it does not expose a static method, then you may write your own class which exposes a static method to be called by OSB, and from that method you may invoke your existing Java callout.
Regards,
Anuj -
How to handle Asynchronous calls using OSB?
Hi There,
How to handle Asynchronous calls using OSB?
Please help me out??
-VenkatHello friend, here is what you need.
Oracle Service Bus, invoke asynchronous webservices | Oracle .. Java .. OpenSource .. SOA -
Java call rfc check in original:error while checking in and storing.
hi,experts.
java call rfc check in original:error while checking in and storing. BAPI in the RFC is "BAPI_DOCUMENT_CJANGE2",
the RFC was fine in SE37 and calling by Visual Basic. and in java,when mConnection.setAbapDebug(true), and runing by step and step, was fine too.
if mConnection.setAbapDebug(false) in JAVA, up error in title was displayed.
what cause this error?
Best Regards.Hi Priya
Please use Su53 after getting the error and find any authorization is missing for the user..
S_GUI Full Authorization is required..
Since by giving BASIS Authorization its rectificed, then it shud be mostly due to Auth issues only
Regards
Aby -
"ORA-29532: Java call terminated by uncaught Java exception
Dear Oracle:
I am trying to establish an HTTPS connection from a Java stored
procedure that is wrapped in a PL/SQL procedure and loaded into a
Package. We are running on Oracle 8.1.7.
My Java code compiles and runs fine when run stand-alone outside
Oracle; I can establish the connection to a secure server and talk to
the server. However when I load this Java class (using the loadjava
utility) this class can no longer run and I get a the following
exception:
"ORA-29532: Java call terminated by uncaught Java exception:
javax.net.ssl.SSLException: SSL handshake failed:
X509CertChainIncompleteErr"
I have tried loading the JSSE from Sun and I still get the same error.
Searching in the Discussing Forums I found the following link (which
describes a procedure that logs into the UPS secure server site and
grabs some XML) http://osi.oracle.com/~mbpierma/SSL_Java_DB.html .
This code works ok if we try to connect to UPS server. However this
code doesn't work if we try to log in to a different server (such as
???). If I modify this code slightly and try to log to any other
sever server I get the same error as the one above. Investigation
lead us to understand that the certificate at the UPS web site is a
self-signed certificate -- not one generated by a major 'recognized'
authority such as Verisign or Thawte.
Further research pointed me to the following URL
http://www.znow.com/sales/oracle/network.816/a76932/appf_ora.htm#619367
This URL has the documentation for JAVA SSL for 8.1.6 which I figure
I could read and try to make it work in 8.1.7.
I looked at your Secure Hello World example, however the code is
missing the most critical parts of the whole example, it does not
specify where the certificate or any of the security settings come
from (see the attached JavaCertExample.txt file).
So, my questions are the following:
1) What should I do to avoid the error mentioned above?
2) Do you have a sample piece of code that describes how to make a
HTTPS connection using a Java stored procedure?
3) Can I make the HTTPS connection using a URL class and not using
sockets directly?
4) Do I need to load the JSEE provided by Sun?
5) Will the solution be different for Oracle 9i?
// SecureHelloClient.java
import java.net.*;
import java.io.*;
import java.util.*;
import javax.net.ssl.*;
import javax.security.cert.X509Certificate;
import oracle.security.ssl.OracleSSLCredential;
import oracle.security.ssl.OracleSSLSocketFactory;
import oracle.security.ssl.OracleSSLProtocolVersion;
import oracle.security.ssl.OracleSSLSession;
public class SecureHelloClient
public static void main(String argv[])
String hostName = "localhost";
if(argv.length != 0)
String hostName = argv[0];
// Set the SSLSocketFactoryImpl class as follows:
java.util.Properties prop = System.getProperties();
prop.put("SSLSocketFactoryImplClass",
"oracle.security.ssl.OracleSSLSocketFactoryImpl");
try
// Get the default socket factory
OracleSSLSocketFactory sSocFactory
= (OracleSSLSocketFactory)SSLSocketFactory.getDefault();
sSocFactory.setSSLProtocolVersion(OracleSSLProtocolVersion.SSL_Version_3_0);
OracleSSLCredential sslCredObj = new OracleSSLCredential();
// Where did these values come from? caCert, userCert, trustedCert,
// Set the certificate chain and private key if the
// server requires client authentication
sslCredObj.addCertChain(caCert)
sslCredObj.addCertchain(userCert)
sslCredObj.setPrivateKey(userPvtKey, userPassword)
// Populate credential object
sslCredObj.addTrustedCert(trustedCert);
sSocFactory.setSSLCredentials(sslCredObj);
// Create the socket using factory
SSLSocket jsslSoc =
(SSLSocket)sSocFactory.createSocket(hostName, 8443);
String [] ciphers = jsslSoc.getSupportedCipherSuites() ;
// Select the ciphers you want and put them.
// Here we will put all availabel ciphers
jsslSoc.setEnabledCipherSuites(ciphers);
// We are creating socket in client mode
jsslSoc.setUseClientMode(true);
// Do SSL handshake
jsslSoc.startHandshake();
// Print negotiated cipher
System.out.println("Negotiated Cipher Suite: "
+jsslSoc.getSession().getCipherSuite());
System.out.println("");
X509Certificate[] peerCerts
= ((javax.net.ssl.SSLSocket)jsslSoc).getSession().getPeerCertificateChain();
if (peerCerts != null)
System.out.println("Printing server information:");
for(int i =0; i ? peerCerts.length; i++)
System.out.println("Peer Certificate ["+i+"] Information:");
System.out.println("- Subject: " + peerCerts.getSubjectDN().getName());
System.out.println("- Issuer: " + peerCerts[i].getIssuerDN().getName());
System.out.println("- Version: " + peerCerts[i].getVersion());
System.out.println("- Start Time: " + peerCerts[i].getNotBefore().toString());
System.out.println("- End Time: " + peerCerts[i].getNotAfter().toString());
System.out.println("- Signature Algorithm: " + peerCerts[i].getSigAlgName());
System.out.println("- Serial Number: " + peerCerts[i].getSerialNumber());
else
System.out.println("Failed to get peer certificates");
// Now do data exchange with client
OutputStream out = jsslSoc.getOutputStream();
InputStream in = jsslSoc.getInputStream();
String inputLine, outputLine;
byte [] msg = new byte[1024];
outputLine = "HELLO";
out.write(outputLine.getBytes());
int readLen = in.read(msg, 0, msg.length);
if(readLen > 0)
inputLine = new String(msg, 0, readLen);
System.out.println("");
System.out.println("Server Message:");
System.out.println(inputLine );
else
System.out.println("Can't read data from client");
// Close all sockets and streams
out.close();
in.close();
jsslSoc.close();
catch(SSLException e)
System.out.println("SSL exception caught:");
e.printStackTrace();
catch(IOException e)
System.out.println("IO exception caught:");
e.printStackTrace();
catch(Exception e)
System.out.println("Exception caught:");
e.printStackTrace();Hi,
I have the same problem.
Is some ORACLE guru that can help us ?
We need to communicate with some servlet
via POST method of https (SSL3)
and with using private certificate on the client site.
We need furthermore allow using of some proxy.
Client site is realized as set of stored procedures within ORACLE 8.1.7
In this time I am able to communicate with server without SSL and certificate
using package utl_tcp
(but with this solution without certificate is our customer not satisfied -:))
ORACLE help us please !
Pavel Pospisil
[email protected] -
Java call to RFC FM for replacing CRM pricing
Hi Experts,
I have a requirement to make a RFC call to retrieve the pricing from ECC in CRMD_ORDER transaction after hit enter key with product/qty entry (use Web UI/shop/IC as frontend). Is it possible to made a Java call to RFC FM in SAP CRM which in turn calls R/3 to execute pricing and display this price on web order page? If yes, any documentation/samples and advise please.
Thanks in advance, JinHi all,
Following the AP7 Pricing Userexit Manual, I can change the price value in the exit (good doc, thanks). my next steip is to get sales org, customer and product info to make RFC, but I don't know from which Interface I can retrieve these info, can anyone help me? any doc or sample code?
Thanks, Jin -
Hi,
I have a requirement of calling BI webservices from Plsql stored procedure. I generated all my wsdl java classes and loaded them into the database. However, when I tried to call one of my java class using stored procedure, it is giving me"ORA-29532: Java call terminated by uncaught Java exception: java.lang.NoClassDefFoundError".
*Cause: A Java exception or error was signaled and could not be
resolved by the Java code.
*Action: Modify Java code, if this behavior is not intended.
But all my dependency classes are present in database as java class objects and are valid. Can some one help me out of this?Stiphane,
You can look in USER_ERRORS to see if there's anything more specific reported by the compiler. But, it could also be the case that everything's OK (oddly enough). I loaded the JavaMail API in an 8.1.6 database and also got bytecode verifier errors, but it ran fine. Here are the errors I got when loading Sun's activation.jar, which ended up not being a problem:
ORA-29552: verification warning: at offset 12 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):12 by a throw at offset 18 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):18 by a throw at offset 30 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):30 by a throw
Hope this helps,
-Dan
http://www.compuware.com/products/devpartner/db/oracle_debug.htm
Debug PL/SQL and Java in the Oracle Database -
Error: ORA-29532: Java call terminated by uncaught Java exception:
Anyone have this similar problem of
ORA-29532: Java call terminated by uncaught Java exception:
javax.xml.rpc.soap.SOAPFaultException: Caught exception while handling request:
deserialization error: XML reader error: unexpected character content:
"A"
The service is running fine in a browser and returns the date. When I run it using the PL/SQL it has the error mentioned above.
I am running the following:
CREATE OR REPLACE FUNCTION GetDate_wb( p_dummy IN VARCHAR2 )
RETURN DATE
AS
l_service sys.UTL_DBWS.service;
l_call sys.UTL_DBWS.call;
l_result ANYDATA;
l_wsdl_url VARCHAR2(1024);
l_service_name VARCHAR2(200);
l_operation_name VARCHAR2(200);
l_input_params sys.UTL_DBWS.anydata_list;
l_port sys.UTL_DBWS.qname := 8988;
BEGIN
l_wsdl_url := 'http://org-lblakisa1:8988/BPEL_OD-LoginWS-context-root/getDate1SoapHttpPort?WSDL';
l_service_name := 'getDate1';
l_operation_name := 'getDate';
l_service := sys.UTL_DBWS.create_service (
wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
service_name => l_service_name);
l_call := sys.UTL_DBWS.create_call (
service_handle => l_service,
port_name => NULL,
operation_name => l_operation_name);
l_input_params(1) := ANYDATA.ConvertVarchar2(p_dummy);
l_result := sys.UTL_DBWS.invoke (
call_handle => l_call,
input_params => l_input_params);
sys.UTL_DBWS.release_call (call_handle => l_call);
sys.UTL_DBWS.release_service (service_handle => l_service);
RETURN ANYDATA.AccessDate(l_result);
END;
/Problem is resolved... We had a version issue in that 10.1.3 web service is not compatible. 10.1.2 worked.
-
How can we call a OSB proxy service from a BPEL process?
Hi,
I want to call a OSB proxy service from a BPEL process. Can you please explain me the procedure?Get the wsdl of the OSB proxy service and create webservice parnerlink in BPEL based on this wsdl to invoke the service
To form the wsdl url, copy the Endpoint URI configured to the proxy service(just click on the proxy service in the console) from the sbconsole - /ATHGPUM_GlidePathService/ProxyService/ATHGPUM_GlidePathProxyService
Pre append <<protocol://OSB Hostname:OSB Port>> - http://localhost:8000/ and post append with ?WSDL
The final WSDL url look like - http://localhost:8000/ATHGPUM_GlidePathService/ProxyService/ATHGPUM_GlidePathProxyService?WSDL
Regards
Albin I -
Hi Friend
I created the "ZBEN_DEMO_RFC" RFC in IDS.
When Webdynpro Java call the "ZBEN_DEMO_RFC" get a error.
How to get a ARFC?
Regards
BenHi Ben,
I think problem is related to autherization, please chekc the userID/password and check SSO ticket for authorization while defining a metadata JCO Destination.
You can trace error RFC_ERROR_SYSTEM_FAILURE exception, have a look at the dev_jrfc.trc files. These files are written by JRFC and can be found in the directories j2ee/cluster/server* of the J2EE Application Server Installation.
Refre this WDJ - Adaptive RFC Troubleshooting Guide:-
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0019b1a-775f-2910-beb8-d81f27d0d8d0?quicklink=index&overridelayout=true
http://wiki.sdn.sap.com/wiki/display/EP/8EstablishSingleSignOnbetweenPortal%28frontend%29andESS6.0%28backend%29
Hope this may help you
Deepak!!!
Edited by: Deepak Arora on May 17, 2010 6:00 AM
Maybe you are looking for
-
When I subscribe to a calendar it doesn't show events in my ical even though it is refreshed
When I subscribe to a calendar it doesn't show events in my ical even though it is refreshed & is linked to iCloud - any ideas please?
-
FTP Adapter Sender: Dynamic configuration of directory
Hello all, I need to read files from an FTP server. The source directory contains the current date and hence changes everyday. That means: Today it's /home/user/out/20100519/ready/ Tomorrow it's gonna be /home/user/out/20100520/ready/ an
-
Broken bookmark cross references in Printed Documentation
Hi, I'am using RH 10 to generate a printed documentation output. What i notice is that the book marked cross references are broken in the Printed Documentation output. Other cross references are linking fine, but, the bookmarked cross references do n
-
SAP ABAP (AFS) Developer-Bristol,PA-6 Mons Contract
Hi, We are looking for an experienced SAP ABAP Developer to work in an Apparel and Footwear business solution (AFS) implementation. Job Title: SAP ABAP Developer Location: Bristol, PA Pay rate: Open Length: 6 Months Requirements: - Must have AFS (App
-
FileSharing with jpg rendering in browser
After looking through and testing the FileManager API I do not see a way to allow for one user to upload a file (JPG) and allow for that file to be viewed in the peer's browser. It appears that peer would ONLY have the ability to download the file to