Consume Web Service in EJB Application

Hi Experts,
I have EJB Application with some Java Classes.My Requirement is to Consume Web Service in EJB Application.
I am new to EJB Application.Please share if have any ideas regarding the same.
Thanks & Regards,
SatheshKumar R

Hi Vijay,
Thanks for the Reply.
Please provide the JAR Files i need to add.
I had tried to consume the web service by using the java class in Java Project ie EJB.
After creating the Project i will import the WSDL file in that Project and create the Client Application.
The Request and Response java class is created by importing the WSDL file.
The Client Java Class is created to access the Request and Response objects.
After this Main class is created and I have run the application to execute the Client Java Class. During this time its shows some error.
The Error Message are:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sap/engine/interfaces/sca/logtrace/CallEntry$TraceLevel
at com.sap.engine.services.webservices.espbase.client.bindings.ConfigurationUtil.getTransportBinding(ConfigurationUtil.java:249)
at com.sap.engine.services.webservices.espbase.client.bindings.ConfigurationUtil.createClientConfiguration(ConfigurationUtil.java:109)
at com.sap.engine.services.webservices.espbase.client.jaxws.metadata.InterfaceMetadata.createClientConfigurationContext(InterfaceMetadata.java:178)
at com.sap.engine.services.webservices.espbase.client.jaxws.metadata.InterfaceMetadata.getProxy(InterfaceMetadata.java:70)
at com.sap.engine.services.webservices.espbase.client.jaxws.core.SAPServiceDelegate.getPort(SAPServiceDelegate.java:258)
at javax.xml.ws.Service.getPort(Service.java:92)
at com.sap.tutorial.testwebser1ejb.TestAddService.getTestAddPort(TestAddService.java:38)
at com.sap.tutorial.testwebser1ejb.TestAddClient.testAdd(TestAddClient.java:12)
at com.sap.tutorial.testwebser1ejb.MainClass.main(MainClass.java:12)
Caused by: java.lang.ClassNotFoundException: com.sap.engine.interfaces.sca.logtrace.CallEntry$TraceLevel
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... 9 more
Thanks & Regards,
SatheshKumar R

