Calling XI interfaces via Java

Hi All,
What is the method to call a Interface in XI via Java?
Regards,
Keerti

are you talking about Java Proxy ?
You can connect to an external Java based system via a Java proxy (XI adapter) - http://help.sap.com/saphelp_nw04/helpdata/en/e1/091640a991c742e10000000a1550b0/content.htm
Also have a look at these weblogs;
/people/prasad.ulagappan2/blog/2005/06/27/asynchronous-inbound-java-proxy
/people/rashmi.ramalingam2/blog/2005/06/25/an-illustration-of-java-server-proxy

Similar Messages

  • How to call Jakarta Ant via JAVA?

    Hi.
    My application has a new menu. This menu creates a build.xml Ant file.
    Now, when this menu is invoked , its action should call
    Jakarta Ant, after creating the xml file, so that the build.xml will
    do what is necessary.
    How can I do it? That is, how to call the Ant via java?
    Is there any way to use an Ant object?
    Thanks?
    Rodrigo Pimenta Carvalho.

    There is a slight problem in that
    PorjectHelper.configureProject is deprecated, but
    that is what Main calls...maybe someone else will
    complete this thread with an alternative call.The javadoc recommends using the non static method parse() instead. This is available by implementing class ProjectHelperImpl. An alternative to the code above might look like this:
            Project ant = new Project();
            ProjectHelper helper = new ProjectHelperImpl();
            ant.init();
            helper.parse(ant, new File("build.xml"));
            ant.executeTarget("clean");you might also want to add a logger so you can see the output of events generated by ant. The DefaultLogger class would be used like this. Simply add the code before you call the ant.init().
            DefaultLogger log = new DefaultLogger();
            log.setErrorPrintStream(System.err);
            log.setOutputPrintStream(System.out);
            log.setMessageOutputLevel(Project.MSG_INFO);
            ant.addBuildListener(log);

  • Can I call an interface from java

    Dear All,
    Can I call an interface from java in ODI ?
    Best Regards
    Arc

    Short answer, Yes.
    Long answer - you must create a scenario from the interface (the scenario is the "executable" code), right-mouse-button on the interface in the tree and "Generate Scenario". This can then be called using the invocation api this is documented in your <installationdirectry>/oracledi/doc/sdk/invocation. This points you at all the necessary classes etc to use.

  • Calling stored procedure via java

    Hi all,
    i have a problem calling a stored procedure in my java code. I found an example at OTN which seems not to be correct. I know there had been a lot of posting regarding this isue but i did not find the solution.
    I had the following VB-code to translate to java:
    Set k = Server.CreateObject("ADODB.command")
    With k
    .activeconnection = Db
    .CommandType = 4
    .CommandText = "Get_SK"
    Set vret = .createparameter("vRet", 131, 2) 'Output
    .Parameters.append vret
    .Execute
    End With
    In my java code:
    CallableStatement sproc_stmt = null;
    try {
    sproc_stmt = lsession.connection().prepareCall("{ ? = call TCSDBOWNER.Get_SK}");
    sproc_stmt.registerOutParameter(1,OracleTypes.NUMERIC);
    sproc_stmt.setFetchSize(10);
    sproc_stmt.execute();
    The call generates an id for inserting new rows in the DB. executing the code shown above i got the following error:
    wrong number or types of parameter/arguments
    Is there anybody who can help me? Best regards,
    ak

    Hi again,
    this was really ugly:
    Re: Executing stored procedure via java
    Thanks all, regards,
    ak

  • How to call Oracle Reports via Java Web Application ?

    Dear All,
    I have developed a web reports using Oracle Reports 11g and would like to display these reports via Java Web App that will call them.
    Kindly help me in this matter.
    Regards,
    Irfan

    i will go as John suggested.........Construct a URL with required parameters and call it using goLink component
    make a configuration in Report server and
    http://myServer:myport/reports/rwservlet?config=myconfig&destype=cache&desformat=PDF&report=myreport.jsp&myparameter=myvalue

  • Error calling php WS via Java client generated by JDev 10.1.3.2

    Hi guys.
    Gonna be a bit of a long one:
    I'm trying to generate a WS client for a php WS that was written for our use:
    The WSDL file looks as follows
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    - <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:CMS" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:CMS">
    - <types>
    - <xsd:schema targetNamespace="urn:CMS">
    <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
    <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
    - <xsd:complexType name="ArrayOfString">
    - <xsd:sequence>
    <xsd:element name="string" type="xsd:string" maxOccurs="unbounded" />
    </xsd:sequence>
    </xsd:complexType>
    - <xsd:complexType name="ArrayOfArrayOfString">
    - <xsd:sequence>
    <xsd:element name="ArrayOfString" type="tns:ArrayOfString" maxOccurs="unbounded" />
    </xsd:sequence>
    </xsd:complexType>
    - <xsd:complexType name="FragmentCheckInRequest">
    - <xsd:all>
    <xsd:element name="userName" type="xsd:string" />
    <xsd:element name="userPass" type="xsd:string" />
    <xsd:element name="fragData" type="xsd:base64Binary" />
    </xsd:all>
    </xsd:complexType>
    - <xsd:complexType name="FragmentCheckInReply">
    - <xsd:all>
    <xsd:element name="return" type="xsd:int" />
    </xsd:all>
    </xsd:complexType>
    - <xsd:complexType name="DataImportXMLRequest">
    - <xsd:all>
    <xsd:element name="userName" type="xsd:string" />
    <xsd:element name="userPass" type="xsd:string" />
    <xsd:element name="xmlData" type="xsd:base64Binary" />
    <xsd:element name="opts" type="tns:ArrayOfArrayOfString" />
    </xsd:all>
    </xsd:complexType>
    - <xsd:complexType name="DataImportXMLReply">
    - <xsd:all>
    <xsd:element name="return" type="xsd:int" />
    </xsd:all>
    </xsd:complexType>
    </xsd:schema>
    </types>
    - <message name="FragmentCheckInRequest">
    <part name="fragment" type="tns:FragmentCheckInRequest" />
    </message>
    - <message name="FragmentCheckInResponse">
    <part name="return" type="tns:FragmentCheckInReply" />
    </message>
    - <message name="DataImportXMLRequest">
    <part name="fragment" type="tns:DataImportXMLRequest" />
    </message>
    - <message name="DataImportXMLResponse">
    <part name="return" type="tns:DataImportXMLReply" />
    </message>
    - <portType name="CMSPortType">
    - <operation name="FragmentCheckIn">
    <documentation>Check in a Word file</documentation>
    <input message="tns:FragmentCheckInRequest" />
    <output message="tns:FragmentCheckInResponse" />
    </operation>
    - <operation name="DataImportXML">
    <documentation>Import XML data</documentation>
    <input message="tns:DataImportXMLRequest" />
    <output message="tns:DataImportXMLResponse" />
    </operation>
    </portType>
    - <binding name="CMSBinding" type="tns:CMSPortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    - <operation name="FragmentCheckIn">
    <soap:operation soapAction="urn:CMS#FragmentCheckIn" style="rpc" />
    - <input>
    <soap:body use="encoded" namespace="urn:CMS" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </input>
    - <output>
    <soap:body use="encoded" namespace="urn:CMS" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </output>
    </operation>
    - <operation name="DataImportXML">
    <soap:operation soapAction="urn:CMS#DataImportXML" style="rpc" />
    - <input>
    <soap:body use="encoded" namespace="urn:CMS" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </input>
    - <output>
    <soap:body use="encoded" namespace="urn:CMS" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </output>
    </operation>
    </binding>
    - <service name="CMS">
    - <port name="CMSPort" binding="tns:CMSBinding">
    <soap:address location="http://dtest.sun.ac.za/cms/cms/service/cms.php" />
    </port>
    </service>
    </definitions>
    I use Jdev 10.1.3.2 and generated the WS proxy, everything looks good. Then I go into the generated client and add in the following code:
    public static void main(String[] args) {
    try {
    cmswstest.proxy.CMSPortClient myPort = new cmswstest.proxy.CMSPortClient();
    System.out.println("calling " + myPort.getEndpoint());
    DataImportXMLRequest dr = new DataImportXMLRequest();
    String tmpXML =
    "<?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?>" +
    "<CMS_CURR_INFO_UPD>" +
    "<MSG_SEQ_NO>NATX_ 0000000000000200706201337193</MSG_SEQ_NO>" + "</CMS_CURR_INFO_UPD>";
    byte[] xmlb = tmpXML.getBytes();
    dr.setUserName("elmarm");
    dr.setUserPass("fud567");
    dr.setXmlData(xmlb);
    DataImportXMLReply repl = myPort.dataImportXML(dr);
    System.out.println("Length of XML message = " + repl.get_return());
    // Add your own code here
    } catch (Exception ex) {
    ex.printStackTrace();
    When I run the client, I get the following error message:
    calling http://dtest.sun.ac.za/cms/cms/service/cms.php
    java.rmi.RemoteException: Mime Header Content-Type: text/xml requires SOAP envelope namespace: http://schemas.xmlsoap.org/soap/envelope/; nested exception is:
         oracle.j2ee.ws.saaj.soap.SOAPVersionMismatchException: Mime Header Content-Type: text/xml requires SOAP envelope namespace: http://schemas.xmlsoap.org/soap/envelope/
         at cmswstest.proxy.runtime.CMSBinding_Stub.dataImportXML(CMSBinding_Stub.java:161)
         at cmswstest.proxy.CMSPortClient.dataImportXML(CMSPortClient.java:64)
         at cmswstest.proxy.CMSPortClient.main(CMSPortClient.java:38)
    Any ideas as to how to debug the situation. As is quite obvious, my experience with WS and SOAP is minimal at best :)
    Thanks for all the help.
    PS: I tried the same thing in Jdev 10.1.2 and got the following error:
    [SOAPException: faultCode=SOAP-ENV:Client; msg=Parsing error, response was:
    Expected &apos;EOF&apos;.; targetException=oracle.xml.parser.v2.XMLParseException: Expected 'EOF'.]
         at org.apache.soap.SOAPException.<init>(SOAPException.java:78)
         at org.apache.soap.rpc.Call.invoke(Call.java:312)
         at mypackage.CMSStub.DataImportXML(CMSStub.java:128)
         at mypackage.CMSStub.main(CMSStub.java:51)
    Elmar Matthee
    University of Stellenbosch
    South Africa

    Hi Vid,
    To be able to deploy Doc-literal Web services on 10.1.2, you have to select the J2EE 1.3 type of web services when you create the first Web Service of a project. Once you have create a 1.4 service, the dialogue is not displayed again for the given project.
    The other source you have is correct. the JAXRPC based type of Web service that is generated with JDeveloper 10.1.3 cannot be deployed on 10.1.2, as the new runtime is not available there.
    One way to get a Doc-lit service on 10.1.2 is described in Mike's blog [1]. THe WSDL file generated in 10.1.3 is a good start, as it will enable an easier migration to 10.1.3, once it's available.
    Hope this Helps,
    Eric
    [1] http://radio.weblogs.com/0132036/2003/12/07.html

  • How to invoke ant via java

    Hi.
    My application has a gui. Now, when a button in the gui is invoked, its action should invoke Ant build which is existing , so that the build.xml will
    do what is necessary.
    How can I do it? That is, how to call the Ant via java? can anybody help me
    Thanks in advance

    Search the ant documentation for a Launcher class.

  • How to call business rules scripts via Java API

    Hi
    I have a problem. I have some scripts (business rules in essbase) that can be seen thru Administration Services Console under Business Rules folder. How can I execute these script using Provider Services (via Java API to EssBase interface)?

    hi
    i look too java api sample for "HBR Lounch"
    you can try found example in EAS folder
    C:\Hyperion\AdminServices\AppServer\InstalledApps\Tomcat\5.0.28\eas\webapps\hbrlauncher\MC_LaunchWindow.jsp
    please back, if you will have resolution :)

  • Calling C++ functions by Java via CORBA?

    Hello,
    I am interested in source code examples of calling C++ functions by Java via CORBA. For example the client is in Java and the server is in C++. Is it posible that the IDL compiler can generate "java" client stubs and "c++" server sceleton? So the implementation of the client will "inherit" the stubs generated by the IDL compiler, and the server implementation will use the sceleton.
    Thank you in advance.

    As far as I know, you've got to have your idl on both side. You compile idl mapping to java on client side and mapping to C++ on server side. Then you should be able to do it.
    Kim

  • Calling to BPM via PI

    Basically I have already found a solution by trial and error, but I still don't understand what's going on, maybe someone can help me understand.
    I am trying to make a web service call
    from a CRM system (CRM 7.0 EhP3 SP 3), outbound interface {http://sap.com/xi/CRM/FS/Global2}NewLoanBoardingFSCreateRequest_Out
    via PI (double-stack, PI 7.31 SP 3)
    to a NW Java BPM system (NW 7.40 SP 4, inbound interface {http://sap.com/xi/FS-AO/Global}NewLoanBoardingProcessingNewLBrdngIn. The host name of the system is ilbnknw1 and the port is 50300.
    I created an EJB for the implementation of the service provider NewLoanBoardingProcessingNewLBrdngIn and a BPM process according to note 1891861 in NW Developer Studio and deployed all of it to the NW Java BPM server.
    There is a web service end point for NewLoanBoardingProcessingNewLBrdngIn on the NW Java BPM server the URL looks like this: http://ilbnknw1:50300/bpm/testsapcom/polnlbv0/start?wsdl&mode=ws_policy (visible in WS Administrator > Configuration > Connectivity > Single Service Administration > (stay on tab Service Definitions) > search for WSDL Port Type Name: NewLoanBoardingProcessingNewLBrdngIn ... I don't remember if it was created automatically during the deployment or I created it manually.)
    The security settings for the end point are set like this:
    Transport protocol: HTTP (not HTTPs)
    HTTP Authentication: Checkmarks for Login with User ID/Password and for Logon ticket are set. (X.509 is not set and also grayed out.)
    Message Authentication: No checkmarks are set.
    I can test the above WSDL URL (http://ilbnknw1:50300/bpm/testsapcom/polnlbv0/start?wsdl&mode=ws_policy) from WS Navigator and it works - I don't get an error message, and in WS Administrator I see that the process is started (at Operations > Processes and Tasks > Manage Processes).
    Now I wanted to test it from CRM. One possibility would be to go into SOAMANAGER and create a port that connects to the end point. But we prefer to go via PI. So I set up a receiver determination, interface determination and receiver agreement. The first two have no problems, the correct receiver (a business system referring to the NW Java BPM system) and the correct receiver interface are found. With the receiver agreement I was not so sure what to do and I tried different things.
    First I thought: It's a call to a web service, let me use a web service receiver channel, i.e. Adapter Type = WS of version SAP BASIS 7.31 (I tried 7.40 because the NW Java BPM server is 7.40, but the PI doesn't like that because it's only 7.31).
    I entered:
    WSDL Access URL: I used the complete URL (http://ilbnknw1:50300/bpm/testsapcom/polnlbv0/start?wsdl&mode=ws_policy).
    Authentication Method for WSDL Access: Basic Authentication using HTTP. (The other option No authentication and SSO using SAP Assertion ticket don't seem to fit.)
    User name for WSDL access: A user in the NW Java BPM system.
    Password for WSDL access: Password of the user
    Security
    Communication Security: None
    Authentication Method: User ID/Password (Transport Channel Authentication)
    Technical Transport Settings
    Target Host: ilbnknw1
    Service Name/Port: 50300
    URL Access Path: /bpm/testsapcom/polnlbv0/start (this can be selected with the value help button and that was the only choice int he value help)
    Then in the receiver agreement I chose this channel and entered the user and password on the NW Java system that should be used for the actual WS call (while the other one in the channel is only for accessing the WSDL) ... actually I used the same user and password for both, it has enough authorizations.
    Result: Didn't work at all, PI showed a red flag for the message with the error WS_ADAPTER_SYS_ERROR and text System error while calling Web service adapter: Error when initializing SOAP client application: &#39;Error when initializing SOAP client application: &quot;SRT: Unexpected failure in SOAP processing occurre&quot;&#39;
    Question: Is this totally the wrong adapter to call to a NW Java system, or were my parameters wrong?
    Then I found some things in the forum that said: Just use SOAP adapter, not WS adapter! And for communication between (newer releases of) PI and (new releases of) NW Java BPM it's best to use the SOAP adapter with the XI 3.0 protocol.
    So I tried a SOAP receiver channel with XI 3.0 protocol, i.e. Adapter type SOAP with version SAP BASIS 7.31,
    Transport Protocol: HTTP,
    Message Protocol: change from SOAP 1.1 to XI 3.0,
    Adressing Type: URL address (HTTP destination was the alternative),
    Target URL: I used the whole URL (http://ilbnknw1:50300/bpm/testsapcom/polnlbv0/start?wsdl&mode=ws_policy),
    Authentication Mode: Use Logon Data for Non-SAP system (because Logon Data for SAP system wanted a client and language, so I think it refers to ABAP systems only),
    User Name: A user in the NW Java BPM system,
    User Password: the matching password
    (No settings in receiver agreement, just chose the channel.)
    Result: The PI didn't show any error anymore, the flag was black-white. But on NW Administrator (Operations > Processes and Tasks > Manage Processes) I could not see the process starting!
    Question: How is this possible? Where else could the error be seen? Are my parameters wrong? Probably not, otherwise PI should already show the error.
    Next try: SOAP receiver channel with SOAP 1.1 protocol, i.e. Adapter type SOAP with version SAP BASIS 7.31,
    Transport Protocol: HTTP,
    Message Protocol: SOAP 1.1 (the default, instead of XI 3.0 in the previous attempt)
    Adressing Type: URL address (HTTP destination was the alternative),
    Target URL: I used the URL just up to the ? for the parameters, i.e. only http://ilbnknw1:50300/bpm/testsapcom/polnlbv0/start,
    Checkmark for Configure User Authentication,
    User Name: A user in the NW Java BPM system,
    User Password: the matching password
    At the bottom:
    Checkmark for Use Query String,
    SOAP Action: wsdl&mode=ws_policy
    (No settings in receiver agreement, just chose the channel.)
    Result: Success in PI (black-white flag) - and now two processes were started shortly after each other (within 15 seconds)!
    I tested again to see if it would always trigger two process starts, but now it only started one as expected.
    So it looks like the other process start "pushed out" a hanging previous process start? Is such a thing possible? Where could I monitor this? (Apparently not in NW Administrator > Operations > Processes and Tasks > Manage Processes).
    So now I have a solution, I use a SOAP receiver channel with SOAP 1.1 protocol, not with XI 3.0 protocol, and certainly not thw WS adapter. But I still wonder why it's not working with the XI 3.0 protocol, even though this seems to be the most recommended way for PI and BPM to communicate in recent releases that support this, and what exactly happened there, where the first process start was "hiding" in the meantime.

    Hi Monika,
    did you choose the URL
    http(s)://<hostname>:<port>/MessagingSystem/receive/JPR/XI
    in the XI 3.0 communication channel as described in the SAP Help? As far as I understand your description you didn't. Maybe this is the reason that it was not working with XI 3.0.
    Please check this link for proper setup:
    http://help.sap.com/saphelp_nw73ehp1/helpdata/en/99/0d45d39bb442bc96925f4a5db8b7ee/content.htm?frameset=/en/f1/24e6e6f548480b85197bde372d13c9/frameset.htm
    Best Regards
    Harald

  • Calling EJB facades via class instantiated via reflection?

    We are loading plugins via Java reflection. Anything instantiated via newInstance() does not appear to have access to the Local interface.
    Right now, to get to the session bean we must use the Remote interface. This is annoying due to the performance, and seems completely unnecessary when everything is operating in one JVM.
    Tests were done to print out the JNDI namespace and the local interfaces don't seem to be accessible. Any advice?

    My project consists of an EJB package and WAR. I have not had any problem calling the local facades from JSP, Servlet, or web service in the EJB package.
    Further, I can use XStream reflection and do local EJB calls.
    It baffles me why I can't do the local calls in some classes via InitialContext lookups.
    I will post test code next week.

  • What is the diffrence between My Runnable Interface and Java Runnable

    Hi folks
    all we know that interfaces in java just a decleration for methods and variables.
    so my Question is why when i create an interface its name is "Runnable" and i declared a method called "run" inside it.then when i implements this interface with any class don't do the thread operation but when i implement the java.lang.Runnable the thread is going fine.
    so what is the diffrence between My Runnable Interface and Java Runnable?
    thnx

    Hi folks
    all we know that interfaces in java just a decleration
    for methods and variables.
    so my Question is why when i create an interface its
    name is "Runnable" and i declared a method called
    "run" inside it.then when i implements this interface
    with any class don't do the thread operation but when
    i implement the java.lang.Runnable the thread is going
    fine.
    so what is the diffrence between My Runnable Interface
    and Java Runnable?
    thnxClasses and interfaces are not identified by just their "name", like Runnable. The actual "name" the compiler uses is java.lang.Runnable. So even if you duplicate the Runnable interface in your own package, it's not the same as far as the compiler is concerned, because it's in a different package.
    Try importing both java.util.* and java.awt.* (which both have a class or interface named List), and then try to compile List myList = new ArrayList();

  • Need Info Regarding Implementaion of Interfaces in java.sql package

    Hi All,
    I am interested in knowing details abt how the Interfaces in the java.sql package are implemented. We all work with the database using the interfaces provided ,but how do they work at the backend ? How can a Interface provide details (work ) with out an implementation class.I Is this taken care by the JVM or some of the Call level interfaces? Please do provide details abt this..

    hi Sheshadri,
    The implementation of the various interfaces in
    java.sql package are provided by your jdbc driver,
    which also manages the connection and communication of
    your java program with the appropriate database.
    cheers,
    -Jer

  • "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]

  • Interfaces in Java

    I have a doubt about interfaces. All interface in Java has empty methods, I mean,the methods dont have any implementation. So, to use these methods, there has to be a class that implements this interface in order these methods to have an implementation. Here is my question: there are some Interfaces in Java like java.sql.Statement that dont have any class that implements its methods and in spite of this, I can call the methods of the interface. How is this possible?
    Thanks

    Yes there is always an implementation. You just aren't necessarily exposed to the actual class which implements the interface, but you can tell what the class is like this:
    Statement stmt = ...; // get your Statement however you are doing it now
    System.out.println("Actual class implementing Statement interface in this case is: " + stmt.getClass());

Maybe you are looking for