JCO in a EJB used as Web Service

Hi All,
I'm trying to use JCO in a Web Service. What happens is that as soon as I try to call -any- JCO method I get an error: Exception in method getObjects.I can't even seem to catch this error within Java for a personalized message. I can't find an error in  "dev_jrfc.trc" either.
To use JCO I referenced sapjco.jar as an external JAR in the Libraries from the Java Build Path. 
Calling the JCO in a Web Dynpro environment doesn't give problems.
Does anyone know the reason for this and can help?
Thanks,
Jeschael
Detailed error:
HTTP/1.1 500 Internal Server Error
Connection: close
Server: SAP J2EE Engine/7.00
Content-Type: text/xml; charset=UTF-8
Date: Thu, 22 Feb 2007 10:07:33 GMT
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Exception in method getObjects.</faultstring><detail><ns1:com.sap.engine.services.ejb.exceptions.BaseEJBException xmlns:ns1='http://sap-j2ee-engine/client-runtime-error'>Exception in method getObjects.</ns1:com.sap.engine.services.ejb.exceptions.BaseEJBException></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
Message was edited just after posting by :
        J.V. Lebbink
"JCO function" changed in "JCO method"

Hi, Jeschael!
I suppose you already tried out calling R/3 FM via JCo in a simple test class, which - without any surrounding - just executes the JCo-call and outputs the returned values or any exception.
What was the result of this? The above mentioned exceptions while creating the client? For debugging the Web Service, you simply have to set a breakpoint in your EJBs method and start via NWDS a remote debugging session. As soon as the Web Service call is executed, the NWDS should open and execution should stop at breakpoint.
Another thing is: Did you already consider using Enterprise Connector for accessing R/3 functions? It' s much more comfortable enabling type-secure and stable usage of R/3 FMs.
Regards,
thomas