Similar Messages

  • Consuming Web service : Sample ABAP application

    Hi Friends,
    I am trying to consume existing web service. I have few questions.
    --> Why do we need to create simple ABAP application while consuming Enterprise Service?
    --> How this ABAP application will be triggered? Will it be triggered automatically or this is just for      testing purpose?
    --> After consuming Enterprise Service , which URL my end user can use to execute the functionality ( i.e to craete PO )
    Waiting for your expert responses.
    Thanks,
    Rashmi Jain

    Hello,
    Please see the responses below:
    -->Why do we need to create simple ABAP application while consuming Enterprise Service?
    When you created consumer proxy, you have a proxy class autogenerated. The ABAP program is to provide input data and instantiate and call the method within the proxy class.
    --> How this ABAP application will be triggered? Will it be triggered automatically or this is just for testing purpose?
    The program can be triggered using a Transaction or can be scheduled through batch or event based.
    --> After consuming Enterprise Service , which URL my end user can use to execute the functionality ( i.e to craete PO )
    The end user does not have to know the URL. This is built into WSDL from which you created consumer proxy.
    Thanks,
    Venu

  • How to consume Web Service in ABAP WebDynpro

    Hi
    I want to know the entire details about how to consume Web Service in WebDynpro application.
    regards
    Piyush

    hI piyush,
    Have a look at this Blog by Thomas Jung.
    /people/thomas.jung/blog/2007/12/17/consuming-services-with-abap
    on consuming webservies thru webdynpro ABAP
    Cheers
    Mary

  • Adaptative web service or EJB ?

    Hi everybody,
    I want consume a web service from  a system SAP R/3.
    Apparently, we can consume with component EJB ...
    What is the difference between a adaptative web service and EJB ?
    More security with EJB ?
    Thanks
    Rodolphe.

    Hi,
    We use for ejbs when we have to store data in database..
    if ejbs r like a medium for data transfer..where session bean contain ur business logic..
    u cn use webdynpro interface as well as jsp interface wid ejb..
    if u r using ejb u'll have to create an ejb projct first then u'll hav to create java proct which will contain ur wrapper class for fields.later on u'll have to create one application project tht wud b an Ear projct.nw u create a web service for session bean ..aftr doin this all u can test webservice which will b executed for ur business method.
    for more security u can use ejb security model :[http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Security.html]
    Web services r created for session bean..so that u cn directly access ur methods via url..
    for a detailed description of web service go through :- [http://help.sap.com/saphelp_nw04/helpdata/en/d6/f9bc3d52f39d33e10000000a11405a/content.htm]
    for ejb project go through this1 :[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ca4a9c90-0201-0010-c389-8738cd51a88e]
    Regards,
    Khushboo

  • Web service from ejb

    Hi All,
    I am new to java web services.
    I made web services from ejb with netbeans.
    I like only some people to have access to this services with user and pass stored in database.
    In other words I need authentication and authorization.
    How can I do this?
    Regards

    Well it depends also on application server you are using.
    It depends also on web service stack you are using.
    For example here is the hint for glassfish (Metro):
    http://java.sun.com/javaee/5/docs/tutorial/doc/bncbe.html#bncbn
    Miro.

  • Consuming web service in portal

    Hi all,
    I had a web service now i want to use it in my portal.
    Can anyone help me in this regard.

    Hi Lokesh,
    To consume a Web service, you can create a deployable or a standalone proxy for the Web service in the SAP NetWeaver Developer Studio using a WSDL document as a basis. This can be done with just a few mouse clicks.
    The difference between a deployable and a standalone proxy is that, for a deployable proxy, the application of the Web service client must be deployed on the J2EE engine. A standalone proxy can be executed without the J2EE engine.
    The role of the Web service client developer has been created so that Web services can be consumed.
    The Web service client developer has the task of integrating a Web service in an application. He or she knows the specific requirements for the Web service and creates the Web service client proxy definition. Afterwards, the developer programs the client application using the service endpoint interface.
    Please read through this Step by Step approach for same:-
    [Consume WebServices in Portal|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c2188ae5-0601-0010-dd93-c23e381ef41e]
    Hope this helps,
    Regards,
    Shailesh

  • Best practice for consuming web services

    Hi
    we are consuming web service in orchestration by "Add Generated Item".By using this option it creates 1 orch,1xsd file and some bindings.
    we have different projects for schemas,maps and orchestration under our solution in visual studio.
    Now i need to know that what will be the best practice for consuming web service in orchestration i mean in which project should i use "add generated item" (in orchstration project or in schemas project) coz it generates both 1 orch and 1
    schema.
    thanks

    From a service orientation perspective you should abstract the service artifacts from the other artifacts. Otherwise it will be very difficult to update the service interface without affecting the other artifacts. For example you don't want to have to redeply
    your entire application if only one field changes in the service you consume.
    So I typically generate the items, remove the unnecessary stuff, and put them in a separate project.
    Depending on the control you have over the services you want to consume, it would even be better to create another layer of abstraction. By that I mean create your own interface (schema) and map that one to the one the service exposes. This basically
    is only necessary if you consume external services that are beyond your control. By abstracting the interface it exposes, you limit the impact of changes of that interface on the rest of your system. All changes are abstracted behind your own interface.
    If you consume internal services, you can probably control the way the interface is defined. In a service oriented world all internal services expose a well known interface, based on the domain objects you have within your organisation.
    Jean-Paul Smit | Didago IT Consultancy
    Blog |
    Twitter | LinkedIn
    MCTS BizTalk 2006/2010 + Certified SOA Architect
    Please indicate "Mark as Answer" if this post has answered the question.

  • Windows authentification while consuming web service from ABAP

    Hi All,
    We are consuming web service from ABAP, we have created client proxy in SE80 and configured logical port in LPCONFIG.
    This one was working fine. Now we have added  windows user authentification to access this service.
    Now when I'm trying to regenerate this proxy in R/3 it is asking for user and password. When I enter these details this one is not working.
    If I access this service direcly from internet explorer and I enter same user and password then I would able to access this service.
    Could you please let me know how to handle this.
    Regards
    Vikram

    The dialog that is produced by HTTP Destination object of the logical port is designed only for use within Classic Dynpro applications.  There is no prompt produced when running in Web Dynpro.  If possible assign a generic user within the logical port definition and this will be used automatically by all users.

  • Problem when consuming web service on WIndows authentication applcation

    Hi,
    I am having a tough time in consuming web services on a
    Windows authentication IIS server.
    In one of my application I have created web services and
    consuming those web services from my another application.
    If I turned off the Windows authentication everything works
    fine, but If I turned on the Windows authentication web services
    stop working.
    Has anyone encountered such error while working with web
    services on Windows authentication server.
    Attach Code
    Could not perform web service invocation "funGetCustomer".
    Here is the fault returned when invoking the web service
    operation:
    AxisFault
    faultCode: {
    http://xml.apache.org/axis/}HTTP
    faultSubcode:
    faultString: (401)Unauthorized
    faultActor:
    faultNode:
    faultDetail:
    {}:return code: 401
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
    http://www.w3.org/TR/html4/strict.dtd">
    <HTML><HEAD><TITLE>You are not authorized
    to view this page</TITLE>
    <META HTTP-EQUIV="Content-Type" Content="text/html;
    charset=Windows-1252">
    <STYLE type="text/css">
    BODY { font: 8pt/12pt verdana }
    H1 { font: 13pt/15pt verdana }
    H2 { font: 8pt/12pt verdana }
    A:link { color: red }
    A:visited { color: maroon }
    </STYLE>
    </HEAD><BODY><TABLE width=500 border=0
    cellspacing=10><TR><TD>
    <h1>You are not authorized to view this page</h1>
    You do not have permission to view this directory or page
    using the credentials that you supplied because your Web browser is
    sending a WWW-Authenticate header fi...

    You could try switching the HTTP transport provided in the
    Apache Axis embedded in ColdFusion to "CommonsHTTPSender".
    See this blog post:
    http://tjordahl.blogspot.com/2007/03/apache-axis-and-commons-httpclient.html

  • How to consume web service in Agentry in SMP 3.0

    Dear All , I am using web service in Agentry to retrive data but could not able to fetch it . I have made connection with HTTP-XML for consuming webservices. and also give proper information in Agentry.ini files Ex : [HTTPXML-2] name=HTTP-XML Back End authenticationCertificateStore=MY authenticationCertificateStorePassword= authenticationCertificateStorePasswordEncoded=false autoDequote=true ;baseURL=http://localhost:81 baseURL=http://sapes1.sapdevcenter.com:8080/sap/opu/odata/iwbep/gwdemo/ basicAuthenticationPassword=123456 basicAuthenticationPasswordEncoded=false basicAuthenticationUserID=P1466405733 constantsFile=httpxml_sd.ini enableAuthentication=false enablePreviousUserAuthentication=false httpConnectTimeout=300 httpReceiveTimeout=300 httpResolveTimeout=300 httpSendTimeout=300 listenOn= timeout=300 timeZoneName= useSSL=false xmlAllowXSLTScript=true xmlNamespaces= xmlResolveExternals=true xmlValidateOnParse=true for more information i have attached agentry XML screen shot as well . Can you please guide me how to consume web services in Agentry correct way ? Note : Currently i am using standard netweaver demo web services . Thanks & Regards ,   Kunal Varaiya
    Tags edited by: Michael Appleby

    The XML Steps URL will be added to the Agentry.ini BaseURL.  So you dont' need the full URL on the step.
    So when Agentry Runs the step to call the backend it will go:
    <BaseURL>/<Step's URL>
    This way if you need to change the base URL, IE, going from Dev to QA to Production Server you only need to change the Base, and not go into every step and update it.
    URL: This attribute contains the URL to which the Agentry Server will make a request. This value will be appended to the value configured as the base URL for the HTTP-XML system connection. This base URL is configured within the HTTP-XML system connection configuration options for the Agentry Server. Proper use of both this base URL option and the URL entered in the requests of the step definitions can support portability for the application, with the base URL being the implementation-specific portion and the step’s URL being the portion not likely to change for the same back end system from one implementation to the next.
    http://help.sap.com/saphelp_smp303sdk/helpdata/en/7c/143d5d70061014b323be16eb0b0a77/frameset.htm 
    Stephen

  • Can i use flex to consume web services?

    I am not a Flex developer and before delving into it I want
    to be sure that it satisfies my project requirements. Mainly,
    consuming web services. the other part of the project are a bunch
    of buttons and graphs that constitute any GUI. so I think Flex can
    handle this part as good as Flash.
    Currently, I am using flash but my current client insists on
    using flex. so my question is: can I develop in Flex whatever I can
    develop in flash? or are there limitations?

    If you are developing applications in Flash, then you will
    love Flex. Flex will make you much more productive than Flash for
    producing applications of any complexity. You can do at least
    "most" of what you can do in Flash, and more. There might be a few
    things you can do only in Flash, or more easily in Flex, but your
    client has it right. They want Flex and they should want it. Check
    out the FB3 help for the WebService, RemoteObject, and HTTPService
    components.

  • How to publish and consume web services in WAS 620?

    It appears that Web Service Creation Wizard is only available in WAS 640. We only have WAS 620 installed. Do any of you know what are the steps to publish ABAP function modules as web services, as well as to consume web services?
    Thanks,
    Angela

    Hi Angela,
       If you want to expose function modules as web service, you can generate WSDL by running BSP application 'webservicebrowser'. If you want to consume a web service then it is a bit difficult but possible. Look at sample programs (rsvsoap*).
    Also look at help document http://help.sap.com/saphelp_47x200/helpdata/en/94/f8c8a2e68811d6b2dc00508b5d5211/frameset.htm
    Regards,
    Sanjeev

  • Complete newbie question - Can BI consume web services?

    Post Author: Steve Lamont
    CA Forum: Data Integration
    I am working on a new client site working on integration between a whole slew of systems including CRM, billing, BI etc.  The client is architecting a SOA oriented approach to all integration where it make sense.  As part of the effort, a new BI database is being built and loaded via some ETL tool.  The primary interface to access this new BI data will be business objects (BO).  Now, in the current environments, there are multiple, disparate BI systems containing various data.  The BO knowledge person (and he is not a business object employee) on this site is claiming that to access these other BI databases, he wants to do it by sending out requests via service calls.  I fully understand that BO itself can be set up to be a service provider and provide services for other consumers to take advantage of, but how does BO itself consume services provided by other applications?
    Obviously I don't fully understand BO, but my initial inclination is that this approach is wrong.  If data is required from these other BI source, wouldn't they be configured as data sources within business objects?  This BO guy claims that calling web services is more efficient that direct peer-to-peer calls via the database drivers.
    Can any share some comments on this situation?

    Post Author: bhofmans
    CA Forum: Data Integration
    You posted your question to the wrong forum, please try to post it to one of the subforums in "Enterprise Reporting, Query & Analysis".
    This forum is about Data Integrator, Business Objects ETL tool.
    I'll try to answer your question anyway with my reporting background From what I know, YES we can consume web services in reports (Crystal reports), but for larger volumes of data a direct access to the database would be faster. A webservice approach might make sense if the webservice implements some business logic (semantic layer) which would be easier then to go directly to the tables.
    And just for the record : also Data Integrator can consumer web services...

  • Unable to consume web service. LPX-00104: Warning: element "html"

    Dear All,
    I am new to this posting stuff. Right away i desperate need help from you guys. I am using pl/sql to consume web service initially it was working fine but not it's throwing the exception i.e.
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00104: Warning: element "html" is not declared in the DTD
    Error at line 2
    Please assist.
    Regards,
    Muhammad Naseer.
    Edited by: m_naseer on Jan 21, 2011 2:47 AM

    thanks for reply,
    following is the version
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    "CORE     10.2.0.4.0     Production"
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    XML Error is
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>Error Report</title>
    <style>
    td {font-family : Arial, Tahoma, Helvetica, sans-serif; font-size : 14px;}
    A:link {color : #0059AA;}
    A:visited {color : #999999;}
    A:active {color : #999999;}
    </style>
    </head>
    <body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" rightmargin="0">
    <table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" height="75">
    <tr bgcolor="#FFFFFF">
    <td align="left" colspan="2" height="48"><font face="Arial, Verdana, Helvetica" size="4" color="#666666"><b>  404 &nbsp Not Found</b></font></td>
    </tr>
    <tr bgcolor="#3F73A3">
    <td height="23" width="84"><img width=1 height=1 border=0 alt=""></td>
    <td height="23"><img width=1 height=1 border=0 alt=""></td>
    <td align="right" height="23"><font face="Arial, Verdana, Helvetica" size="2" color="#FFFFFF"><b>SAP J2EE Engine/7.00 </b></font></td>
    </tr>
    <tr bgcolor="#9DCDFD">
    <td height="4" colspan="3"><img width=1 height=1 border=0 alt=""></td>
    </tr>
    </table>
    <br><br><br><br><br><br>
    <table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" height="75">
    <tr bgcolor="#FFFFFF">
    <td align="left" colspan="2" height="48"><font face="Arial, Verdana, Helvetica" size="3" color="#000000"><b>  The requested resource does not exist.</b></font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td align="left" valign="top" height="48"><font face="Arial, Verdana, Helvetica" size="2" color="#000000"><b>  Details:</b></font></td>
    <td align="left" valign="top" height="48"><font face="Arial, Verdana, Helvetica" size="3" color="#000000"><pre>  Go to main page of this application!</pre></font></td>
    </tr>
    </body>
    </html>
    -31011
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00104: Warning: element "html" is not declared in the DTD
    Error at line 2
    Code is perfect is at was working but some thing may be bad has just happen that it is not working now.
    Thanks in advance

  • How to deploy a web service on Oracle Application Server 10.1.2.0.2?

    Hi everyone,
    I followed the instructions of the following link to create a web service using jDeveloper 10.1.3.1.0 on Oracle Application Server 10.1.2.0.2. [http://st-curriculum.oracle.com/obe/jdev/obe1013jdev/10131/devdepandmanagingws/devdepandmanagingws.htm#t1]
    The web service created was deployed & used with no errors on the standalone OC4J instance.
    But my goal is to deploy my web service on Oracle Application Server 10.1.2.0.2.
    So after several attempts, I was able to deploy it on the Oracle Application Server 10.1.2.0.2 but unfortunately I didn't know the URL needed to use the web service.
    I tried the following link (http://192.168.0.91:18100/JavaWebService-GetDates-context-root/GetDatesWSSoapHttpPort) but also didn't work :(
    I also tried converting to J2EE 1.3 and still not knowing how to access the web service.
    Please advice with a solution.
    Thanks in advance.
    Lana

    Thanks everyone for your help :)
    The problem turned out to be that Oracle application server 10.1.2 is unlike the others servers, it uses 2 ports:
    - port (19100) is dedicated for the console.
    - port (7779) is to view your applications.
    So the URL needed turned out to be "http://acteos-109.beirut.acteos:7779/beanTest" instead of "http://acteos-109.beirut.acteos:18100/beanTest"
    Hope this info is useful
    Lana

Maybe you are looking for

  • Cannot get into 'Dashboard Properties' (OBIEE 11g) using IE 8

    When I enter an OBIEE 11g dashboard (as an Administrator) and click on "*Edit Dashboard*" & then click on "*Dashboard Properties*": 1) the "*Dashboard Properties*" box pops up but... 2) only the upper porting of the "*Dashboard Properties*" box displ

  • Using an XML file as a data source for XI in NW CE 7.1 DS

    I am trying to set up a simple demonstration of XI capabilities by grabbing an XML file from one location and putting the data into WEI in and ISA 95 format.  I have set up my XML file (and schema) as an XML Data Source under ODA Data Sources.  Howev

  • IPhone 4s charge issues

    Hello, my iPhone 4s goes to Apple logo when I plug it in to charge, but it doesn't charge. What should I do? Replace the charger, and the battery?

  • What is meant by Account Assignment Feature.

    Hi Pls tell me about account assignment feature.

  • FYI - FeedBack Sent to Apple

    Just thought I would let the group know I just sent a Feedback message to Apple. I indicated I would do this earlier this week and here is my follow up to that promise. FEEDBACK Sent Today: First let me say, I Love the Touch and I am proud to own ano