Tuxedo service in JAVA

Can i write a tuxedo service using JAVA...does tuxedo provide APIs for that ?

Hi,
You can build any binary executable that calls Java and vice versa, using JNI, but then, manageing a tpreturn(3c) without getting back to the C stub sounds dangerous, when you know what tpreturn(3c) does (longjump). Put your JavaCose Caller C Function in a library, and it can be called from any C code.
Then you need to be aware that you loose some good points of Java: How can you make a ThreadDump in that context?
Also it rises new basic questions: Will Java's Multiple threads interfere with Tuxedo MultiThreaded server-side architecture? How can all the threads of your server safely share the same JVM instance? What about the classloaders? The Database connections? The XA Interface?
But if you do so, be warned about the memory leak problems you may face. Some products use that technology, but have to commit suicide every 10000 requests to avoid memory leaks.
I would strongly advice you to benchmark your executables so as to prevent that from happening...
A++
Lionel

Similar Messages

  • I have a problem when running my own EJB as a TUXEDO service using WTC.

    Hello,
    I have a problem when running my own EJB as a TUXEDO service using WTC. I am using TUXEDO 8.1 and WL 9.1.
    When I am trying to run my own EJB as a TUXEDO service error appears.
    TPENOENT(6):0:0:TPED_MINVAL(0):QMNONE(0):0:Could not find service TOUPPER
    at weblogic.wtc.gwt.WTCService.getImport(WTCService.java:4988)
    at weblogic.wtc.gwt.TuxedoConnection.getImport(TuxedoConnection.java:303)
    at weblogic.wtc.gwt.TuxedoConnection.tpcall(TuxedoConnection.java:1302)
    at examples.MyTestSessionBean.Toupper(MyTestSessionBean.java:102)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:61)
    at net.roseindia.web.servlets.SessionTestServlet.doGet(SessionTestServlet.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    e8
    10
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NullPointerException
    at weblogic.ejb.container.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:95)
    at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:713)
    at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:681)
    at weblogic.ejb.container.internal.BaseEJBObject.postInvoke1(BaseEJBObject.java:447)
    at weblogic.ejb.container.internal.StatelessEJBObject.postInvoke1(StatelessEJBObject.java:72)
    at weblogic.ejb.container.internal.BaseEJBObject.postInvokeTxRetry(BaseEJBObject.java:374)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:75)
    at net.roseindia.web.servlets.SessionTestServlet.doGet(SessionTestServlet.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    Caused by: java.lang.NullPointerException
    at examples.MyTestSessionBean.Toupper(MyTestSessionBean.java:130)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:61)
    ... 15 more
    Any clue on this.
    With Regards,
    MVS

    If you are trying to create a Tuxedo service in Java using WTC you need to develop an EJB that implements the TuxedoService interface and register its home in JNDI so WTC can look it up. Once that is done you can then export the service to a remote domain in the WTC configuration.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • Calling Tuxedo Service using BEA Jolt.

    I'm trying to call Tuxedo service from java stored procedure using BEA JOLT.My normal java client works fine but when i use the same client as java stored procedure i get following error message :
    can not connect to any //lucy:9021(host:port)
    Reason:Nwhdlr:can not open socket
    I've successfully loaded all required JOLT jar files using loadjava and created the procedure successfully .Java code is given below :
    import bea.jolt.*;
    import java.sql.*;
    public class JoltToTux
         public static void callTuxService() throws Exception
              JoltSession session;
              JoltSessionAttributes sattr;
              JoltRemoteService toupper;
              JoltTransaction trans;
              String userName=null;
              String userPassword=null;
              String appPassword=null;
              String userRole=null;
              String outstr;
              try {
              sattr = new JoltSessionAttributes();
              sattr.setString(sattr.APPADDRESS, "//lucy:9021");
              sattr.setInt(sattr.IDLETIMEOUT, 300);
              session = new JoltSession(sattr, userName, userRole,userPassword, appPassword);
                        toupper = new JoltRemoteService ("CB_EXESUB", session);
              toupper.setString("CLFY_SUB", "PingSrvr");
              toupper.call(null);
              System.out.println( "Call to Tuxedo complete" );
              outstr = toupper.getStringDef("WF_MESSAGE","" );
              System.out.println("return string : " + outstr);
                        session.endSession();
              System.exit(0);
              } //end of try
              catch (Exception e) {
                   // System.err.println(e.getMessage());}
                   e.printStackTrace();
         } // end main
         public static void main( String args[] ) {
              try {
                   JoltToTux jt = new JoltToTux();
                   jt.callTuxService();
              catch ( Exception e0 ) {
                   e0.printStackTrace();
    } // end ToUpper
    thanks
    anurag

    Ams,
    You can't do that with JOLT. You will need to use the WTC product,
    currently in beta - see WTC Questions and Answers
    Regards,
    Peter.
    Got a Question? Ask BEA at http://askbea.bea.com
    The views expressed in this posting are solely those of the author, and
    BEA
    Systems, Inc. does not endorse any of these views.
    BEA Systems, Inc. is not responsible for the accuracy or completeness of
    the
    information provided
    and assumes no duty to correct, expand upon, delete or update any of the
    information contained in this posting.
    Ams wrote:
    Hi Manoj,
    I want to call a tuxedo service and also want to update
    database (using entity beabs) in same transaction so I
    can't use AUTOTRAN , Am I right ?
    I am using bea.jolt.pool.SessionPool's startTransaction
    method to start a transaction and passing this
    to SessionPool's call method.
    Ams.
    "Manoj SASIDHARAN" <[email protected]> wrote:
    Hello Ams,
    Could u plz give more information abt the usage scenario. Another way
    to test
    would be to put AUTOTRAN=Y for the service in question.
    HTH
    regards
    MS
    "Ams" <[email protected]> wrote:
    Hi,
    I am calling Tuxedo service from ejb using jolt.
    I want the service call in transaction started in ejb.
    I am getting following error.
    LIBTUX_CAT:481: ERROR: Service xa_start returned -7
    Does jolt support transaction ?
    Ams
    [att1.html]

  • Passing data from jsp/servlet to a Tuxedo Service thru VIEW

    Hi..
    We are using Tuxedo10g R3 on AIX 5.3..
    We have a Tuxedo Service running which takes values from the VIEW and converts that to upper case.. From the jsp page v r passing values to the VIEW fields which will be accepted by the service..
    For testing v checked the service with a tuxedo client and it is working fine..
    We have defined a jolt repository file for this service and finished bulkloading and coded the servlet also.. After passing the datas from the jsp, the Tuxedo service is called and it is ended.. but in the service only blank values are passed or the datas are not passed to VIEW fields.. It is not showing any error..
    The repository file for this service:
    service=NSIMPSRV
    export=true
    inbuf=VIEW
    inview=sample
    outbuf=STRING
    param=FIRSTSTR
    type=string
    access=in
    param=SECONDSTR
    type=string
    access=in
    param=THIRDSTR
    type=string
    access=in
    param=S-FIRST
    type=string
    access=out
    param=S-SECOND
    type=string
    access=out
    param=S-THIRD
    type=string
    access=out
    and the servlet code for this service:
    Result result1;
    ServletSessionPool servletsession = (ServletSessionPool) joltsession.getSessionPool("demojoltpool");
    ServletDataSet joltdataset = new ServletDataSet();
    joltdataset.setValue("FIRSTSTR","Testing");
    joltdataset.setValue("SECONDSTR","Tuxedo");
    joltdataset.setValue("THIRDSTR","Views");
    result1 = servletsession.call("NSIMPSRV", joltdataset, null);
    System.out.println("FIRSTSTR:"+result1.getValue("S-FIRST",""));
    System.out.println("SECONDSTR:"+result1.getValue("S-SECOND",""));
    System.out.println("THIRDSTR:"+result1.getValue("S-THIRD",""));
    we are not sure why the datas have not been passed.. do anyone have any idea regarding this??
    Thanks..

    Hi Wayne,
    This is my view definition:
    VIEW sample
    # type cname fbna count flag size null
    string firststr - 1 - 10 -
    string secondstr - 1 - 10 -
    string thirdstr - 1 - 10 -
    ENDJolt repository file:
    service=NSIMPSRV
    export=true
    inbuf=VIEW
    inview=sample
    outbuf=VIEW
    outview=sample
    param=FIRSTSTR
    type=string
    access=inout
    param=SECONDSTR
    type=string
    access=inout
    param=THIRDSTR
    type=string
    access=inoutThe Servlet code is:
    package Servlet;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import bea.jolt.pool.servlet.weblogic.PoolManagerStartUp;
    import bea.jolt.pool.servlet.*;
    import bea.jolt.pool.ApplicationException;
    import bea.jolt.pool.SessionPoolException;
    import bea.jolt.pool.ServiceException;
    import bea.jolt.pool.SessionPoolManager;
    import bea.jolt.pool.*;
    * Servlet implementation class ZC00582Servlet
    public class VIEWServlet extends HttpServlet {
         private ServletSessionPoolManager joltsession = (ServletSessionPoolManager) SessionPoolManager.poolmgr;
    public VIEWServlet() {
    super();
    // TODO Auto-generated constructor stub
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
         response.setContentType("text/html");
         ServletResult result;
         Result result1;     
         String String1 = request.getParameter("FIRSTSTR");
         String String2 = request.getParameter("SECONDSTR");
         String String3 = request.getParameter("THIRDSTR");
         System.out.println("THE VALUES BEFORE CONVERSION");
         System.out.println("FIRSTSTR:"+String1);
         System.out.println("SECONDSTR:"+String2);
         System.out.println("THIRDSTR:"+String3);
         System.out.println("1..");     
         //ServletResult message;
         ServletSessionPool servletsession = (ServletSessionPool) joltsession.getSessionPool("demojoltpool");
         System.out.println("2..");
         ServletDataSet joltdataset = new ServletDataSet();
         //joltdataset.importRequest(request);
         System.out.println("3..");
         //joltdataset.setValue("firststr","Hi");
         joltdataset.setValue("firststr",String1);
         System.out.println("4..");
         //joltdataset.setValue("secondstr","hello");
         joltdataset.setValue("secondstr",String2);
         System.out.println("5..");
         //joltdataset.setValue("thridstr","fine");
         joltdataset.setValue("thirdstr",String3);
         System.out.println("6..");
         //result = (ServletResult) servletsession.call("NSIMPSRV", joltdataset, null);
         result1 = servletsession.call("NSIMPSRV", joltdataset, null);
         result = (ServletResult) result1;
         System.out.println("THE VALUES AFTER CONVERSION");
         System.out.println("FIRSTSTR:"+result.getStringValue("firststr",""));
         System.out.println("SECONDSTR:"+result.getStringValue("secondstr",""));
         System.out.println("THIRDSTR:"+result.getStringValue("thirdstr",""));     
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
    and my server program :
    IDENTIFICATION DIVISION.
    PROGRAM-ID. NSIMPSRV.
    AUTHOR. TUXEDO DEVELOPMENT.
    ENVIRONMENT DIVISION.
    CONFIGURATION SECTION.
    DATA DIVISION.
    WORKING-STORAGE SECTION.
    * Tuxedo definitions
    01 TPSVCRET-REC.
    COPY TPSVCRET.
    01 TPTYPE-REC.
    COPY TPTYPE.
    01 TPSTATUS-REC.
    COPY TPSTATUS.
    01 TPSVCDEF-REC.
    COPY TPSVCDEF.
    * Log message definitions
    01 LOGMSG.
    05 FILLER PIC X(10) VALUE
    "NSIMPSRV :".
    05 LOGMSG-TEXT PIC X(50).
    01 LOGMSG-LEN PIC S9(9) COMP-5.
    * User defined data records
    01 STRING-DATA.
    COPY SAMPLE.
    LINKAGE SECTION.
    PROCEDURE DIVISION.
    START-FUNDUPSR.
    MOVE LENGTH OF LOGMSG TO LOGMSG-LEN.
    MOVE "Started" TO LOGMSG-TEXT.
    PERFORM DO-USERLOG.
    * Get the data that was sent by the client
    MOVE LENGTH OF STRING-DATA TO LEN.
    CALL "TPSVCSTART" USING TPSVCDEF-REC
    TPTYPE-REC
    STRING-DATA
    TPSTATUS-REC.
    IF NOT TPOK
    MOVE "TPSVCSTART Failed" TO LOGMSG-TEXT
    PERFORM DO-USERLOG
    PERFORM EXIT-PROGRAM
    END-IF.
    IF TPTRUNCATE
    MOVE "Data was truncated" TO LOGMSG-TEXT
    PERFORM DO-USERLOG
    PERFORM EXIT-PROGRAM
    END-IF.
    MOVE FIRSTSTR TO LOGMSG-TEXT.
    PERFORM DO-USERLOG.
    MOVE SECONDSTR TO LOGMSG-TEXT.
    PERFORM DO-USERLOG.
    MOVE THIRDSTR TO LOGMSG-TEXT.
    PERFORM DO-USERLOG.
    INSPECT FIRSTSTR CONVERTING
    "abcdefghijklmnopqrstuvwxyz" TO
    "ABCDEFGHIJKLMNOPQRSTUVWXYZ".
    INSPECT SECONDSTR CONVERTING
    "abcdefghijklmnopqrstuvwxyz" TO
    "ABCDEFGHIJKLMNOPQRSTUVWXYZ".
    INSPECT THIRDSTR CONVERTING
    "abcdefghijklmnopqrstuvwxyz" TO
    "ABCDEFGHIJKLMNOPQRSTUVWXYZ".
    MOVE "Success" TO LOGMSG-TEXT.
    PERFORM DO-USERLOG.
    MOVE STRING-DATA TO LOGMSG-TEXT.
    PERFORM DO-USERLOG.
    SET TPSUCCESS TO TRUE.
    COPY TPRETURN REPLACING
    DATA-REC BY STRING-DATA.
    * Write out a log err messages
    DO-USERLOG.
    CALL "USERLOG" USING LOGMSG
    LOGMSG-LEN
    TPSTATUS-REC.
    * EXIT PROGRAM
    EXIT-PROGRAM.
    MOVE "Failed" TO LOGMSG-TEXT.
    PERFORM DO-USERLOG.
    SET TPFAIL TO TRUE.
    COPY TPRETURN REPLACING
    DATA-REC BY STRING-DATA.
    Thanks & Regards,
    Janani.

  • Unable to resolve 'tuxedo.services.TuxedoConnection'

    Hi
    I've just installed BEA Weblogic 7.0. I am currently using the examples server.
    I have attempted to set up the WTC, but I am getting the following error:
    Beginning statefulSession.Client...
    Creating Toupper
    converting allcaps
    *** here ***
    tperrno encountered: TPENOENT(6):0:0:TPED_MINVAL(0):QMNONE(0):0:Could not get
    Tu
    xedoConnectionFactory : javax.naming.NameNotFoundException: Unable to resolve
    't
    uxedo.services.TuxedoConnection' Resolved: 'tuxedo.services' Unresolved:'TuxedoC
    onnection' ; remaining name 'TuxedoConnection'
    Start server side stack trace:
    TPENOENT(6):0:0:TPED_MINVAL(0):QMNONE(0):0:Could not get TuxedoConnectionFactory
    : javax.naming.NameNotFoundException: Unable to resolve 'tuxedo.services.Tuxedo
    Connection' Resolved: 'tuxedo.services' Unresolved:'TuxedoConnection' ; remainin
    g name 'TuxedoConnection'
    at examples.wtc.atmi.simpapp.ToupperBean.Toupper(ToupperBean.java:116)
    at examples.wtc.atmi.simpapp.ToupperBean_8roqg7_EOImpl.Toupper(ToupperBe
    an_8roqg7_EOImpl.java:46)
    at examples.wtc.atmi.simpapp.ToupperBean_8roqg7_EOImpl_WLSkel.invoke(Unk
    nown Source)
    at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(Activata
    bleServerRef.java:87)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:762)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
    a:308)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    .java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    End server side stack trace
    End statefulSession.Client...
    Does anyone have any information?
    Many thanks.
    Rennay

    Hi
    The problem was that I didnt specify the "//" for the network address.
    Thanks.
    "Rennay" <[email protected]> wrote:
    >
    Hi
    I've just installed BEA Weblogic 7.0. I am currently using the examples
    server.
    I have attempted to set up the WTC, but I am getting the following error:
    Beginning statefulSession.Client...
    Creating Toupper
    converting allcaps
    *** here ***
    tperrno encountered: TPENOENT(6):0:0:TPED_MINVAL(0):QMNONE(0):0:Could
    not get
    Tu
    xedoConnectionFactory : javax.naming.NameNotFoundException: Unable to
    resolve
    't
    uxedo.services.TuxedoConnection' Resolved: 'tuxedo.services' Unresolved:'TuxedoC
    onnection' ; remaining name 'TuxedoConnection'
    Start server side stack trace:
    TPENOENT(6):0:0:TPED_MINVAL(0):QMNONE(0):0:Could not get TuxedoConnectionFactory
    : javax.naming.NameNotFoundException: Unable to resolve 'tuxedo.services.Tuxedo
    Connection' Resolved: 'tuxedo.services' Unresolved:'TuxedoConnection'
    ; remainin
    g name 'TuxedoConnection'
    at examples.wtc.atmi.simpapp.ToupperBean.Toupper(ToupperBean.java:116)
    at examples.wtc.atmi.simpapp.ToupperBean_8roqg7_EOImpl.Toupper(ToupperBe
    an_8roqg7_EOImpl.java:46)
    at examples.wtc.atmi.simpapp.ToupperBean_8roqg7_EOImpl_WLSkel.invoke(Unk
    nown Source)
    at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(Activata
    bleServerRef.java:87)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:762)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
    a:308)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    .java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    End server side stack trace
    End statefulSession.Client...
    Does anyone have any information?
    Many thanks.
    Rennay

  • Tuxedo Service can not find a Jolt Client AFter timeout occured

    We are using Java Servlet/Jolt client to access out backend
    Tuxedo services.
    Whenever a Tuxedo service timedout, like
    "***tpcall failed |TPETIME - timeout occured|",
    The Jolt client and Tuxedo services will be out of sync,
    and Tuxedo Server will show following error message:
    "JOLT_CAT:1518: "ERROR: Call handle and clientid have no matching requests".
    Whenever this happends, we must reboot out Jolt client connection. Otherwise we
    will keep geting above problem.
    Our Jolt timeout time is 2 minutes. And Tuxedo block time is
    1 min 30 sec. (We setip in our UBB config as
    BLOCKTIME 9 #9*10s (def SCANUNIT)=90s or 1 min and 30s.).
    It seems like Tuxedo service will be timeouted before Jolt timedout.
    Could someone give us some suggestion about the above problem?
    Thanks in advance!

    Which version of Jolt are you using? This problem seems to have been fixed in
    latest rolling patch for Jolt1.2. Contact BEA support for it.
    -Deepak
    Yux71 wrote:
    We are using Java Servlet/Jolt client to access out backend
    Tuxedo services.
    Whenever a Tuxedo service timedout, like
    "***tpcall failed |TPETIME - timeout occured|",
    The Jolt client and Tuxedo services will be out of sync,
    and Tuxedo Server will show following error message:
    "JOLT_CAT:1518: "ERROR: Call handle and clientid have no matching requests".
    Whenever this happends, we must reboot out Jolt client connection. Otherwise we
    will keep geting above problem.
    Our Jolt timeout time is 2 minutes. And Tuxedo block time is
    1 min 30 sec. (We setip in our UBB config as
    BLOCKTIME 9 #9*10s (def SCANUNIT)=90s or 1 min and 30s.).
    It seems like Tuxedo service will be timeouted before Jolt timedout.
    Could someone give us some suggestion about the above problem?
    Thanks in advance!

  • How to access .asmx Web Service using JAVA? Newbie

    Hello Experts,
    Currently, I have a project where in I have to access a ,NET web service. It is made of C#. I just want to ask how will I start the accessing process? I made this simple equation on how my project is.
    Java Project + C#.Net Web Service = Integration
    1. Do i need to create a Web Service too for the Java Project? If yes, What are the necessary tools needed for the creation of this Java Web Service?
    2. The .NET Web Service is available online. (It is made by other people).
    3. Based on the equation, what is the equivalent technology for the + sign?
    4. Can you site a concrete example for accessing a web service?
    5. I'm new here. Totally I have no idea where to start.
    6. Thank you experts.
    Edited by: Benedict.Aluan on 05 30, 08 1:38 PM
    Edited by: Benedict.Aluan on 05 30, 08 1:39 PM

    Hello
    Thanks a lot for your help ...
    I am developing simple J2EE based web service client using IBM WSAD 5.1. I have used the following code to call .asmx web service in Java
    String url = "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl";
         String namespace = "http://tempuri.org/";
         name = request.getParameter("txtName");
         try
              System.out.println("In Internet Service");
              ServiceFactory factory = ServiceFactory.newInstance();
              Service serv = factory.createService(new URL(url),new QName(namespace,"TempConvert"));
              System.out.println("Got Service......");
              Call obj = (Call)serv.createCall();
              System.out.println("Got Call......");
              obj.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,"");
              obj.setProperty(Call.OPERATION_STYLE_PROPERTY,"wrapped");
              obj.setTargetEndpointAddress(url);
              obj.setPortTypeName(new QName(namespace,"TempConvertSoap"));
              obj.setOperationName(new QName(namespace,"FahrenheitToCelsius"));
              obj.addParameter("param1",XMLType.XSD_STRING,String.class,ParameterMode.IN);
              obj.setReturnType(XMLType.XSD_STRING);
              System.out.println("Parameters Set.....");
              Object[] params = new Object[]{name};
              k = (String)obj.invoke(params);
              System.out.println("Result: "+k);
         catch(Exception e)
            System.out.println("Exception is : "+e);
        }But this code is throwing exception that
    Invalid Address "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl"I have also tried this URL with Java Proxy. But it showing the same error.
    Plz can u tell me how to access .asmx web service ?
    Waiting 4 reply.

  • How to consume the Abap web service in Java web-dynpro

    Hi Everyone,
    I want to consume ABAP web service in java web dynpro.
    so when i tried to create model in java web-dynpro, it gave me an error message saying "Invalid WSDL or WSDL not found".
    i think this error message is because, to access the WSDL of abap web-service, we need username and password, but the dialog box in java web-dynpro is not programmed to take username and password from us and send it to the server to get the WSDL.
    i came to this conclusion because i was able to successfully test my abap web-service in java portal. the java portal asked me the username and password to open the WSDL.
    So, please help me to consume the abap web service in java web-dynpro.
    Thanks in advance
    Regards
    Vikas

    Hi Vikas ,
       while creating a model in web-dynpro try to use the "import web service model" option and if you are using local server choose the local server option so that you can get the available web services which are in server, select one among them and continue you process.I think this is the some what easy way .
    If you want use the URL for wsdl better to once test the available service in server and copy that WSDL URL and paste over  WSDL textbox.
    I think this is pretty help ful to you
    Best Regards
    Srikatnh

  • Parse errors while creating a Web service from Java class!

    Can anybody tell me please, is it possible to create a Web Service from java class where the input from user is required ?
    I have the following program, which is successfully compiled, but when I'm trying to make a web service in JDeveloper, the following error occurs:
    "Validation failed.
    The implementation class primePackage.isPrime ofport type MyWebService contains parse errors."
    import java.io.*;
    import java.util.*;
    class isPrime
    public static void main (String args[])
    Scanner reader = new Scanner(System.in);
    int n;
    System.out.println ("Enter a number you want to know is it prime or not");
    n=reader.nextInt();
    if (isPrime(n))
    System.out.println ("True");
    else
    System.out.println ("False");
    static boolean isPrime (int n)
    int i=2;
    while (i<=n-1)
    if (n%i==0)
    return false;
    i++;
    return true;
    }

    Hi,
    Can anybody tell me please, is it possible to create
    a Web Service from java class where the input from
    user is required ?Yes, the parameters of your method will be mapped in WSDL.
    But i've some considerations about your code.
    I suggest you change the name of isPrime do Prime, its a good code convention to put the name of class starting with Upper case. and isn't good the name of class equals to name of method.
    I suggest you to change the "static boolean isPrime (int n)" to "public boolean isPrime(int n)" to publish a method as a WebService method it's must be public and not static. After this change try to generate your Web Service.
    Regards.

  • Calling a Web Service from Java

    Our java guru (who is out sick....AHHHH) created all the calls that are needed to access the web service that he has running. For example the call getLongList(String user, String password) will return a list of all outstanding transactions. He made a jar file that has service has class files for PortType, Service, Service Locator and Soap Binding stub.
    How do I call this web service from java? Do I have to import it into my classpath? or just call these parameters from within my java code?

    never mind...i got it

  • Calling a Web Service from Java Webdynpro

    Hi,
    Can any one give me step by setp details on how to call a Web Service from Java Webdynpro ?
    I tried creating a model using Import Web Service Model but when I completed creating the model, I got some errors as shown below.
    Error               The method setRouteGeometryLineArray(double[][]) in the type Trip is not applicable for the arguments (double[])     ComplexType_Trip.java     WS_INVOKE/gen_wdp/packages/com/cintas/test/model/p1     line 249
    thanks
    SBK

    Hi SBK,
    I assume you may already have read the [help guide|http://help.sap.com/saphelp_nw70/helpdata/EN/81/12703e5da3e946e10000000a114084/content.htm] This gives a pretty good idea of how to do it (step by step).
    Is there a typo in the error you pasted?
    Error The method setRouteGeometryLineArray(double][) in the type Trip is not applicable for the arguments (double[]) ComplexType_Trip.java WS_INVOKE/gen_wdp/packages/com/cintas/test/model/p1 line 249
    The square brackets [] after double in the method call appear to be reversed. Is that also in the code? or just a mistake here?
    Hope this points you in the right direction.
    BRgds,
    Simon

  • Web Service From Java class, serialization problem

    Hi,
    I want to create Web Service from Java class, I made java project, generated web service from it, create web service archive project and deployed it to WAS 6.40.
    My class have 2 methods,
    public int add(int a, int b);
    public MyResponse doSomthing(MyRequest req);
    I can succesfully call add method from Web Service Navigator, it works fine but when I call doSomthing methods I get the following error:
    <b>
    Deserializing fails. Nested message: XML Deserialization Error. Result class [com.mycomp.sap_tech.ws.MyRequest] does not have property [Amount] of type [java.lang.String]. It is required to load XML..
    </b>
    Any ideas how to resolve it?
    P.S. MyRequest class is exposed throw VI, has default constractor and public getters and setters for all properties. It implements Serializable as well. Any guesses?
    Thanks in advance,
    Victor.

    Hi Bhavik, thanks for response.
    as I already mentioned it implements Serializable, so it is not the problem.
    Thanks Avi but it didn't helps iether
    Victor

  • 401 Error on Consuming SharePoint Versions Web Service by java client running on Unix Machine

    In my organiszation I have sharepoint site of our project. I have a java client to consume Versions Web Service offered by SharePoint. The response received from web service without any issue when triggered from a client running on windows machine on
    intranet.
    When same java client ran from UNIX server on same intranet, it gives 401 error. Is there some different approach required for authentication while connecting from unix machine?
    Thanks in advance.

    Hello,
    Are you passing credential in code? If not then try to add using networkcredential.
    If you are passing then make sure that current user is having access on SP site and your javaserver is setup for NTLM security. Here is few links for same issue which could help you troubleshoot the issue
    http://stackoverflow.com/questions/8884152/ntlm-fails-when-consuming-sharepoint-web-service-from-java
    http://www.pentalogic.net/sharepoint-products/reminder/reminder-manual?p=troubleshooting%2F401errors%2F401errors.htm
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • SQL Reporting Services with Java EE

    I have developed a Java application for calling the SQL Reports. A couple of reports are made in the server. This SQL Reporting server is deployed and the client is made in the java using Werb services. Whenever a search is done from the Java application, reports are displayed on the JSP page using the web service methods. But the problem is the entire report is displayed. Is there any way to display the report based on the particular item search. Suppose, if search is made on "Australia" in the coulumn Country, the report should contain only Australian related data. Currently the search is based on the report name itself.

    bobz wrote:
    jschell wrote:
    bobz wrote:
    Is there any book on SQL Reporting services with Java
    [http://www.javaworld.com/javaworld/jw-01-2005/jw-0110-sqlrs.html]
    This looks hopeful.I have already developed a java EE for calling reports with the help of ---"MSDN Virtual Lab: Implementing SQL Server Reporting Services with a Java Enterprise Edition (EE) Application (ID:1032315323)". Now I need to find out the parametrized reports(passing parameters to the report calls and more customization using java). In .NET, reportviewer controller is available for this purpose. I want to achieve the same type of thing using java.The protocol of controlling the Report Server is a feature of the Report Server.
    To control it you learn the protocol. To use it you program it in java.
    The first has nothing to do with java. The second obviously does.

  • How to consume an ABAP Enterprise Service in JAVA

    Dear colleagues:
    I'm kind of confused and need your help.
    I have already created a Enterpricse Service (for test) in SE80 and configured it through SOAMANAGER.
    Question1:
    Here is the WSDL URL I got from SOAMANAGER:
    http://ldcihri.wdf.sap.corp:50000/sap/bc/srt/wsdl/flv_10002A111AD1/srvc_url/sap/bc/srt/rfc/sap/z_ws2/000/z_ws2/z_binding?sap-client=000
    And here is the WSDL URL I got from SE80:
    http://ldcihri.wdf.sap.corp:50000/sap/bc/srt/wsdl/flv_10002P111AD1/sdef_url/Z_WS2?sap-client=000:
    The XML file I got from the two URL are different, the former is bigger.
    Which URL should I use? thanks.
    Question2:
    I have tested the 2 WSDL URL through Online SOAP Client - WSDLBrowser.com
    But both URL failed the test.
    I test the same URL in SOAMANAGER-TOOLS-WSDL Analyzer.
    Both URL were OK.
    Any idea? Is it because the authorization? I need to input user name and password for WSDL Analyzer.
    Question3:
    I'd like to consume the web service in JAVA.
    Is it possible to consume the service in Eclipse IDE?
    (I have tried several times by creating Web Service Client using the WSDL but it always say that the WSDL is invalid.
    Or I have to consume the Enterprise Service in NetWeaver Develop Studio?

    In addition.
    I have already activate the web service.

Maybe you are looking for