Similar Messages

  • EJB 3.0 Web Service

    Hi!
    I tried to create a Web Service (through wizard) from existing EJB 3.0 Session Bean. Basicly, the wizard just added @WebService annotation to my existing code...
    Now, the problem is that simple methods like:
    @WebMethod
    public String helloWorld() {
      return "Hello World!";
    }works fine. Expect that if I use Local Interface for this Session Bean, the WSDL shows two helloWorld methods (and one is with exclamation icon showing some kind of problem with multiple methods with same name - but it is not true, I have one and the other one is just interface).
    But, when I want to expose my real business service methods like:
    @WebMethod
    public List<Employee> getEmployees() {
      return (List<Employee>)q.getResultList();
    }it doesn't work (the Web Service create wizard finishes ok but service doesn't work)! When I try "Test Web Service" (from Session Bean context-menu) or "Show WSDL for Web Service annotations" the error is thrown (Null pointer exception in WSDL).
    Basically, it looks to me that Web Service cannot use EJB Entities as parameters or results. Is this correct? I saw some examples on EJB 3.0 web services and there are entities routinely used as both input and output parameters.
    Can someone, please, explain me what I'm doing wrong here.
    Thanks in advance,
    Pedja
    P.S. In Web Service wizard, only SOAP 1.1 is enabled. How can I choose SOAP 1.2? And what EJB 3.0 bindings are in same context (SOAP 1.2 or EJB 3.0 bindings?)?

    Hi Frank,
    Most of those problems are resolved (NPE was due to Timestamp field, and two methods with the same name in WSDL because of not choosing to generate SEI in wizard, so the generated WSDL had one method from the Session bean and the other from it's Local interface). But, the errors should DEFINITELY be more descriptive.
    Does the wizard work correctly? I noticed plenty of "bug like" details. For example, if I choose to create asynchronous web service, later when I go to Properties the "Asynchronous Web Service" checkbox isn't checked. Also, the @WebMethod annotations are sometimes generated and sometimes not (even if the method is checked to be exposed).
    I am also getting these exceptions when I create a proxy for the asynchronous web service (I selected "Generate asynchronous methods for all operations"), could be I'm doing something wrong:
    WARNING: The parameter/return type "java.util.concurrent.Future" in the method
    "public abstract java.util.concurrent.Future<?>
    view.proxy.MyAsyncWebService1.queryDepartmentFindAllAsync(javax.xml.ws.AsyncHandler<view.proxy.types.QueryDepartmentFindAllResponse>)"
    is not supported. This method will not be exposed.
    WARNING: The parameter/return type "java.util.concurrent.Future" in the method
    "public abstract java.util.concurrent.Future<?>
    view.proxy.MyAsyncWebService1.returnEmployeeAsync(javax.xml.ws.AsyncHandler<view.proxy.types.ReturnEmployeeResponse>)"
    is not supported. This method will not be exposed.
    Exception in thread "main" java.lang.NullPointerException
         at com.sun.xml.bind.v2.runtime.Coordinator.popCoordinator(Coordinator.java:122)
         at com.sun.xml.bind.v2.runtime.XMLSerializer.close(XMLSerializer.java:823)
         at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:310)
         at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:230)
         at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:87)
         at oracle.j2ee.ws.common.databinding.runtime.jaxb20.Jaxb20Serializer.serialize(Jaxb20Serializer.java:218)
         at oracle.j2ee.ws.common.databinding.runtime.SerializerBase.serializeSequenceWrapper(SerializerBase.java:80)
         at oracle.j2ee.ws.client.jaxws.SoapRequestorSerializer.populateSoapMessage(SoapRequestorSerializer.java:89)
         at oracle.j2ee.ws.client.jaxws.WsClientProxyInvocationHandler.invoke(WsClientProxyInvocationHandler.java:184)
         at $Proxy11.returnEmployee(Unknown Source)
         at MyAsyncWebService1SoapHttpPortClient.main(MyAsyncWebService1SoapHttpPortClient.java:22)
    Process exited with exit code 1.Can anyone throw some light on this?
    Thanks,
    Pedja

  • EJB exposed as web services

    I am very new to web services.
    I understand that a Stateless bean can be exposed using RPC style web services.
    But I want to know if a stateless session bean can be accessed by EJB client and Web service client (java or non-java) simultaneously. ?
    i.e. 1. Can same bean serve two types of client simultaneously.(java and non-java client)
    2. Does this web service accept complex java object as input parameters. and how?

    Hi Patrik,
    > Exception raised from invocation of public void com.sap.sia.serviceMonitor.ServiceMonitorBean.initPostConstruct() method on bean instance com.sap.sia.serviceMonitor.ServiceMonitorBean@5a8ab489 ... ; nested exception is: java.lang.NullPointerException
    The NPE occurs in the bean code, in the initPostConstruct() method or some other method it calls. Unfortunately, its stack trace is not available above, but you should be able to find it in the defaultTrace file.
    HTH!
    \-- Vladimir

  • Overloaded ejb methods as web service

    I implemented an ejb as a web service. The ejb has 4 overloaded methods. When I looked at the generated wsdl, only one signature was exposed as a web service. Is there a way to make all 4 overloaded methods available to the web service ?

    Hi Sandy,
    The WLS 6.1 docs clear states that method overloading is not supported with WebLogic
    Web Services:
    http://e-docs.bea.com/wls/docs61/webServices/develop.html#1034539
    However, you might be able to simulate something similar by passing a org.w3c.dom.DocumentFragment
    to the method. For example,
    public org.w3c.dom.DocumentFragment overloadedMethod(org.w3c.dom.DocumentFragment
    variableArgs)
    This allows you to use the flexibility of XML to provide various input and output
    parameters for the method. In the method's implementation, you determine which
    arguments have been passed by parsing the variableArgs node. For quasi type safety,
    you could use the xsi:type attribute to associate data types with fragment elements.
    Note that you will need to use literal XML encoding to do this.
    HTH,
    Mike Wooten
    Sandy <[email protected]> wrote:
    I implemented an ejb as a web service. The ejb has 4 overloaded methods.
    When I looked at the generated wsdl, only one signature was exposed
    as a web service. Is there a way to make all 4 overloaded methods available
    to the web service ?

  • Using 2 web services data sources in the same report

    I've been trying unsuccesffuly to use 2 web services data sources in a report. The main report accesses the first web service to get job summary information. 3 fields are are passed as parameters to a sub-report and used as parameters for the sub-report selection. Each report works fine independently, but when I link them together the subreport alway fails to retrieve data.

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • Crystal Report using a Web Service as a data source?

    I am trying to figure out how to use a Web Service as a data source in Crystal Reports. When I use the report wizard, I do not see an option to select Web Service as a new connection. We are currently using Crystal Reports 2008 v12.1.0.892. Could it be that my version does not support this? Is there an update that contains this feature? Please help.

    Thanks for your response. Unfortunately I do not see a radio button for Web Services. I've read that it should be there too. Could it be a missing plug-in or patch?
    Here are screen shots of what I see when trying to connect to an XML. Any thoughts?
    [http://s26.photobucket.com/albums/c120/hpolit/?action=view&current=wizard1.jpg]
    [http://s26.photobucket.com/albums/c120/hpolit/?action=view&current=wizard2.jpg]

  • Using a Web Service as a data provider for a Crystal Report

    <p>I&#39;m trying to write a Crystal Reports XI report that uses a Web Service as the data provider.  I have a Web Service written in ColdFusion that looks like this.<br /><br /><cfcomponent displayName="FindEmployee" ><br />   <cffunction name="FindEmployeeSort" access="remote"          <br />               returnType="xml" output="false"><br />      <cfdump var=form><br />      <cfset myXML = ""><br />       <!--- FindEmployeeSort body ---><br />       <cfquery name="EmployeeQuery" datasource="Production"><br />           Select * from employee<br />          <cfif isdefined(&#39;form.lastname&#39;)><br />             WHERE lastname LIKE &#39;%#form.lastname#%&#39; <br />          </cfif><br />           Order by lastname asc <br />        </cfquery><br />     <cfreturn EmployeeQuery>  <br />   </cffunction><br /></cfcomponent><br /><br />I can get the web service to work from a ColdFusion page (either locally or on a remote server).</p><p>When I try to create the CR data source, I get the following error:</p><p>Crystal Reports<br />! Logon Failed.<br />Details: Cannot find correspondign table information in the XML file</p><p>The steps I took were:<br />* Choose XML from the "Avalable Data Sources"<br />* Choose "Use Web Service Data Source"<br />* Choose "Use HTTP(S) WSDL" with a url of <a href="http://host/directory/FindEmployee.cfc?wsdl">http://host/directory/FindEmployee.cfc?wsdl</a><br />* Leave the "HTTP(S) Web Service User ID:" and "HTTP(S) Web Service Password:" parameters blank<br />* Accept the defaults for Services, Ports, and Methods.  They are respectively FindEmployee, FindEmployee.cfc and FindEmployeeSort.<br />* Then get the error</p><p>The most likely candidate to me is the user id and password, but I have no idea what to use.  I didn&#39;t have to set any login information up in the ColdFusion pages that I used to test the Web Service.</p><p>Any ideas where to go from here?</p><p>Thanks,</p><p>Brian</p>

    Please re-post if this is still an issue to the Java Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • How to create a crystal report using secured web service as a datasource?

    Hi All Expert,
    I having some challenges on how to create a report using secured web service as a datasource in crystal report designer (CR11 R3).
    Secured Web Service including the certificate trusting, token authentication, header and/or body encryption. All web services running on https protocal.
    Could you please suggest me on the solution?
    Thank you and Best Regards,
    Cherr

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • Invoking a web service not created using oracle web service lib

    Hi All,
    I have a need to invoke my web service from oracle sql command. My web service not created using oracle web service library, but it is created using axis c++ libraries. Is it possible to do so,
    Thanks in advance,
    Regards,
    Monica

    In order to call out from the database process, is SQL (or PL/SQL) you need to generate some client code, that understand the details about the specific of the service you want to invoke and can produce the correct SOAP request. Once this proxy is uploaded in the Database, you can use it.
    There is a set of Database Web services samples that should help you get started. You can also take a look at the developer's guide - see Developing a Web Service Client in the Database.
    Hope it answers your question.
    --eric                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Error connecting to Salesforce using a Web Service Adapter

    Hi,
    I'm working on a connection from Data Services 4.2 to Salesforce using a Web Service Adapter.
    I've setup up the adapter (including JVM parameters to use a HTTP proxy), created a Datastore based on the adapter and built a batch job that calls the login operation and initiates a sessions towards Salesforce.
    When I execute the batch job I get an error message that says:
    Error calling function <login>: <Web Services client unable to create a SOAP request to send to server. Error: The current node has been removed using a method other than Iterator#remove()>.
    The trace log for the Web Service Adapter contains the same error message and has some additional info.
    4/16/15 1:17:25 PM Thread[Thread-10,5,main] Handle request starting for operation: login
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Entering addDocumentMessage()...
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Entering addHeadersToEnvelope()...
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Web Services client unable to create a SOAP request to send to server. Error: The current node has been removed using a method other than Iterator#remove()
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Remove message listener for message type [adapter.WSAdapter.__STREAM_FUNCTION.1].
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Stopping web service function call operation
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Receive message: BrokerMessage(
    _e.ErrorsTo=com.acta.adapter..client.dataAndMetadata_8
    _e.Timestamp=Thu Apr 16 13:17:26 2015
    _e.SourceTimeoutLength=90000
    _e.MessageID=16
    _e.Destination=com.acta.adapter.webservice.adapter.WebServiceAdapter.data_2
    _e.MessageType=MSG_ADAPTER_END_OPER
    _e.ReplyTo=com.acta.adapter..client.dataAndMetadata_8
    _e.CorrelationID=15_com.acta.adapter..client.dataAndMetadata_8
    _a.MSGFIELD_ADAPTER_SESSION_ID=2
    _e.Source=com.acta.adapter..client.dataAndMetadata_8
    _a.MSGFIELD_ADAPTER_OPER_ID=1)
    I've searched for any additional tracing/logging on the server but I haven't found anything relevant. Can anyone help me determining what the cause of this error is so I can solve this?
    Thanks,
    - Ian

    Hi,
    I'm working on a connection from Data Services 4.2 to Salesforce using a Web Service Adapter.
    I've setup up the adapter (including JVM parameters to use a HTTP proxy), created a Datastore based on the adapter and built a batch job that calls the login operation and initiates a sessions towards Salesforce.
    When I execute the batch job I get an error message that says:
    Error calling function <login>: <Web Services client unable to create a SOAP request to send to server. Error: The current node has been removed using a method other than Iterator#remove()>.
    The trace log for the Web Service Adapter contains the same error message and has some additional info.
    4/16/15 1:17:25 PM Thread[Thread-10,5,main] Handle request starting for operation: login
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Entering addDocumentMessage()...
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Entering addHeadersToEnvelope()...
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Web Services client unable to create a SOAP request to send to server. Error: The current node has been removed using a method other than Iterator#remove()
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Remove message listener for message type [adapter.WSAdapter.__STREAM_FUNCTION.1].
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Stopping web service function call operation
    4/16/15 1:17:26 PM Thread[Thread-10,5,main] Receive message: BrokerMessage(
    _e.ErrorsTo=com.acta.adapter..client.dataAndMetadata_8
    _e.Timestamp=Thu Apr 16 13:17:26 2015
    _e.SourceTimeoutLength=90000
    _e.MessageID=16
    _e.Destination=com.acta.adapter.webservice.adapter.WebServiceAdapter.data_2
    _e.MessageType=MSG_ADAPTER_END_OPER
    _e.ReplyTo=com.acta.adapter..client.dataAndMetadata_8
    _e.CorrelationID=15_com.acta.adapter..client.dataAndMetadata_8
    _a.MSGFIELD_ADAPTER_SESSION_ID=2
    _e.Source=com.acta.adapter..client.dataAndMetadata_8
    _a.MSGFIELD_ADAPTER_OPER_ID=1)
    I've searched for any additional tracing/logging on the server but I haven't found anything relevant. Can anyone help me determining what the cause of this error is so I can solve this?
    Thanks,
    - Ian

  • How can i use the web services

    i have a web service ,but what is need that can i use the web services?
    is only then oc4j,or anything?

    You need to write a client that will access the Web service and invoke it.
    You can write the client in Java for example - and JDeveloper provides wizards for this.
    There is a sample in the JDeveloper Reviewer guide here:
    http://www.oracle.com/technology/products/jdev/collateral/papers/10g/reviewer/reviewerguide.html

  • Using a web service in a JSP

    Hello,
    I am having difficulty understanding how to use a web service I have written in a JSP page. The service works fine and simply adds to numbers together. How can I call it from a JSP page?
    Could someone please point me in the right direction?
    Many thanks
    H

    Hi,
    What did you use to write your web service? I have been using Axis2. Typically, you write a client to access your webservice using the same framework that you used to generate the service. I would recommend writing a standalone client. Once you have that code written, you can move into a servlet and then use a JSP as a front end.

  • Problem in using the Web Service generated from BAPI_FLIGHT_GETLIST

    Hi all,
       I am trying to use the Web Service generated from BAPI_FLIGHT_GETLIST. I have got the wsdl file, and trying to invoke it. But, while I can test the BAPI using the Airline ID AA, I can't test from the Web Service using the same data. It shows the error message - "Airline AA not found". Anyone having solution, please help. This is urgent.
    Thanks,
    Anirban
    Message was edited by:
            Anirban Das

    Yes, I am connecting to the same system where we have data..
    Anirban

  • Cannot pass data from Web Dynpro to XI using a Web Service

    Hi All,
    We have been facing some issues when we try to pass on a SOAP / XML message via a WSDL from a WebDynpro App to XI - No data is reaching XI interface. The payload data details for the inbound message in XI is empty. When testing the WSDL separately using XML spy the data passes to the XI successfully.
    The problem only occurs when we pass on the data from the WebDynpro component.
    We are also passing additional information _user and _password to ensure authenticated access.
    Steps that we completed so far:
    1. Created a WSDL which we can use to communicate to XI interface.
    2. Imported WSDL using webdynpro Web Service Model import
    functionality.
    3. Bound WSDL with webdynpro components.
    4. Pass on data through WSDL contexts.
    5. Execute WSDL model.
    Any help would be much appreciated.
    Thanks,
    RR

    Hi,
    please check document:
    Almost Everything about Transaction Launcher u2013 Part
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/3059fb20-987f-2e10-ef82-d147b9b5e8b4
    Denis

  • Issues in using Jdev web service proxy

    Guys,
    I'm using jdeveloper web service proxy to call web services.
    But when i got the response, the response objects are not getting populated for complex type. I mean if the schema refers to another element name instead of primitive type.
    Do anyone faced this issue earlier? How can we resolve this issue?
    <element name="QuoteListCollectionResponse">
    <complexType>
    <sequence>
    <element name="PriceLocation">
    <complexType>
    <sequence>
    <element name="locationId" type="decimal"/>
    <element name="status" type="decimal"/>
    <element name="FboCollection" type="tns:fbo" minOccurs="0" maxOccurs="unbounded"/> *// response object is not getting populated here*
    </sequence>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    <complexType name="fbo">
    <sequence>
    <element name="locationId" type="decimal"/>
    <element name="fbo" type="string"/>
    <element name="fboId" type="decimal"/>
    <element name="supplier" type="string"/>
    <element name="supplierId" type="decimal"/>
    <element name="deliveryMethod" type="string"/>
    <element name="priceExpirationDate" type="dateTime"/>
    <element name="domesticOrIntlIndicator" type="string"/>
    <element name="inputQty" type="decimal"/>
    <element name="totalFBOPrice" type="decimal"/>
    <element name="fuelStructureCollection" type="tns:fuelStructure" maxOccurs="20"/>
    </sequence>
    </complexType>
    <complexType name="fuelStructure">
    <sequence>
    <element name="fuel" type="string"/>
    <element name="fromQty" type="decimal"/>
    <element name="toQty" type="decimal"/>
    <element name="totalUSPrice" type="decimal"/>
    </sequence>
    </complexType>
    Edited by: Dev on Apr 14, 2011 2:37 PM

    bumping again...

Maybe you are looking for

  • Can't install ITunes on Windows 2003 server (WHS box)

    Hi, I can't install the latest ITunes because it incorrectly mistakes my Windows 2003 server as Windows XP. So after search I find that I can change the MSI files as according to this thread: http://discussions.apple.com/thread.jspa?threadID=2154140.

  • Field Mobile phone (ADR2-R3_USER) vendor master changed from Blank to 1

    Hi Where I can find Mobile phone (ADR2-R3_USER) in Vendor master. We have updated Purchasing block to vendor master via LSMW and after that if i am going to see the changes in vendor master (XK03) Found that the field Mobile phone (ADR2-R3_USER) chan

  • Problem with httpservice.length

    Hi, I have written a httpservice which will return a dataset to me, now i am trying to loop that http service i have written the below code <mx:httpservice id="something" url="........default.aspx" /> var i:int = 0 for (i = 0; i<something.lastresult.

  • Simple question: code break down

    Hi guys, Just one question about the following piece of code: public class Counter2 implements Runnable { protected int count; protected int inc; protected int delay; public Counter2(int init, int inc, int delay) { this.count = init; this.inc = inc;

  • Lion gave me a first Kernel panic in years

    Hello, I hadn't seen a kernel panic in many years I got one this morning on Lion What happened, is that my mouse batteries (logitech V470) were going down so I changed them as I did so many times Whwn the mouse restarted, with a blue signal looking f