Java to Webservices ??

Hi friends,
Can someone tell me a high level idea on how to interact with the Webservices
like I have one Standalone Java application which need to interact with some Webservices to validate something.
Is it possible to talk from Java to Web Services?
To interact should I have some server to put the request to the web service ?
Or can some of JAVA API could help to put the request to the web service to specific port ?
Any idea would be much appreciated.
With Cheers,
Prasanna

Sure, you can create client and server artifacts to communicate via webservices in Java.
One of the main resources you sould check is :
https://jax-ws.dev.java.net/
The server side might live in an HTTP server that runs java. You can use glassfish, tomcat, etc. That's because most webservices use HTTP as a transport layer, but it is not limited to such a protocol.
If you want to be involved with webservices, you should use netbeans 6 with webservices support, and then you will be able to see how easy is to program webservice clients.
regards

Similar Messages

  • Invalid SOAP action when using java ws WebService

    Hi all,
    this is a slightly more detailed error for a problem i posted recently. I am connecting to a web service that was generated from WSDL. It has two methods "HelloWorld" and "HelloSayFirstName". As defined in the WSDL, the methods use the SOAP action document style. I want to add a cookie to the http header, so after the port is created, I use the following to add the header to the requestContext:
              BindingProvider bindingProvider = (BindingProvider) servicePort;
              Map<String, Object> requestContext = bindingProvider.getRequestContext();
              List<String> cookies = new ArrayList<String>();
              cookies.add("mycookie=mytoken");
              HashMap<String, List<String>> httpHeaders = new HashMap<String, List<String>>();
              httpHeaders.put(HTTPConstants.HEADER_COOKIE, cookies);
              requestContext.put(MessageContext.HTTP_REQUEST_HEADERS, httpHeaders);
    This works when I call the first method (HelloWorld) - the first activity message sent to the server contains the following:
    <HttpRequest>
    <Method>POST</Method>
    <QueryString></QueryString>
    <WebHeaders>
    <Cache-Control>no-cache</Cache-Control>
    <Connection>keep-alive</Connection>
    <Pragma>no-cache</Pragma>
    <Transfer-Encoding>chunked</Transfer-Encoding>
    <Content-Type>text/xml; charset=UTF-8</Content-Type>
    <Accept>*</Accept>
    <Cookie>mycookie=mytoken</Cookie>
    <Host>exampleHost</Host>
    <User-Agent>Java/1.5.0_14</User-Agent>
    <SOAPAction>"http://tempuri.org/IMyService/HelloWorld"</SOAPAction>
    </WebHeaders>
    </HttpRequest>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://exampleHost/WebServices/WCFService/Service.svc</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IMyService/HelloWorld</Action>
    </s:Header>
    <soap:Body>
    <HelloWorld xmlns="http://tempuri.org/" xmlns:ns2="http://schemas.datacontract.org/2004/07/" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/">
    <myValue1>world</myValue1>
    </HelloWorld>
    </soap:Body>
    </soap:Envelope>
    However, after this method, the httpHeaders in the requestContext object have been updated to include the "Accept" header and the "SOAPAction" header - which is the incorrect action! Now, when I call the method "HelloSayFirstName" I get the following:
    <HttpRequest>
    <Method>POST</Method>
    <QueryString></QueryString>
    <WebHeaders>
    <Cache-Control>no-cache</Cache-Control>
    <Connection>keep-alive</Connection>
    <Pragma>no-cache</Pragma>
    <Transfer-Encoding>chunked</Transfer-Encoding>
    <Content-Type>text/xml; charset=UTF-8</Content-Type>
    <Accept>*</Accept>
    <Cookie>mycookie=mytoken</Cookie>
    <Host>exampleHost</Host>
    <User-Agent>Java/1.5.0_14</User-Agent>
    <SOAPAction>"http://tempuri.org/IMyService/HelloWorld"</SOAPAction>
    </WebHeaders>
    </HttpRequest>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://exampleHost/WebServices/WCFService/Service.svc</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IMyService/HelloWorld</Action>
    </s:Header>
    <soap:Body>
    <HelloSayFirstName xmlns="http://tempuri.org/" xmlns:ns2="http://schemas.datacontract.org/2004/07/" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/">
    <dataContractValue></dataContractValue>
    </HelloSayFirstName>
    </soap:Body>
    </soap:Envelope>
    It seems that the SOAPAction in the http header and the soap header is incorrect. Is there any reason why the requestContext would keep hold of the action that was previously called, and not use the new action? I'm stumped here - any help would be greatly appreciated.
    Cheers.

    Does not only happen when using JAX-WS.
    the following servlet code is enough to reproduce the problem :
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setContentType("text/xml;charset=\"utf-8\"");
    It only occurs on 10.1.3.4.0 (works fine on 10.1.3.3.0 and 11.1.1.1.0 TP4)
    Regards

  • XML not well formed - Java Mapping, Webservice to RFC Scenario

    Hello All Experts,
    I have facing a strange type of error. I have written a Java Mapping which implements a DOM parser to take a request from a Webservice and validate it on the basis of some prerequisites. i.e. If data in the incoming request is valid, it creates a message of the same structure type as the input. If the incoming data is incorrect or incomplete; It generates an Error response structure.
    When I run and test the same mapping program using Editplus Java editor for the error scenario; it executes perfectly and creates the correct error XML structure. (I checked it by importing the structure in the XI Message mapping test tab). But when I create jar of my java mapping program and test it in my interface mapping, it gives me "XML not well formed error" (Problem while building the tree).
    Any idea as to why is it behaving in such a way? There are 2 reasons which come to my mind as of now:
    1. The initilization of my input and output streams in the public static void main:
                InputStream in = new FileInputStream(new File("Input.xml"));
               OutputStream out = new FileOutputStream(new File("Output.xml"));
               validateXML myMapping = new ValidateXML();
                myMapping.execute(in, out);
    The Output.xml has the xml structure for the correct case, do I have to initialize my outputstream for the error file? say error.xml
    2. My Webservice interface is a sychronous interface (Request / Response) and output of the Java mapping program are two asynchronous interface. (I'll use a synch-asynch bridge when this works) - Is that causing a problem?
    Please help.
    Best regards,
    Varun

    Hello Varun,
    it gives me "XML not well formed error" (Problem while building the tree).
    I have come across the same error message while testing in interface mapping. My problem was when an exception occured in java mapping, the execution terminates with the messages XML not well formed error". In order to solve this issue what i did was catch the exception type TransformerException and in that catch block throw StreamTransformationException exception in main methos of mapping program i.e execute().
    eg:-                                                                               
    catch (TransformerException e) {
                   throw new StreamTransformationException("Can not write XML.", e);
    By doing this you will see the exception raised , because some times when you execute your mapping with mail() method, though it create the file, when you try to open it will give error if any exceptions occured in mapping. By using the above notation you can handle those in java mapping.
    Hope you have gone through this blog.
    [Handling and Tracing Exceptions in java mapping|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417700)ID1055371050DB01666765031379427182End?blog=/pub/wlg/15061]
    Regards,
    Prasanna

  • Java application -- webservice ---   XI  ( RFC )  ?

    Hi friends ,
                <b>        My scenario is like I want  via web service  I need to pass request to RFC and get the response back . This calling webservice is external java application .</b>
                       Can u please tell me What steps i  have to do in XI  ?
                       I have to do synchronous Interface between RFC and webservice right ?
                       <b>First I have done  this scenario  by  designing IR  and in Configuration I have used SOAP Sender and RFC Receiver adapter .  Using Synchronous Interface</b>
                       Using Tools -- > Define WebService . I have Defined that   as WebService . I has creatd the WSDL File for me.
                       I have  given the SWDL file and the URL like the following
      http://xidev:8021/XISOAPAdapter/MessageServlet?channel=:BS_DISTANCE_CHECK_SOAP:CC_DistanceCheck_SOAP_Sender
                            If i copy and paste this URL in my pc .It is showing the Message Servlet  Status OK . and some informations also it is giving .
                      But the java guys try to use this URL in their web service calling module it is not working .
            <b>          The way what i have done is corret ?</b>  or something i have to do ? 
                   <b>   What input i have to give to Java Guys to call the webservice ?</b>
                           Can you please give your suggestions asap
    Best Regards .,.
    V.Rangarajan

    Hi Bhavesh  ,
                      Thanks for your reply.
                   Then  that URL and WSDL File  Which i have given to the Java guys is  enough ?
                    I  have one doubt .I don't know  much about  the webservices .
                    Don't we need SOAP Receiver Adapter for this ?
                    How the external application will get back the result ?
    Best Regards .,
    V.Rangarajan

  • Need Help in Java 6 - Webservices

    Hello,
    Im creating webservices application using NetBeans 5.5.1,Platform version Java Se 6. Im using the example from this site http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/* ,When i deploy the application,its display the below error,
    java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/Webservices/build/web/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
    where i can put the Jaxb 2.1 Api ? Pls help me and give example for solving the problem with clear explanation!!!
    Thanks
    Regards,
    Prabhu.K

    PrabhuWinJava wrote:
    hi,
    I can't get from u!!! Can u pls explain clearly....
    Thanks for ur kind attendance...
    Regards,
    Prabhu.KYou want them to explain clearly?

  • Xletview , java tv,  webservices and jaxm.properties..

    Hi.
    I am running C:\jwsdp-1.2 and C:\j2sdk1.4.2_05 .. I am doing a test
    on JavaTv using XletView. It failed when I run it in the XletView emulator. Where can i obtain the jaxm.properties..
    xjava.io.File - C:\j2sdk1.4.2_05\jre\lib\jaxm.properties
    java.lang.NullPointerException
    at com.sun.xml.rpc.soap.message.SOAPMessageContext.createMessage(SOAPMes
    sageContext.java:114)
    at com.sun.xml.rpc.client.StreamingSenderState.<init>(StreamingSenderSta
    te.java:32)
    at com.sun.xml.rpc.client.StreamingSender._start(StreamingSender.java:48
    at com.francetelecom.rd.orion.webservice.OrionWebServicePortType_Stub.ge
    tArrayOfMembers(OrionWebServicePortType_Stub.java:1620)
    at com.francetelecom.rd.orion.webservice.OrionWebServicePortTypeClient.g
    etArrayOfMembers(OrionWebServicePortTypeClient.java:72)
    at com.francetelecom.rd.orion.controller.Welcome.setUp(Welcome.java:79)
    at com.francetelecom.rd.orion.xlet.OrionXlet.initXlet(OrionXlet.java:58)
    at net.beiker.xletview.xlet.XletManager.initXlet(Unknown Source)
    at net.beiker.xletview.xlet.XletManager.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:534)

    My question is where is this file .. I can't see it anywhere.. I am using C:\jwsdp-1.2

  • Java class - webservice

    Hi Experts,
    How to consume more than 2 webservices in Java class? And how to expose that Java class (which contains two webservices) as a webservice?
    Regards
    Sara

    Hi,
      Check this link.
    http://help.sap.com/saphelp_nw04s/helpdata/en/7d/cf0c8abcc34594ba9d3bbd5dd22155/frameset.htm
    Steps:
    1) Create Web module project (WM)
    2) Create Enterprise appl project. (EA)
    3) Right click WM and add to EA.
    4) Right click WM and create bean. Stateless session bean.
    5) Copy all java classes to source folder.
    6) Right click bean and open. create methods for exposing here.
    7) Right click bean and create webservice.
    8) Once webservice created, right click EA project and deploy to server.
    Regards,
    Harini S

  • BO 4.1 WEBI Metadata extraction using Java Restful Webservice

    Hi
    We are building an application using the Restful webservice and are trying to extract the metadata from the webi report.
    Whether there is any URL to retrieve Query filter in web Intelligence Report.
    Please help.
    Regards,
    Kavitha S

    Assuming this is a BEX query, you may want to check p. 296 in the following; SAP Web Intelligence RESTful web service SDK User Guide, SAP BusinessObjects Business Intelligence platform 4.1
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Urgent :: 11g Invoking Composite from Java/From Webservice Proxy

    Hi All,
    i have a requirement where in need to when ever the exception occurs it invokes custom java and then it invoked a BPEL process to handle the errror.
    in 10.1.3.4 i used to Java Api to invoke the BPEL process and it works fine.
    1) . now we are migrating to 11g, i know this API wont work with 11g as the server is on weblogic and client librairies may be different for invoking in composite it in 11g. if any body has invoked a composite using java and the using 11g libraries to invoke the composite ? if so can you please post here ?
    2). otherway i tried to create a Web Service proxy using Jdeveloper for the composite, when i test it using Jdeveloper it is working fine, but when i place it in the lib directory, im getting a bad response from server 503.
    please see logs below for the second approch
    Caused by: javax.xml.ws.WebServiceException: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 503 Service Unavailable
         at oracle.j2ee.ws.client.jaxws.DispatchImpl.invokeOneWay(DispatchImpl.java:989)
         at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.synchronousInvocationWithRetry(OracleDispatchImpl.java:224)
         at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.invokeOneWay(OracleDispatchImpl.java:102)
         at oracle.integration.platform.blocks.soap.AbstractWebServiceBindingComponent.dispatchRequest(AbstractWebServiceBindingComponent.java:447)
         ... 61 more
    Caused by: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 503 Service Unavailable
         at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call2(HttpSOAPConnection.java:209)
         at oracle.j2ee.ws.common.transport.HttpTransport.transmit(HttpTransport.java:73)
         at oracle.j2ee.ws.common.async.MessageSender.call(MessageSender.java:64)
         at oracle.j2ee.ws.common.async.Transmitter.transmitSync(Transmitter.java:134)
         at oracle.j2ee.ws.common.async.Transmitter.transmit(Transmitter.java:90)
         at oracle.j2ee.ws.common.async.RequestorImpl.transmit(RequestorImpl.java:273)
         at oracle.j2ee.ws.common.async.RequestorImpl.invokeOneWay(RequestorImpl.java:169)
         at oracle.j2ee.ws.client.jaxws.DispatchImpl.invokeOneWay(DispatchImpl.java:985)
         ... 64 more
    Caused by: javax.xml.soap.SOAPException: Bad response: 503 Service Unavailable
         at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.processHttpResponseCode(HttpSOAPConnection.java:603)
         at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.post2(HttpSOAPConnection.java:469)
         at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:1203)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call2(HttpSOAPConnection.java:207)
         ... 71 more
    if any body has already implemented the invocation of composite in one of above approaches, please let me know.
    any pointers to resolve this will be of great help
    Thanks
    Nadh

    Here is sample to invoke a composite from JSP, this should be same from Java Class. Note that the composite should use adf binding and not ws binding.
    Here is snippet of composite.xml service:
    <service name="rmibpel_client_ep" ui:wsdlLocation="RMIBPEL.wsdl">
    <interface.wsdl interface="http://xmlns.oracle.com/Application1/RmiVsSOAP/RMIBPEL#wsdl.interface(RMIBPEL)"/>
    <binding.adf serviceName="rmibpel_client" registryName=""/> </service>
    Note the binding should be binding.adf and not binding.ws
    Sample jsp:
    <%@page import="java.util.Hashtable" %>
    <%@page import="java.util.Map" %>
    <%@page import="javax.naming.Context" %>
    <%@page import="oracle.soa.management.facade.Locator" %>
    <%@page import="oracle.soa.management.facade.LocatorFactory" %>
    <%@page import="oracle.fabric.common.NormalizedMessage" %>
    <%@page import="oracle.soa.management.util.NormalizedMessageImpl" %>
    <%@page import="oracle.soa.management.facade.Composite" %>
    <%@page import="oracle.soa.management.facade.Service" %>
    <html>
    <head>
    <title>Invoke HelloWorld</title>
    </head>
    <body>
    <%
    String msg = request.getParameter("world");
    if(msg == null)
    msg = "World";
    String xml = "<process xmlns=\"http://xmlns.oracle.com/Application1/RmiVsSOAP/RMIBPEL\"><input>" + msg + "</input></process>";
         Hashtable jndiProps = new Hashtable();
         jndiProps.put(Context.PROVIDER_URL,"t3://strec03-1.us.oracle.com:8001/soa-infra");
    jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    jndiProps.put(Context.SECURITY_PRINCIPAL,"weblogic");
    jndiProps.put(Context.SECURITY_CREDENTIALS,"weblogic");
    jndiProps.put("dedicated.connection","true");
    Locator locator = LocatorFactory.createLocator(jndiProps);
         String compositeDN = "default/RmiVsSOAP!1.0";
    Composite composite = locator.lookupComposite(compositeDN);
    String serviceName = "rmibpel_client_ep";
    Service deliveryService = composite.getService(serviceName);
    System.out.println("composite=" + composite);
    System.out.println("deliveryServce=" + deliveryService);
    // construct the normalized message and send to Oracle WLS
    NormalizedMessage nm = new NormalizedMessageImpl();
    nm.getPayload().put("payload", xml );
         NormalizedMessage res = null;
         try {
              res = deliveryService.request("process", nm);
         catch(Exception e)
         e.printStackTrace();
    Map payload = res.getPayload();
    out.println( "BPELProcess HelloWorldService executed!<br>");
    //See below output in log file
    oracle.xml.parser.v2.XMLElement elem =
         (oracle.xml.parser.v2.XMLElement) payload.get("payload");
    elem.print(System.out);
    %>

  • Is there Session in java's webservice?

    I wanna store my database connection in a global variable,
    for example, a Session or an Application,
    what can I do?

    Thank you very much!
    I search a java file named DBConnectionManager.java which could do the job.
    The source code is below:
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import java.util.Date;
    //����DBConnectionManager
    public class DBConnectionManager {
    static private DBConnectionManager instance;
    static private int clients;
    private Vector drivers = new Vector();
    private PrintWriter log;
    private Hashtable pools = new Hashtable();
    //��������������
    static synchronized public DBConnectionManager getInstance() {
    if (instance == null) {
    instance = new DBConnectionManager();
    clients++;
    return instance;
    //����������
    private DBConnectionManager() {
    init();
    //������������
    //������������
    public void freeConnection(String name, Connection con) {
    DBConnectionPool pool = (DBConnectionPool) pools.get(name);
    if (pool != null) {
    pool.freeConnection(con);
    //����������������
    //������������
    public Connection getConnection(String name) {
    DBConnectionPool pool = (DBConnectionPool) pools.get(name);
    if (pool != null) {
    return pool.getConnection();
    return null;
    public Connection getConnection(String name, long time) {
    DBConnectionPool pool = (DBConnectionPool) pools.get(name);
    if (pool != null) {
    return pool.getConnection(time);
    return null;
    //����getconnection
    //������������
    public synchronized void release() {
    if (--clients != 0)
    return;
    Enumeration allPools = pools.elements();
    while (allPools.hasMoreElements()) {
    DBConnectionPool pool = (DBConnectionPool) allPools.nextElement();
    pool.release();
    Enumeration allDrivers = drivers.elements();
    while (allDrivers.hasMoreElements()) {
    Driver driver = (Driver) allDrivers.nextElement();
    try {
    DriverManager.deregisterDriver(driver);
    log("����JDBC��������" + driver.getClass().getName());
    catch (SQLException e) {
    log(e, "��������JDBC��������������" + driver.getClass().getName());
    private void createPools(Properties props) {
    Enumeration propNames = props.propertyNames();
    while (propNames.hasMoreElements()) {
    String name = (String) propNames.nextElement();
    if (name.endsWith(".url")) {
    String poolName = name.substring(0, name.lastIndexOf("."));
    String url = props.getProperty(poolName + ".url");
    if (url == null) {
    log("����������" + poolName + "������URL");
    continue;
    String user = props.getProperty(poolName + ".user");
    String password = props.getProperty(poolName + ".password");
    String maxconn = props.getProperty(poolName + ".maxconn", "0");
    int max;
    try {
    max = Integer.valueOf(maxconn).intValue();
    catch (NumberFormatException e) {
    log("������������������" + maxconn + ".������" + poolName);
    max = 0;
    DBConnectionPool pool = new DBConnectionPool(poolName, url, user,
    password, max);
    pools.put(poolName, pool);
    log("��������������" + poolName);
    private void init() {
    InputStream is = getClass().getResourceAsStream("/db.properties");
    Properties dbProps = new Properties();
    try {
    dbProps.load(is);
    catch (Exception e) {
    System.err.println("������������������������db.properties������CLASSPATH��");
    return;
    String logFile = dbProps.getProperty("logfile", "DBConnectionManager.log");
    try {
    log = new PrintWriter(new FileWriter(logFile, true), true);
    catch (IOException e) {
    System.err.println("������������������" + logFile);
    log = new PrintWriter(System.err);
    loadDriver(dbProps);
    createPools(dbProps);
    private void loadDriver(Properties props) {
    String driverClasses = props.getProperty("drivers");
    StringTokenizer st = new StringTokenizer(driverClasses);
    while (st.hasMoreElements()) {
    String driverClassName = st.nextToken().trim();
    try {
    Driver driver = (Driver) Class.forName(driverClassName).newInstance();
    DriverManager.registerDriver(driver);
    drivers.addElement(driver);
    log("����������������" + driverClassName);
    catch (Exception e) {
    log("����������������:" + driverClassName + ",����" + e);
    private void log(String msg) {
    log.println(new Date() + ":" + msg);
    private void log(Throwable e, String msg) {
    log.println(new Date() + ":" + msg);
    e.printStackTrace(log);
    class DBConnectionPool {
    private int checkOut;
    private Vector freeConnections = new Vector();
    private int maxconn;
    private String name;
    private String password;
    private String URL;
    private String user;
    public DBConnectionPool(String name, String URL, String user,
    String password, int maxconn) {
    this.name = name;
    this.URL = URL;
    this.password = password;
    this.user = user;
    this.maxconn = maxconn;
    public synchronized void freeConnection(Connection con) {
    freeConnections.addElement(con);
    checkOut--;
    notifyAll();
    public synchronized Connection getConnection() {
    Connection con = null;
    if (freeConnections.size() > 0) {
    con = (Connection) freeConnections.firstElement();
    freeConnections.removeElementAt(0);
    try {
    if (con.isClosed()) {
    log("��������" + name + "������������");
    con = getConnection();
    catch (SQLException e) {
    log("��������" + name + "������������");
    con = getConnection();
    else if (maxconn == 0 || checkOut < maxconn) {
    con = newConnection();
    if (con != null) {
    checkOut++;
    return con;
    public synchronized Connection getConnection(long timeout) {
    long startTime = new Date().getTime();
    Connection con;
    while ( (con = getConnection()) == null) {
    try {
    wait(timeout);
    catch (InterruptedException e) {}
    if ( (new Date().getTime() - startTime) >= timeout) {
    return null;
    return con;
    public void release() {
    Enumeration allConnections = freeConnections.elements();
    while (allConnections.hasMoreElements()) {
    Connection con = (Connection) allConnections.nextElement();
    try {
    con.close();
    log("����������" + name + "��������");
    catch (SQLException e) {
    log(e, "��������������" + name + "��������");
    freeConnections.removeAllElements();
    private Connection newConnection() {
    Connection con = null;
    try {
    con = DriverManager.getConnection(URL, user, password);
    log("������" + name + "����������������");
    catch (SQLException e) {
    log(e, "������������URL������" + URL);
    return null;
    return con;
    }

  • How make setting Java Application Webservice can Test?

    Hi all,
    I want to ask everyone, i have trouble when after record my java application using e tester where is i can't playback until the application end. The problem is caused in our application should be input data and when playback the data i was input can't display when playback.
    the message in result summary is "Timed out after last event played"

    hi,
    there is a possibility of creating executables from java classes: Microsoft Visual J++
    However, you'll always need a virtual machine, even the executables created with MSVJ++ require the Microsoft Virtual Machine - either bundled with the exe file or installed on the user's system.
    best regards, Michael

  • Extract Hierarchies in BO 4.1 WEBI using Java Restful Webservice

    Hi ,
    We are using Bo4.1 SP3.
    Whether can we extract hierarchies from web intelligence report?
    Whether there is any URL to extract hierarchies?
    Regards,
    Kavitha S

    Hi Anthony,
    Sorry for late reply.
    Thanks for your reply.
    I got hierarchies by using below URL
    GET <webiURL>/documents/{documentId}/links/{linkId}
    Regards,
    Kavitha S

  • Problem with servicegen and how to convert java classes to webservices

    I am a beginner and am trying to convert all my java code into webservices,I have
    a java class Test.java and number of other third party libraries and my own java
    files that are reffered in Test.java. I want to expose the public methods in Test.java
    as webservices.
    the serivegen part of My build.xml is as below
    <servicegen
    destEar="${APPLICATIONS}/${ear_file}"
    warName="${war_file}">
    <service
    javaClassComponents="com.verizon.Test"
    targetNamespace="${namespace}"
    serviceName="Test"
    serviceURI="/Test"
    generateTypes="True"
    expandMethods="True">
    </service>
    <classpath>
    <pathelement path="${build}"/>
    <pathelement path="${java.class.path}"/>
    </classpath>
    </servicegen>
    When i run ant it complains:
    [servicegen] weblogic.xml.schema.binding.BindingException: Invalid class received:
    interface org.apache.crimson.tree.ElementFactory loaded from file:/apps/opt/crimson.jar!/org/apache/crimson/tree/ElementFactory.class.
    All classes that will be serialized or deserialized must be non-interface, non-abstract
    classes that provide a public default constructor
    I have no clue,Why is Servicegen introspecting the third party class file also?I
    just need the public methods in Test.java exposed and Test.java will just use
    the third party library.
    also,is there a way to tell servicegen to include all these java files X,Y,Z to
    the war file/ear files but expose only the public methods of X in the WSDL.
    Please help
    thanks
    Suresh

    Hi Bruce,
    Thanks very much for the insight u provided.Yes one of my public methods was returning
    a element factory.
    But let me ask my question this way:
    Is there a way to tell servicegen to take only the specified public methods in
    a class to make them as webservices?
    by default servicegen is taking all the public methods..,i workaround i found
    is to deploy the webservice manually by writing the web-services.xml to include
    only the required public methods.
    thanks
    Suresh
    Bruce Stephens <[email protected]> wrote:
    Hi Suresh,
    Does your Test.java have a public method that returns the element
    factory of an XML document, like "public ElementFactory
    getElementFactory ();" or such?
    If so, you may want to check out the supported build-in and non-built-in
    data types:
    http://edocs.bea.com/wls/docs81/webserv/assemble.html#1060696
    Concerning your last question, you can use the excludeEJBs, includeEJBs
    (in combination with the ejbJar attribute) to specify which non-built-in
    data type components should be generated. Or if you use the
    javaClassComponents then simply use a comma separated list of class
    names.
    Hope this helps,
    Bruce
    suresh wrote:
    I am a beginner and am trying to convert all my java code into webservices,Ihave
    a java class Test.java and number of other third party libraries andmy own java
    files that are reffered in Test.java. I want to expose the public methodsin Test.java
    as webservices.
    the serivegen part of My build.xml is as below
    <servicegen
    destEar="${APPLICATIONS}/${ear_file}"
    warName="${war_file}">
    <service
    javaClassComponents="com.verizon.Test"
    targetNamespace="${namespace}"
    serviceName="Test"
    serviceURI="/Test"
    generateTypes="True"
    expandMethods="True">
    </service>
    <classpath>
    <pathelement path="${build}"/>
    <pathelement path="${java.class.path}"/>
    </classpath>
    </servicegen>
    When i run ant it complains:
    [servicegen] weblogic.xml.schema.binding.BindingException: Invalidclass received:
    interface org.apache.crimson.tree.ElementFactory loaded from file:/apps/opt/crimson.jar!/org/apache/crimson/tree/ElementFactory.class.
    All classes that will be serialized or deserialized must be non-interface,non-abstract
    classes that provide a public default constructor
    I have no clue,Why is Servicegen introspecting the third party classfile also?I
    just need the public methods in Test.java exposed and Test.java willjust use
    the third party library.
    also,is there a way to tell servicegen to include all these java filesX,Y,Z to
    the war file/ear files but expose only the public methods of X in theWSDL.
    Please help
    thanks
    Suresh

  • How to call webservices in business objects from java

    hi everyone, i am having a scenerio were a program which is written in java, this java program will instantiate when i get the data into my database. the java program need to fire and pass the parameters to the webservices in the business objects to create a file depending upon the parameters which r passed by the java to webservices. how i need to cinfigure in business objects webservicess,to get what i am looking or what r the things i need
    we r using xi 3.1 sp3, web application server tomcat.

    Hi,
    case 1: for WDP, you can create the web service model via "Import Adaptive Web Service" or "Import Web Service Model (deprecated)" by supplying wsdl URL.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/faq%2b-%2bmodels%2b-%2badaptive%2bweb%2bservice
    case 2: In ABAP, create a proxy object at trx code SE80.
    http://help.sap.com/saphelp_nw04s/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/frameset.htm
    Both cases are wizard-based. It's pretty intuitive.
    - julius

  • Error while invoking a webservice using Axis deployed in  tomacat from Bpel

    Hi,
    I am trying to invoke a Axis webservice(from Java class to WSDL- bottom up java bean webservice approach) developed in Exclipse IDE, deployed in Tomcat.
    When i am trying to invoke the service, from Bpel from Jdeveloper it is throwing error as such :
    Invoke_1 (faulted)
    [2009/05/22 14:32:18] Faulted while invoking operation "storeLoanData" on provider "LoanDataPersist".less
    -<messages>
    -<input>
    -<Invoke_1_storeLoanData_InputVariable>
    -<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="p_request">
    -<p_request xmlns="" xmlns:def="http://dtos.demo.com" xsi:type="def:LoanDataPersistRequest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <customerName>wew
    </customerName>
    <netIncome>12
    </netIncome>
    <loanAmount>12
    </loanAmount>
    <realEstateAddress>wew
    </realEstateAddress>
    <customerID/>
    </p_request>
    </part>
    </Invoke_1_storeLoanData_InputVariable>
    </input>
    -<fault>
    -<remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
    -<part name="summary">
    <summary>exception on JaxRpc invoke: trailing block elements must have an id attribute
    </summary>
    </part>
    </remoteFault>
    </fault>
    </messages>
    I may add that, the WSDL generated is using "soap:enc:array ", rpc style.
    Can anyone tell me the reason and suggest .

    Hi Marc,
    Thanks for the guidancer. But sir, i am unable to detect at which place i have to do the required changes.I found p_request as a parameter in the method only in the interface only.
    As bcos ultimately , i am generating the tomcat /axis web service (WSDL) from the java class, which is using 2 Request and response java bean, in which they are doing someing like this:
    private static org.apache.axis.description.TypeDesc typeDesc =
    new org.apache.axis.description.TypeDesc(LoanDataPersistRequest.class, true);
    static {
    typeDesc.setXmlType(new javax.xml.namespace.QName("http://dtos.demo.com", "LoanDataPersistRequest"));
    org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
    elemField.setFieldName("customerName");
    elemField.setXmlName(new javax.xml.namespace.QName("", "customerName"));
    elemField.setXmlType(new javax.xml.namespace.QName("", "string"));
    elemField.setNillable(true);
    etc etc...................}
    And second thing is when the WSDL is generated, from that the stubs and skeletons is generated to test the service.
    There in the Stub i found out "p_request" in this place:
    private static void _initOperationDesc1(){
    org.apache.axis.description.OperationDesc oper;
    org.apache.axis.description.ParameterDesc param;
    oper = new org.apache.axis.description.OperationDesc();
    oper.setName("storeLoanData");
    param = new org.apache.axis.description.ParameterDesc(*new javax.xml.namespace.QName("", "p_request")*, org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://dtos.demo.com", "LoanDataPersistRequest"), com.demo.dtos.LoanDataPersistRequest.class, false, false);
    oper.addParameter(param);
    oper.setReturnType(new javax.xml.namespace.QName("http://dtos.demo.com", "LoanDataPersistResponse"));
    oper.setReturnClass(com.demo.dtos.LoanDataPersistResponse.class);
    oper.setReturnQName(new javax.xml.namespace.QName("", "storeLoanDataReturn"));
    oper.setStyle(org.apache.axis.constants.Style.RPC);
    oper.setUse(org.apache.axis.constants.Use.ENCODED);
    _operations[0] = oper;
    And in skeleton :
    static {
    org.apache.axis.description.OperationDesc _oper;
    org.apache.axis.description.FaultDesc _fault;
    org.apache.axis.description.ParameterDesc [] _params;
    _params = new org.apache.axis.description.ParameterDesc [] {
    new org.apache.axis.description.ParameterDesc(*new javax.xml.namespace.QName("", "p_request")*, org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://dtos.demo.com", "LoanDataPersistRequest"), com.demo.dtos.LoanDataPersistRequest.class, false, false),
    oper = new org.apache.axis.description.OperationDesc("storeLoanData", params, new javax.xml.namespace.QName("", "storeLoanDataReturn"));
    _oper.setReturnType(new javax.xml.namespace.QName("http://dtos.demo.com", "LoanDataPersistResponse"));
    _oper.setElementQName(new javax.xml.namespace.QName("urn:com.demo.service", "storeLoanData"));
    _oper.setSoapAction("");
    myOperationsList.add(oper);
    if (_myOperations.get("storeLoanData") == null) {
    _myOperations.put("storeLoanData", new java.util.ArrayList());
    ((java.util.List)_myOperations.get("storeLoanData")).add(_oper);
    PLease suggest if i make some changes in stub and skeleton how it would reflect the WSDL... or else please suggest where shud i do the required changes.

Maybe you are looking for

  • Windows 7 64 Bit install on Imac 2010 Using Boot Camp PLease Help

    OK so I am trying to install my 64 bit windows 7 using bootcamp on my imac 2010 i just bought it today. I have created the partition and the computer restarted and went to windows 7 setup however it then told me it could not find any drivers for the

  • New MBP 15 running 10.10.2 constantly hangs

    Hi All, I am new to Mac, 2 weeks and would like your assistance. I just purchased a new 15 MBP which is running 10.10.2. 15 Retina MBP Mid 2014 2.2 GHz Intel i7 16 GB 1600 MHz DDR3 Firevault is disabled. The issues: Cant Log in (After power cycle, Af

  • Two iPhotos on Launchpad

    I recently got a new computer for college. It is a a v.10.7.4, 15 inch, 2.4 GHz processor MacBook Pro, and has gotten all the most recent Software Updates. However, following my iPhoto 9.3 update, I noticed an issue. In Launchpad iPhoto appears twice

  • When Will an Unused iTunes Account be Deactivated?

    I've been outside the U.S. for 16 months, and I haven't used my iTunes account. Is it still active? Until how long? What can I do from overseas to keep it alive?

  • Jdbc and applet

    I have Jdbc code which is running fine as a stand alone program. When i integrated it with an apllet it gives me access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc) I m using netbeans. 3.6 The intersting thing is the code r