Creating a WEB Service for SAP enterprise connector

Hi,
I am using the SAP enterprise connector plugin for Netweaver 04.
It generated me all the classes that I need for the BAPI.
It also generated me a Proxy class.
I want to create a service.
This is what I've done :
1) create a portal service.
2) create a methode in the service :
public Bapi_Companycode_Getdetail_Output execute_BAPI_COMPANYCODE_GETDETAIL(
Bapi_Companycode_Getdetail_Input arg1)
try {
return new MyProxy_PortType().bapi_Companycode_Getdetail (arg1);
} catch (Exception e) {
return null;
3) after I created a web service from the portal service.
Is it the right way ?
Thanks a lot.

Hi Marcin and everyone,
Thanks for the precious explanations.
I created a client and I have an exception.
1) I made a portal service from wsdl - client side.
2) I created a DynPage.
3) Here is the code :
IMyBAPI4Service client = (IMyBAPI4Service) PortalRuntime.getRuntimeResources().getService(
IMyBAPI4Service.KEY);
IMyBAPI4Service securedClient = (IMyBAPI4Service) client.getSecurisedServiceConnection(                 request.getUser());
//this is null.
if (securedClient.getURLEndPoint().getURL() == null) {      
securedClient.setURLEndPoint(new URLEndpoint("http://<server>:<port>/irj/servlet/prt/soap/com.sap.portal.prt.soap.MyBAPI4Service?style=doc_lit"));
Bapi_Companycode_Getdetail_Input importParams =     new Bapi_Companycode_Getdetail_Input();
importParams.setCompanycodeid("0500");
Bapi_Companycode_Getdetail_Output exportParams = null;
securedClient.execute_BAPI_COMPANYCODE_GETDETAIL(importParams);                         
Do I have to use a secured client ? What is it ?
The exception is :
Problem at execution: SOAP Fault Error (java.lang.NoClassDefFoundError) : java.lang.NoClassDefFoundError
Thanks Marcin....
Message was edited by: David Fryda

Similar Messages

  • In order to create a web service on SAP R/3 what are the prerequisites.

    Hi All
    I want to create a web service(for a bapi) on SAP R/3  which will be used by a third party application. I dont know anything about creating a web service. My question is <b>in order to create a web service do we need to run Sap R/3 on netweaver ?</b>. I cannot see create web service on my BAPI screen.
    Thanks

    Hi Dohr
    We are running 4.7 on WAS 6.20 .I heard ,if we have to activate webservices on WAS 6.20  it will expose all the RFCs and BAPIs as web services. Could you explain me what is the main difference between WAS6.20 and WAS6.40 in terms of creating web services and how do i activate web services.
    Thank you very much

  • XI for create web servicies for SAP R/3 4.6C

    Hi All,
    we are implementing PM (Plant Management) module of SAP R/3 4.6C and we have the necessity to create web services for some PM functionalities. Infact we need to integrate our SAP R/3 4.6C with other applications (non-SAP) through TIBCO (it's mandatory). So we think to use SAP XI. Moreover our users don't want to use SAP GUI for the accessing to the PM functionalities but they want an UI more friendly. So we think to use SAP EP.
    Which is your opinion about this architectural scenario? Is it possible to fulfil the requirement of our business users with a more simple architectural solution (for example with WEB DYNPRO)?
    Many thanks in advance for your collaboration.
    Regards,
    Bob

    Infact we need to integrate our SAP R/3 4.6C with other applications (non-SAP) through TIBCO (it's mandatory). So we think to use SAP XI.
    TIBCO is another middleware. So once you expose your R/3 functionalities as web service, you may directly use TIBCO to integrate and XI won't be required at all.
    Moreover our users don't want to use SAP GUI for the accessing to the PM functionalities but they want an UI more friendly.
    WebDynpro application would provide you an easy GUI and could act as Soap client as well to send data.
    Regards,
    Prateek

  • Creating a web service for F4 help

    Hi All,
    I want to create a web service that I can consume using JavaScript and thus can integrate with normal HTML web site. I want to achieve this by two ways
    Pass table name and field name to the service and it will return the default search help
    In some cases search helps are collective search helps and they have search criteria to filter data
    How can I tackle with the 2nd point. First one looks straight. Pass table-field and the system will pick default DDIC search help and return values in table. However in case of collective help, I need to cater for the search parameters and I am not aware of any FM that will allow me to do  it.
    Any help appreciated .
    Regards
    Abhi

    Hi Marcin and everyone,
    Thanks for the precious explanations.
    I created a client and I have an exception.
    1) I made a portal service from wsdl - client side.
    2) I created a DynPage.
    3) Here is the code :
    IMyBAPI4Service client = (IMyBAPI4Service) PortalRuntime.getRuntimeResources().getService(
    IMyBAPI4Service.KEY);
    IMyBAPI4Service securedClient = (IMyBAPI4Service) client.getSecurisedServiceConnection(                 request.getUser());
    //this is null.
    if (securedClient.getURLEndPoint().getURL() == null) {      
    securedClient.setURLEndPoint(new URLEndpoint("http://<server>:<port>/irj/servlet/prt/soap/com.sap.portal.prt.soap.MyBAPI4Service?style=doc_lit"));
    Bapi_Companycode_Getdetail_Input importParams =     new Bapi_Companycode_Getdetail_Input();
    importParams.setCompanycodeid("0500");
    Bapi_Companycode_Getdetail_Output exportParams = null;
    securedClient.execute_BAPI_COMPANYCODE_GETDETAIL(importParams);                         
    Do I have to use a secured client ? What is it ?
    The exception is :
    Problem at execution: SOAP Fault Error (java.lang.NoClassDefFoundError) : java.lang.NoClassDefFoundError
    Thanks Marcin....
    Message was edited by: David Fryda

  • Create a Web Service for Exchange with form based authentication ?

    I want to create a Web Service in Apex that can create appointments in my exchange calendar. Exchange is offering web services for that.
    When i try to create the web service reference in Apex i provide the URL and my Exchange login, but it is failing.
    The exchange guys told me, that there is a ISA Server running where i need to authenticate through a form.
    Does anyone know, how i can implement a webservice in Apex, when the access to the wsdl url needs login through a form ?
    Or : what other types of authentication does Apex know ? What possibilities do i have ?
    Thanks for answers.
    Bernd

    Hi
    Presume you've already found this information, but in case not ....
    Exchange 2007 provides out of the box web services, see
    http://msdn.microsoft.com/en-us/library/bb408417.aspx
    As a disclaimer - neither myself of the team I work with have tried to use these web services within APEX.
    Regards
    Chris

  • Creating RESTful Web Service for BLOB retrieval

    Hi,
    Just got RESTful web services working in Apex 4.2.1 with new Listener 2.1.
    I have now been asked to create a RESTful web service by which photos in BLOB column can be retrieved upon providing the ID for that photo. Can this be done using the Creating RESTful Service Module of Apex 4.2.1? Looking at the Apex 4.2 documentation, I would assume this can be done, but has anyone used this with BLOB data?
    Thanks,
    Pat

    Hi Pat,
    Yes this can be done using RESTful Services - you just need to ensure the query used is in the required format. To obtain a BLOB for a given ID, you would need create a Resource template and handler with the following settings:
    Resource Template Settings:
    URI template: emppic/{id}
    Resource Handler Settings:
    Source query: select mimetype, product_image from demo_product_info where product_id = :id..where the format of the SQL query is SELECT 'content_type', blob_column FROM . . ., as mentioned in Rick Greenwald's Cloud White paper "RESTful Web Services for the Oracle Database Cloud", under the "SQL Source Type" section (see www.oracle.com/technetwork/database/database-cloud/public/restful-wp-1844130.pdf ):
    where 'content_type' is a string passed to the browser to be used to identify the incoming data, and the column to identify the source of the data being sent back. This data is sent back untouched by the Oracle Database Cloud Service. The Media Resource Source Type is typically used for media objects, such as images, where the data will be directly handled by the recipient making the call.The MIMETYPE column in the sample query above holds the necessary setting for the 'content_type' i.e. 'image/jpeg'. The value of ID is then passed in as a parameter when calling the service e.g. emppic/1234. The item level help text would be more helpful if it included additional information, and this is something we intend on addressing in a future release.
    I hope this example helps.
    Regards,
    Hilary

  • Really impossible to create a web service for JBoss using eclipse's WTP?

    I'm starting to get nuts!!!
    I'm an experienced J2SE and J2ME Java developer... but I have huge problems creating a web service using eclipse WTP!
    The tutorials I found are for tomcat... But I want to code for JBoss and not for tomcat...!!!
    There must be somebody out there with the same issues...
    This tutorial works fine for Tomcat...
    http://www.eclipse.org/webtools/community/tutorials/BottomUpWebService/BottomUpWebService.html
    But if I do the same with JBoss... it's not possible to incoke my web service method... ok, I thought... just need to check google... BUT I didn't find any solution in the whole WWW. Found a lot of questions of people with the same problems... but no solution! :(
    Still getting that:
    ERROR [EngineConfigurationFactoryServlet] Unable to find config file. Creating new servlet engine config file: /WEB-INF/server-config.wsdd
    I know a little bit what a wsdd does... but isn't it the job of the WTP to create that file???
    I really hope you have some places for me to start, 'cause I don't know anymore places to ask for...
    Maybe this is a JBoss issue... I don't know...
    Or is there a tutorial on how to create a web Service using JBoss IDE?
    Sascha

    Hi Massimo,
    Quiet a few points here.
    1. Oracle Type objects do not map to XML Complex type
    2. Oracle Type objects do not map to Apex Page Item Types
    3. Apex Page Item types are substituted into the WS Request XML by a process which is part of the Web Service Reference creation through the Wizard in Apex.
    >
    After created the web service (without any errors), I click on test.
    - I can select the Operation --> CREATE_LINGUA
    - I can input data for Basic Authentication
    - I can't view Input Parameters --> Report returned no rows.
    I've tried with normal type like Varchar2 and all was ok.
    Is possible in Apex to use web services based on complex type, tipically an Array?
    >
    As you have guessed the Wizard driven Web Service Reference definition process cannot handle complex types of input parameters required by a Request. By definition the number of complex types possible are infinite, so they are not likely to come built in.
    Passing an array is no solution because finally the values passed have to be plugged into the right SimpleTypes inside a ComplexType in the Request.
    Based on your WSDL your Request will be
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cre="http://xmlns.oracle.com/orawsv/GRIMALDI/PKG_WEBSERVICES/CREATE_LINGUA">
       <soapenv:Header/>
       <soapenv:Body>
          <cre:SNUMBER-CREATE_LINGUAInput>
             <cre:PLINGUA-LINGUAT-CIN>
                <cre:LINGUAT>
                   <cre:CODICE>?</cre:CODICE>
                   <cre:DESCRIZIONE>?</cre:DESCRIZIONE>
                </cre:LINGUAT>
             </cre:PLINGUA-LINGUAT-CIN>
          </cre:SNUMBER-CREATE_LINGUAInput>
       </soapenv:Body>
    </soapenv:Envelope>However, all is not lost. You can always use the UTL_HTTP package API to construct your Request.
    Regards,

  • Web service for SAP R/3 user authentication

    Hi Experts,
       We are searching for any standard web service/ Bapi to authenicate an SAP user from an external system which needs WSDL to check this . External system will be providing the SAP user ID and password and expects an acknowledgemnt that whether the user is authenticated or not .
    Is there any webservice/Bapi available for this purpose? if not how we can achieve this?
    Thanks in advance
    Sanu

    Hi,
    I don't think there is any web service to just check authentication but the work around is simple :
    Call any web service which just display some information (for example call STFC_CONNECTION function module as a web service).
    As you need to authenticate to call the web service, send the user/password.
    If you get the release information, the user/password is OK.
    If you get HTTP 401 error, the user/password is KO.
    Of course the user needs the authorisation to execute the STFC_CONNECTION function module.
    Regards,
    Olivier

  • About web service for SAP BW

    SAP可以发布web service,并通过该WS访问R3中的一张表,是否有可能用web service发布一个SAP BW中的一个Cube或Query?谢谢

    就我所知,你可以用web service
    1. upload data 到 BW
    http://help.sap.com/saphelp_nw04/helpdata/en/71/421640033ae569e10000000a155106/frameset.htm
    2. 通过HTTP services可以
    ·        Display of metadata for BW objects (see Calling the Metadata Repository as an HTTP-Service)
    ·        Exchanging metadata between various systems (see Exchange of Metadata in XMI Format)
    ·        Display of user-defined online documentation for metadata objects (see Structure linkDocument as Online Documentation)
    The following services are implemented as Web services:
    ·        Open Analysis Interfaces (see Structure linkXML for Analysis)
    ·        Structure linkWeb Service for Access to Query Data
    3. 通过Web Service可以access Query Data
    http://help.sap.com/saphelp_nw04/helpdata/en/d8/3bfc3f8fc2c542e10000000a1550b0/frameset.htm
    最后是不是可以通过Web Service发布一个SAP BW中的一个Cube,这个我没有遇到过,也没找到相关文档,估计直接得话多半是不可以。但间接的比如通过open hub Service,或是XI应该也是可以的。
    希望能有帮助。

  • To create a Web Service for EJB

    Hello,
    I created one WS for my EJB which has one method it returns array type of java bean. The bean has 8 properties, but the WS has been showing only one property when i test the WS.
    But it is displaying all properties when i use servlet.
    I would appreciate ur suggestion.
    Regards,
    Krishna.

    Hi,
    Check out whether u have followed all this steps:
    1)Create an Ejb module project and then inside this project include a Enterprise bean project.
    2) Create a getter and setter methods in the bean.java and call those methods in the local.java and the main java file.
    3) Then rebuild the application create an archive for it.open a new ear project in the j2ee pers.
    4) Next step is to create a virtual interface and a webservice in ejbjar.xml.After completing all rebuild and deploy the newly created EAR file.Now this webservice will be added to the server.
    5) GO to the WD appln, in the model create a model and then give the necessary proxy settings.If the file is in the local server then no need for giving UDDi or URL u can directly take it from the server or url itself.
    6) After giving the connections open the data modeller to map all the model nodes from the new model that we created latest.Then in the implementation u can direcly call the webservice request that u want.This req instance should be created in the comp ctller and then binded to the node.
    Hope it helps,
    Regards,
    Nagarajan.

  • How to create web service for a Java class in SAP NetWeaver Studio

    hi all,
    i am using SAP Netweaver Developer Studio.have created a normal java project and i want to create web service for one of the classes in this project. i used the  Web Service Creation Wizard to create a web service for this class. but it says there's no methods available for VI. all my methods in this class are public, what should i do?

    Hi,
    I guess there are other ways. But this is an easy way, if you find the right wizards.
    Besides this it is good practise to define interface methods so that session bean implement these interface methods, and thus seperate the interface from the implementation.
    In this approach you will need 3 projects:
    An enterprise application project (will contain EJB Module)
    An EJB Module project (will contain session bean)
    A Java project (contains code that implements the session bean methods)
    In my previous post I suggested to use a J2EE web mudule project. This was a mistake, it should be EJB module.
    But it should be possible to do it in another way. It is up to you.
    Good luck, Roelof

  • How to create web service for database application

    Hi everyone
    Is it possible to create a web service for an apex database application page which has reports and radio fields and dialog boxes and validations in it. IF it is possible to create, pls help me with example or step by step procedure. I have seen all oracle docs of implementation of Web services in apex but unable to figure out how to get that link of wsdl for an application.
    Thanks in advance.
    Regards
    Sandeep Artham

    Hi,
    I guess there are other ways. But this is an easy way, if you find the right wizards.
    Besides this it is good practise to define interface methods so that session bean implement these interface methods, and thus seperate the interface from the implementation.
    In this approach you will need 3 projects:
    An enterprise application project (will contain EJB Module)
    An EJB Module project (will contain session bean)
    A Java project (contains code that implements the session bean methods)
    In my previous post I suggested to use a J2EE web mudule project. This was a mistake, it should be EJB module.
    But it should be possible to do it in another way. It is up to you.
    Good luck, Roelof

  • Can't create web service for other servers

    I am trying to create EJB web service for JBoss 4.0 but getting error in "build-impl.xml " file on the following line
    "<taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">"
    Is there any way to create an web service for another servers.
    OR
    Is there any way to configure "wscompile" tool to generate the web service for other servers
    It would be of greate help if any-body responds
    thanks in advance
    parag

    Hi,
    The following article
    http://developers.sun.com/prodtech/javatools/jsenterprise/reference/docs/jse7/jse7_jboss_plugin.html
    describes how to configure the JSE IDE to develop and deploy a J2EE application on a JBoss Application Server by using the JBoss plug-in.
    Hope this helps.
    Radhika

  • 2004S MiniSAP ABAP: SAPGUI crashes when creating a Web Service

    I have installed the NW2004S ABAP Preview System from SDN on a VMWare Image (Windows XP, 1.7 GB Mem).
    No problems during the install. Also I was able to run the sample Web Dynpro Quiz Application.
    However when try to create a Web Service the SAP GUi crashes with the Windows Error Message "dispwork.exe has encountered a problem and needs to close." Interestingly enough the "dispwork.exe" process in the MMC continues to be green and I can reconnect.
    Here are the detailed steps if you want to try to re-produce:
    1) Select Package SAPBC_IBF_SCUSTOMER
    2) Select Function Module "BAPI_FLCUST_GetList"
    3) Right mouse click and Create -> Web Service
    4) Web Service Wizard opens, type in name for Web Service (Z_...) and continue with the default settings
    5) Creat as Local Object
    Result: After about 5 minutes of compiling the SAP GUI crashes. The Web Service is not created (checked in WSADMIN)
    Any help is greatly appreciated. Will reward points for hints which lead to a resolution.

    I'm glad to see it wasn't just me having this problem. I installed the SPS8 version of the 2004s ABAP trial a couple weeks ago and immediately tried to apply SPS9 and kernel patches, etc. (with a lot of help from your blog 3930, even though some things have changed since then).
    I ran into this same problem you describe but since there had been some other problems along the way too, I decided to uninstall the whole server and start over. Uninstallation and getting a clean installation again was a mess (maybe the new cleanup utility would have helped some) but I got past that.
    The second time through, I made a lot of improvements, which I'll list here since they may help others, but still ran into this problem in the XPRA_EXECUTION phase.
    Improvements to process:
    1) Backup database first, just in case
    2) Share the c:\SAP directory as Sapmnt so that SPAM can find the packages
    3) Add at least one extra batch process, since the default installation only gives one and more are needed for the support package installation (the easy way is to increase rdisp/wp_no_btc in the NSP* profile in C:\SAP\NSP\SYS\profile)
    4) While in the profile, change ztta/cua_area = 250000 to avoid some errors logged in trace files for having that too low
    5) Also in the profile, put the slash between the directory and file name in ssf/ssfapi_lib and sec/libsapsecu
    6) Also in the profile, add "dynpro/generate_in_separate_luw = N", as per note 949737
    7) Request and install a new license key before applying the support packages.
    All of the above were changes I made after finding errors or problems and these solve the problems. Some errors also led me to upgrade MAXDB from 7.60 build 32 to 33 (pretty painless if note 735598 is followed carefully) but I'm not sure that really solved anything.
    I tried hard to debug the WEBI_AFTER_IMPORT problem and narrowed it down to when it's trying to create a transformation for a function and XSLT_MAINTENANCE is called and then inside the Activate method and the Check method it calls. I ended up not able to solve this problem but also hoping that SPS10 would do so, as per note 973675. I just removed the AFTER_IMP method for WEBI from table OBJM temporarily while letting SPAM continue.
    I too will be waiting to see if SPS10 helps or if someone comes up with a solution. Ideally, a new version of the trial could be posted which incorporates the above improvements and includes SPS9 or SPS10 so that those installing it fresh don't have to go through so many issues...
    Message was edited by James Webster at 10/10/2006 5:36 p.m. EST to add point 7 to the list of improvements.

  • Error when creatibg a web service in  SAP r/3 ecc 5, WebAS 640

    We are trying to expose a BAPI  (BAPI_CUSTOMER_GETSALESAREAS) as a web service on SAP R/3 ECC 5. web AS 640.
      We created the virtual interface (Z_VI_CUSTOMER_BAPI)and the web service definition (Z_WSD_CUSTOMER_BAPI)from SE80. When we try to release the web service definition from WSCONFIG, we get an error saying:
    "Error when creating web service(Web Service Definition Z_WSD_CUSTOMER_BAPI for SOAP application unbekannt)"
    Please help...
    Thanks,
    Shailesh

    Hi.
    I think I must clarify my question.
    The Web Service is not called inside SAP R/3 but externally. For testing pourpose I actually use WS Navigator and XMLSpy.
    The method inside ABAP Server Proxy which is exposed as a Web Server in SAP R/3 system is the following. Note that the Web Service is Asynchronous.
    METHOD zpi_ii_test_ws_4_in~test_ws_4_in.
      DATA: lwa_zpi_test TYPE zpi_test.
      lwa_zpi_test-mandt = input-mt_test-record-client.
      lwa_zpi_test-bukrs = input-mt_test-record-company.
      lwa_zpi_test-belnr = input-mt_test-record-document.
      lwa_zpi_test-gjahr = input-mt_test-record-year.
      INSERT zpi_test FROM lwa_zpi_test.
      COMMIT WORK.
    ENDMETHOD.
    I have created another Web Service in SAP R/3 which is Synchronous, and the error does not occurs. The following is the method inside ABAP Server Proxy which is exposed as a Web Service in SAP R/3 system.
    METHOD zpi_ii_test_ws_3_in~test_ws_3_in.
      DATA: l_bukrs      TYPE bukrs,
            l_belnr      TYPE belnr_d,
            l_gjahr      TYPE gjahr,
            lr_belnr     TYPE RANGE OF belnr_d,
            lwa_zpi_test TYPE zpi_test.
      l_bukrs = input-mt_req-msg+0(4).
      l_gjahr = input-mt_req-msg+4(4).
      SELECT MAX( belnr ) INTO l_belnr
        FROM zpi_test
        WHERE bukrs EQ l_bukrs
          AND belnr IN lr_belnr
          AND gjahr EQ l_gjahr.
      IF l_belnr IS INITIAL.
        l_belnr = '4700000000'.
      ELSE.
        l_belnr = l_belnr + 1.
      ENDIF.
      lwa_zpi_test-mandt = sy-mandt.
      lwa_zpi_test-bukrs = l_bukrs.
      lwa_zpi_test-belnr = l_belnr.
      lwa_zpi_test-gjahr = l_gjahr.
      INSERT zpi_test FROM lwa_zpi_test.
      COMMIT WORK.
      output-mt_resp-msg = l_belnr.
    ENDMETHOD.
    I hope to have clarified my question.
    Rafael Rojas.

Maybe you are looking for

  • Moving times in ical

    The new (and poorly designed) iCal list the time on the right of the event in month view.  Is there a way to have the time listed to the left of the event. ie.  from    Meeting  8 AM           To        8AM   Meeting. (Why would they ever change that

  • Urgent--- Expiry of Sales Order

    Hello Experts, Hope you all are doing good. I have requirement from client. **After reserving the quantity for a particular customer during sales order creation, can that system would be able to cancel the sales order after 7 days automatically and c

  • HT4528 MY IMESSAGE WILL NOT ACTIVATE, THEREFORE I CANNOT GET ANY MESSAGES AT ALL

    Just got my iphone5 replaced and the imessage will not activate..and i cannot recieve any text messages!! please help!!

  • JavaScript CS4 vs CS6

    I have an old awesome HDR blending script that was written for Photoshop CS3-CS4 but will not run on CS6. Not being a programmer, I still would like to try and upgrade the script, but don't know where to start. Are there major differences in the Java

  • Pattern Maker or another plug-in for Photoshop CC?

    Hello, I know there is no longer patter maker in CC. I used it for creating patterns from existing background in an image. With pattern features in 14.2 I can't reach the same effect. Pattern maker was aware of the edges of the pattern and created go