Consuming WebServices in ABAP WebDynPro via webservice proxy code

Hi,
My requirement is to consume a webservice using WSDL(basic authentication) in WebDynPro ABAP. then based on the SOAP response I need to show a pop up message whether the response valid or not.?
I first tested the webservice by creating LPCONFIG Logical Port and generated WebService Proxy class.
It got response correctly with basic authentication enabled each time I send a request.
Secondly I generated webservice proxy code using service calls on creating webdynpro test application with some UI elements. Service call created Nodes,attributes and method correctly.
it's giving me error when it tries to invoke webservice method through generated code.
Question is that How do we code authentication to the webservice method via WebDynPro ABAP code.
I appreciate anyone who worked on this area and taken basic authentication via coding. or worked successfully through coding.
Thanks
Praveen

hi
Refer this:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6066fbe8-edc4-2910-9584-a9601649747d
It might be usefull for u.
Regards
Vivekananthan.S

Similar Messages

  • Consuming webservice in ABAP Webdynpro

    Hi all,
    I am using SAP ECC 5.0.Can I consume External webservices using ABAP Dynpro.Sending related links will be highly appreciated.
    Regards
    Sandeep.S

    the thread is marked as answered? is it resolved or are you still looking for an answer

  • ABAP webdynpro or webservices

    hi all,
    I have an question. I have a system where i can use the ABAP webservices or the ABAP webdynpro to send data to a flex application.
    But which of those 2 is the best solution? Or doesn't it matter which one i choose?
    Do you have found some (dis)advantages for the solution with the webservices or do you have found some (dis)advanteges found with the solution with the ABAP webdynpro?
    Kind regards,
    Anton Pierhagen

    Hi Anton,
    If comparison done between Web Dynpro having Flash Island for Flex components and Independent Flex application communicating with R/3 via RFCs then in many aspects Web Dynpro is better option.
    If backend is R/3 then anyways you have all required infrastructure in place no need of any other servers in case of WD. But if you go for 2nd option then may be for hosting swf files you need WAS or any other server.
    There might be some cases where you need to fetch lots of data from DB then using SOAP way i.e. RFCs could give you time-out during data retrival at Flex frontend ( very rare case but there is possibility).
    You can use your WD to handle all business logic and Flex components only for presentations like charts, interactive components etc.
    One majot advantage of WD will be security aspect which can be handle very easily ( even with Single-Sign-On) whereas in independent Flex application you might end-up with extra security inception other than basic authentication of RFCs on load.
    these are few differences out of many others which i can tell you.
    Though both options you are thinking are good and feasible but i would suggest Web Dynpro. (Anyways being SAP Partner also we should promote SAP investments )
    Regards,
    Vivek
    Edited by: vivek khedekar on Sep 23, 2010 6:08 AM

  • How to consume a ABAP webservice in a  webdynpro app?

    Hi,
    I have a BAPI in ABAP that is exposed as a webservice. I want to use this to build a webdynpro app so that i can consume this webservice. This BAPI returns the Employee data. As soon as the person logs into the portal i am going to pass his login id to this BAPI so that it retrieves the Employee data for that user id. But i need to know the procedure of consuming this webservice in a webdynpro app. Any pointers in this regard will be greatly appreciated.
    Thanks,
    Arun E V

    Hi Arun,
    Consumption of a web service is univesal I guess so it wont matter if it is an ABAP webservice. For consumtion of webservice in Web Dynpro you can go through the following tutorials
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/using%20car%20rental%20web%20service%20with%20web%20dynpro.pdf">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/using%20car%20rental%20web%20service%20with%20web%20dynpro.pdf</a>
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/creating%20an%20email-client%20using%20web%20dynpro%20and%20web%20services.pdf">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/creating%20an%20email-client%20using%20web%20dynpro%20and%20web%20services.pdf</a>
    Do reward points if it helps
    Regards
    Sid

  • Consuming webservice in a webdynpro component

    Hi Experts,
    I have a third party free webservice as WSDL link.My requirement is to make use of that webservice in my webdynpro component.
    Can any body give me a step by step approach to consume that webservice in my webdynpro Component.
    If possible, Provide me some good material for consuming webservice in a webdynpro component.
    Awaiting for a useful reply.
    Thanks,
    Ramanan.p

    hi,
    Few indroductory sessions
    /people/thomas.jung/blog/2007/12/17/consuming-services-with-abap -Consuming webservices with webdynpro.
    It is possible to create webservice in ABAP as well as in Webdynpro.
    ABAP Webservice:
    http://wiki.open-esb.java.net/Wiki.jsp?page=BAPIWEBSERVICE
    http://www.sappro.com/downloads/SAPXI.pdf
    Webdynpro Webservice:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/244e7923-0a01-0010-5887-fe0b0c6dbb8d
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/30f1b585-0a01-0010-3d96-ad0ea291c4f9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/db785a70-0701-0010-858c-eee0ec4fe1b3
    In Web Dynpro ABAP there is nothing special about calling a web service. Unlike WD Java, there are not dedicated model object types in WD ABAP. WD ABAP simply has the ability to interact with other ABAP development object types. You can call function modules, ABAP classes, even modules in old dynpro apps.
    So calling the webservice from ABAP therefore is just the process of generating the ABAP Proxy Class. This is the same process regardless of if you want to use this proxy class from WDA or any other type of ABAP development object. You can then call the proxy class from WDA just like any other type of ABAP class. There is a service wizard option in later support package levels that includes an option for ABAP Proxy classes - although it doesn't generate the proxy class it just generates the code and context for the call to an already existing proxy class. The service wizards in WD ABAP are not required however. They are just shortcut code generators and often can't even generate a complete context for a complex web service proxy - so expect to do some manual adjustment after running the wizard.
    Edited by: Mahalakshmi kothuri on Jun 1, 2008 4:17 PM

  • Error Consuming a webservice from ABAP

    Hi all,
      I am consuming an external webservice from abap. I created teh proxy using WSDl file. While testing teh service its giving an exception like this-
    "JAXB unmarshalling exception: Unable to create an instance of de.*******v2.MeldungType; nested exception is javax.xml.bind.UnmarshalExcept
    ion: Unable to create an instance of de.****.MeldungType# - with linked exception:#[java.lang.InstantiationException]"
    With a soapfaultcode: 1..
    can any one help out in arriving at teh reason for this..
    Regards
    Sandeep

    I've seen lots of unmarshalling errors whilst trying to consume web services via Web Dynpro Java...  Usually, it was due to an inconsistency between the WSDL file being used and the underlying web service definition.  It might be worth checking the WSDL you are using is correct and up to date, in case the underlying service interface has changed.
    Also worth checking if you have any simple boolean type parameters defined as part of the service interface - they have to have a value assigned when you call the service and cannot be null.
    HTH.

  • Consuming a webservice in ABAP ECC 6.0 without using XI/ PI

    Hi Experts,
    I wanted to consume an external webservice without using XI / PI.After doing my homework and search on sdn I came to know that we can consume webservices in ABAP using proxies using SE80(Enterprise Services).
    I am trying to create a client proxy with the URL of webservice.It asks me the option to choose between URL or HTTP.
    I am selecting URL and in the second screen it asks about the package details and after that it finishes.Later I get an error message stating "NO VENDOR SPECIFIED".Its not allowing me to create a proxy.
    So, here are my questions.
    Does anyone faced the same kind of problem?
    Can we really consume a webservice without using XI / PI or any other middleware?
    Is it possible to consume the webservice only with URL or WSDL file ?
    Please let me know the exact process.
    Thanks in Advance.
    Shanker Pandey.

    Hi Martin,
      Please check these following links. Though you have reported already, these may help
    Proxy Object generation error using Wizard for Web Service Consumption
    Also, please have a look @ /people/thomas.jung/blog/2006/03/13/develop-a-web-service-that-sends-an-email--in-abap-netweaver-04s
    Hope this helps,
    Karthik

  • Consuming MII WebService in Java WebDynpro

    Hello,
    We are facing a strange situation...
    We define a transaction in MII to be consumed as WebService in Java WebDynpro. This transaction is a simple query on a DB returning 4 fields :
    Shift code : SHIFT
    Shift description : DESCRIPTION
    Start time : START_TIME
    End time : END_TIME
    It works fine, we use the import adaptative web service wizzard in netweaver developper studio to use this WS...
    But if we to an update on the webservice, changing a field name for example (SHIFT -> SHIFTCODE), we start to have trouble...
    We got then the very helpful error message :
    Exception on execution of web service with WSDL URL '<sever>/WebServices/GetShift' with operation 'Xacute' in interface 'XacuteWSSoap'
    If I display the model info using wdContext.currentRequest_XacuteElement().modelObject().associatedModelClassInfo().getModelInfo().toString()
    I got the following (extract) :
    <ModelClassPropertyInfo name="SHIFT" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="SHIFT" required="true" backendType="null"/>
    As you can see, the model definition is NOT updated and we still have SHIFT as name instead of SHIFTCODE...
    If someboby has an idea, it will save us our life ;o)
    Thank you
    PS:it the same behaviour if we add a field...

    Oliver -
    Did you try to reimport the WS model ..? If yes and still doesn't work...Try  to delete the old proxy in webdynpro ( adoptive ws) and import again.
    To avoid code changes,you can give same old name while fresh import.
    Adoptive WS in webdynpro  is not really like Adoptive RFC .It has some limitations.
    Thanks
    Hari

  • Consuming Webservice in ABAP: SoapFaultCode:1

    Hi,
    I have created a webservice with NetweaverDeveloperStudio and deployed it to a J2EE. I tested it with the "NDS-Webservice-Tester" and it worked fine.
    I then created a proxy following the section for WebAS 640 in the weblog of Thomas Jung:
    /people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap
    When using the "test-interface" function in SE80 (also described in Thomas weblog) I get the following result:
    <CX_AI_SYSTEM_FAULT>
    <CODECONTEXT>http://www.sap.com/xml_errorcodes</CODECONTEXT>
    <CODE>SoapFaultCode:1</CODE>
    <ERRORTEXT>
    000D6019F1DD004000000036000020D8000405473991B26F:
    Found 0 operation definitions using keys:
    Key name:'first-body-element-ns'
    key value: 'urn:EdilogUserManagementWebserviceWsd/EdilogUserManagementWebserviceVi/document';
    Key name:'SoapRequestWrapper'
    key value:'getCompany';
    </ERRORTEXT>
    <LANGUAGE />
    </CX_AI_SYSTEM_FAULT>
    Any idea what might cause this error? Is there a list with the SoapErrorCodes and their specific meanings?
    Thanks and regards
    Jan Hempel

    I solved the problem "accidentally": The name of the Webservice was to long! Changing the name from "EdilogUserManagementWebservice" to "UserManagement" did the trick.
    This is probably due to the restricted fieldlength of ABAP-programnames.
    Regards
    Jan Hempel

  • Error in consuming webservices using ABAP

    Dear Gurus,
    I am trying to consume webservices using ABAP. We dont have XI installed and no java instance installed.
    I created a customer proxy through SE80 and generated a proxy class by giving a WSDL link and also defined logical port. Traditionally followed the steps. But while testing webservices , I get a ICF error.
    The error is as follows:
    SOAP : 1:023 SRT : Processing error in internet communication framework ("ICF error when recieving the response  ICM_HTTP_CONNECTION_FAILED)
    Please let me know the cause of this error and solution to be provided.
    I also tried to call the method from an abap program, But I get CX_AI_SYSTEM_FAULT exception.
    Awaiting your replies.
    Thanks in advance for your support and valuable time.
    Thanks
    Gurushanthi

    Hi Gurushanthi,
    It could one of several problems, examples:
    - A firewall setting
    - http communication out disabled by Basis team or
    - The logical port wasn't configured correctly.
    Try the suggestions in this thread to narrow down the reason (particularly the telnet test from the server):
    [Re: Error testing external web service ICM_HTTP_CONNECTION_FAILED;
    Regards, Trevor

  • Call (consume) a webservice from ABAP for dummies

    Hi
    I find the documentation for this topic very confusing. It a badly structured mix of documentation of client scenarios, server scenarios and worst of all a lot of XI nonsense.
    I need purely client scenario documentation without any info about XI and without any info about creating web services.
    I just need to know how to consume a web based webservice in ABAP program. Where can I find this docu?
    I have tried to generate proxies from different WSDL sources, but it always fails with different error messages.
    Can anyone suggest a simple WSDL webservice usefull for testing my setup?
    Best regards
    Thomas Madsen Nielsen

    You are right, the help files do mix consuming and creating, but they do provide a list of steps for consuming and what you need to do.  To consume a web service, the general steps you need to follow are:
    - Create an extendable package with use accesses SAI_SXMS, SAI_TOOLS, SAPPINT
    - Create a proxy class using the wizard in SE80 (right click on the package -> Create -> Enterprise Service) - the creation of the class depends on the WSDL document - you can either generate based on the url  for the WSDL or download the WSDL document and import it as a file in the wizard.  You may need to tinker with the WSDL document to get the class generation to complete successfully. Your WSDL is here: [http://maptp12.map24.com/map24/webservices1.5?soap=Map24Routing]
    - Create a logical port in LPCONFIG or SOAMANAGER (assumes NW 7.0 SP14 or later) with information in the WSDL
    - Create a program to consume the service method - it will look something like this (abbreviated):
    DATA: gv_client_proxy  TYPE REF TO zcwsbb_co_global_weather_soap,
          gv_sys_exception TYPE REF TO cx_ai_system_fault.
    DATA: gs_request   TYPE zcwsbb_get_weather_soap_in,
          gs_response  TYPE zcwsbb_get_weather_soap_out,
          gs_weather   TYPE zst_currentweather.
    DATA: gv_message   TYPE string.
    TRY.
        CREATE OBJECT gv_client_proxy.
        CALL METHOD gv_client_proxy->get_weather
          EXPORTING
            input  = gs_request
          IMPORTING
            output = gs_response.
      CATCH cx_ai_system_fault INTO gv_sys_exception.
        CALL METHOD gv_sys_exception->if_message~get_text
          RECEIVING
            result = gv_message.
        WRITE: gv_message.
        FREE: gv_client_proxy, gv_sys_exception.
        EXIT.
    ENDTRY.
    - Transform the response as required using ST or XSLT

  • Error in Consuming Webservice in ABAP

    Hello Experts,
    I am very new to webservices in ABAP. just to test the webservice within ABAP, I created a Service Definition which gave me a WSDL URL using the Provider wizard. then I generated  proxy class to consume the WSDL URL generated in previous step . I am calling the proxy class within a program as below. It is raising a exception CX_AI_SYSTEM_FAULT . Does anyone have idea what this could be and how to correct it?
       TRY.
                  CALL METHOD TEST->ZTESSTHJKJH
                    EXPORTING
                      INPUT  = INPUT
                    IMPORTING
                      OUTPUT = output
                   CATCH CX_AI_SYSTEM_FAULT .
                   CATCH CX_AI_APPLICATION_FAULT .
                  ENDTRY.
    Thanks,
    Harkamal

    Hi Harkamal,
    It seems that the webservice provider and consumer are on the same server (loopback). It's probably releated with network access. You can follow SAP Note Number 1009109 (Analyzing Web service problems using the ICF recorder) to track down the sent and received soap messages . Alternatively, you can download and use "Webservice Studio", a small freeware program to test the webservice easily. Official website is: [http://webservicestudio.codeplex.com/]
    Good luck,
    Ozcan.

  • Calling webservices from ABAP via https/ssl with p12 certificates.

    Hi all,
    I have a problem with calling an external webservice via HTTPS.
    I configured my system as indicate in the blog /people/jens.gleichmann/blog/2008/10/31/calling-webservices-from-abap-via-httpsssl-with-pfx-certificates but when I check the RFC connection the result is: ICM_HTTP_SSL_ERROR.
    I check the ICM monitor and this is the result:
    [Thr 11] Thu May 26 16:02:57 2011                                                                               
    [Thr 11] *** ERROR during SecudeSSL_SessionStart() from SSL_connect()==SSL_ERROR_SSL                                           
    [Thr 11]    session uses PSE file "/usr/sap/SV5/DVEBMGS10/sec/SAPSSLHTTPS1.pse"                                                
    [Thr 11] SecudeSSL_SessionStart: SSL_connect() failed                                                                          
      secude_error 536875072 (0x20001040) = "received a fatal SSLv3 handshake failure alert message from the peer"                 
    [Thr 11] >>            Begin of Secude-SSL Errorstack            >>                                                            
    [Thr 11] WARNING in ssl3_read_bytes: (536875072/0x20001040) received a fatal SSLv3 handshake failure alert message from the peer
    WARNING in ssl3_output_cert_chain: (12354/0x3042) No hierarchy certificate in FCPath                                           
    WARNING in reduce_FCPath_by_Issuer: (12354/0x3042) No hierarchy certificate in FCPath                                          
    [Thr 11] <<            End of Secude-SSL Errorstack                                                                            
    [Thr 11]   SSL_get_state() returned 0x000021d0 "SSLv3 read finished A"                                                         
    [Thr 11]   Server's List of trusted CA DNames (from cert-request message):                                                     
    [Thr 11]     #1  " certificate 1
    [Thr 11]     #2  " certificate 2
    [Thr 11]   SSL NI-sock: local=ip  peer=ip2                                                       
    [Thr 11] <<- ERROR: SapSSLSessionStart(sssl_hdl=6000000000652010)==SSSLERR_SSL_CONNECT                                         
    [Thr 11] *** ERROR => IcmConnInitClientSSL: SapSSLSessionStart failed (-57): SSSLERR_SSL_CONNECT [icxxconn_mt.c 2012]
    SAP_ABA     700     0012     SAPKA70012     Componenti validi per tutte le applicazioni
    SAP_BASIS     700     0012     SAPKB70012     Componenti di base SAP
    PI_BASIS     2005_1_700     0012     SAPKIPYJ7C     PI_BASIS 2005_1_700
    ST-PI     2008_1_700     0001     SAPKITLRD1     SAP Solution Tools Plug-In
    SAP_BW     700     0013     SAPKW70013     SAP NetWeaver BI 7.0
    SAP_AP     700     0010     SAPKNA7010     Piatt. d'applicazione SAP
    CCM     200_700     0010     SAPK-27010INCCM     CCM 200_700 : Add-On Supplement
    SRM_PLUS     550     0010     SAPKIBK010     SRM_PLUS per mySAP SRM
    SRM_SERVER     550     0010     SAPKIBKT10     SRM_SERVER
    BI_CONT     703     0001     SAPKIBIIP1     Contenuto Business Intelligence
    ST-A/PI     01L_BCO700     0000          -     Servicetools for other App./Netweaver 04
    What do you think about it?
    Best regards,
    Norberto.

    Don´t forget to set your proxy settings! Be sure that the application server could establish a connection to the external server.
    From the BLog.
    Thr 11 WARNING in ssl3_read_bytes: (536875072/0x20001040) received a fatal SSLv3 handshake failure alert message from the peer
    From the Error.
    Have you looked into the above details?
    Thanks
    SM

  • How to consume json webservice in abap?

    hello  every one please help me how to consume json format webservice in abap.
    i am new in abap please help me out .
    Thanks&Regards
    ~Ahmad

    hi check this,
    First create a web service in SAP. The blog by Uwe Kunath descibes this clearly. Then create an Xcode project and use the ASIHTTPRequest wrapper to connect to the web service. Parse the response with the KissXML parser. A more out of the box solution is NetWeaver Gateway. It also let you use SAP web services but it also generates iOs code for you. SAP just released a trial version in de download section.
    Example of ASIHTTPRequest
    - (void)getFlightData:(NSString *) selectedDate {
         NSURL *url = [NSURL URLWithString:@"http://abap.sapdev.nl:8000/sap/resources/flights/from/%/to/%/date/20110128?sap-client=001"];
         ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
         [request setUsername:@"BCUSER"];
         [request setPassword:@"minisap"];
         [request startSynchronous];
         NSError *error = [request error];
         if (!error) {
              NSString *response = [request responseString];
              [self parseXML:response];
    Example of KissXML
    -(void)parseXML:(NSString*)source {
         NSError *error = nil;
         DDXMLDocument *theDocument = [[DDXMLDocument alloc] initWithXMLString:source options:0 error:&error];
         NSArray *results = [theDocument nodesForXPath:@"/asx:abap/asx:values/TAB/BAPISFLDAT" error:&error];
         for (DDXMLElement *flightdetail in results) {
              NSString *airlineid =   [[flightdetail elementForName:@"AIRLINEID"] stringValue];
              NSString *airline =     [[flightdetail elementForName:@"AIRLINE"] stringValue];

  • Consume WebService in ABAP Web Dynpro

    Hi, Is there any How To or step by step document which shows to consume web service in ABAP Web Dynpro.
    I've searched a lot but could not find any.
    Please provide me some pointer/examples.
    Thanks,
    CD

    Hi Thomas,
    I am facing a problem in consuming web service in webdynpro.
    I created a web service for standard FM BAPI_BUS1240_CREATE (it is available in SAP ECC server).
    I want to consume this web service in another system (SAP Portal system, where users will be providing input; this FM is not available here).
    I created a Proxy class in SAP Portal system through the WSDL document of the Web service.
    I configured logical port for the same in TCode: SOAMANAGER and successfully tested the Client proxy (through TCode: SE80). As a result, the record is created in SAP ECC server.
    Now, I am unable to do the same through Webdynpro. Please find the attached Proxy class screen-shot. It has 6 methods of which BUS1240_CREATE contains the relevant parameters of the actual BAPI FM.
    I filled up the same parameters that I used in Testing the Client proxy but unable to create record in SAP ECC system. My code (On_submit of a button) looks like below,
    TRY.
          CREATE OBJECT wd_assist
            EXPORTING
              logical_port_name = 'ZXXXXXXX'.          "Logical port configured through SOAMANGER
            CATCH cx_ai_system_fault.
      ENDTRY.
          CALL METHOD wd_assist->bus1240create                  "Method filled with input parameters given by user
            EXPORTING
              input  = ls_inp
            IMPORTING
              output = ls_outp.
    After execution of method BUS1240_CREATE, system throws the error as below,
    The following error text was processed in the system DEP : Error (id=SoapFaultCode:5 ): Web service processing error; more details in the web service error log on provider side (UTC timestamp 20141011062545; Transaction ID 5B0F51E4AD4EF13EA6B9E41F137BE3CC)
    Please tell me where I went wrong. Do I need to call methods of the Proxy class? Also suggest if any configuration change involved in this.
    Have a nice day, thanks.

Maybe you are looking for