Webservice consumption from abap system

hi colleagues,
I want to consume webservice that is in ABAP syatem  in webdynpro java project .
I just want to know what is the basic thing need to do  for consuming webservice.
Thanks,
sudhanshu

Hi,
You need to create the Adaptive Webservice Model.
After that you need to create the destination for this WebService in the below location of Visual Admin.
services>WebServiceSecurity>Dynamic WebService Proxies-->Click on Create button.
And you need to give this destination in the properties of Webservice Model.
See the below document for destinations configuration:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b2bc0932-0d01-0010-6d8e-cff1b2f22bc7
This destination is to handle the url, credentials (uname, pwd) dynamically.
See the complete tutorial "Accessing an Email Web Service using the Adaptive Web Service Model" in the below link.
Web Dynpro Java Tutorials and Samples NW 2004 [original link is broken]
If you are using CE 7.1 go through the below document.
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50d70a19-45a3-2b10-bba0-807d819daf46
Regards,
Charan

Similar Messages

  • Webservice Consumption from ABAP without XI

    Hi Experts,
    Im trying to consume a webservice which I got from ESB(IBM) team. Basically I got a wsdl file.
    First I have created a proxy from SE80 by uploading this wsdl file and I have activated sucessfully.
    Second from SOA Manager I have created Logical port for this wsdl file.
    Finally I wrote one ABAP program to consume webservice and got the return message.
    Now for this I have few doubts.
    1) Because I'm uploading WSDL file manually, in future if there is any change in the webservice do i need to upload new wsdl file again?
    2) In the wsdl file endpoints like URL will change from dev to qa and prod. If that is the case, from SAP how can we transport from dev to Quality to Prod?  Do we need to manually change those urls? How can we transport to different  servers?
    3)suppose I have uploaded 2 wsdl files. And in SOA manager I have created logical ports with the same name. Then in our program how can we call the right service as there are two logical ports with the same name?
    Appreciate your help .
    Regards,
    Ravi.D

    Hi,
    >1) Because I'm uploading WSDL file manually, in future if there is any change in the webservice do i >need to upload new wsdl file again?
    It depends of the changes. Suppose, one optional input parameter has been added in the wsdl, and you don't need this parameter from the client side. You would not need to regenereate the client proxy from the new wsdl. But if you want to play it safe, regenerate the proxy each time the wsdl is modified.
    It should not change every day !
    >2) In the wsdl file endpoints like URL will change from dev to qa and prod. If that is the case, from SAP >how can we transport from dev to Quality to Prod? Do we need to manually change those urls? How >can we transport to different servers?
    This is runtime configuration that you have to do manually in each system. It cannot be transported and should not as it would have no meaning.
    3)suppose I have uploaded 2 wsdl files. And in SOA manager I have created logical ports with the same name. Then in our program how can we call the right service as there are two logical ports with the same name?
    It would be a bad idea to create 2 different logical ports with the same name but if you do, thare will be no confusion because the logical port is defined for the client proxy.
    Regards,
    Olivier

  • Pushing data from abap system to SLD

    Hello,
    I am pushing data from my abap system to SLD.
    Job SAP_SLD_DATA_COLLECT is successfully finished but the job SAP_LMDB_LDB_0000000001. is not visible in sm37 in solman.
    Hence technical system is not visible in LMDB.
    Please guide me
    Thanks and Regards,
    Akshay

    HI Akshay
    I hope you had make sure that in SM61 you have assigned batch servers for the jobs.
    Can you try to sync your LMDB with SLD once. There is option in LMDB to sync the data, Just see if you are getting the technical system details.
    Also, please check the rfc destinatoin with ICM port if it is stable.
    RFC LMDB_SyncDest<X> is using ICM Port 80<NR>
    You can proceed as below
    Please De-Activate the Sync Job in Solman_Setup -> System Preparation -> Prepare Landscape -> Set Up LMDB.
    Execute transaction 'SM59'.
    Locate the HTTP Destination -> 'LMDB_SyncDest<X>'.
    Switch to Edit mode.
    Change the Service No to 5<XX>00 where XX is the instance number.
    Then makesure the Authorization and Connection test are working.
    Then Re-Activate the synch job, via Solman_Setup -> System Preparation -> Prepare Landscape -> Set Up LMDB
    Apart from that, can you check below note if it is applicable for you
    1615263 - LMDB: Incremental Content Sync Job remains "Scheduled"
    Regards
    Rishav

  • Exposing WebService directly from ABAP Class not from BAPI

    Hi guys,
    is it possible ti expose a Webservice direct from an ABAP OO-Class.
    I know the possebility to do it for RFC enabled Funktionmodules but I think it is no good coding style to call ABAP-OO-Methods using RFC-Module only for providing them as methods of an WebService...
    Is there anyone who has exerience on that area ?
    Thanks in advance.
    Bast regards
    André

    Hi Micky,
    thanks for your answer. But the WS-Call are OO codings and the class is OO coding. From my point of view it is not a good style using an RFC Functionmodule as "middleware" between OO-Classes.
    However, if it is not possible I have to live with the possabilities SAP provides.
    regards
    André

  • Webservice call from Abap

    Hi
    <u>ABAP:</u>
    I wish to know ,Do we need to configure SNC for calling an Abap side webservice using X509 certificate ?I m calling webservice from Abap.I created a certificate through VisualAdministrator and asign it to R/3 in STRUST transaction.Now can I pass it to my Webservice so that it should not ask for user/password.Any other way ,if u can suggest for the same,is welcome.
    <u>JAVA:</u>
    If  i need to do the same with J2EE WAS webservice-then will the steps vary,as i feel no SNC can be configured in J2EE WAS.
    Regards
    Dhanya

    Hi,
      Besides that i think you can do it by configuring the ITS and calling the webservice by means of using BSP applications in ABAP .
    Regards
    Abhishek
    Message was edited by: Abhishek Raj

  • Reading Webservice information from ABAP Program

    Hi All,
    How to read a webservice information from a ABAP program ?
    Are there any webservices available in ABAP which can do this .
    Gopal.

    Hi,
    The following code will call the web service and fill the data into internal table which was received from the Web service. This code will send & Receive the data from ABAP to Webservice.
    Change the Header detail as per your Webservice.
    REPORT  ZWORKORDER.
    TYPES: BEGIN OF OUTTAB1 ,
      JOBCODE(20),
      COMPONENTCODE(20),
      ACCURATEHOURS(20),
      ACCURATECOST(20),
      LENGTH TYPE I,
       END OF OUTTAB1 .
    DATA: OUTTAB TYPE  TABLE OF OUTTAB1.
    DATA: TAB TYPE OUTTAB1.
    DATA: WF_O LIKE LINE OF OUTTAB .
    DATA: XSLT_ERR TYPE REF TO CX_XSLT_EXCEPTION .
    DATA: RLENGTH TYPE I,
          TXLEN TYPE STRING  .
    DATA: HTTP_CLIENT TYPE REF TO IF_HTTP_CLIENT .
    DATA: WF_STRING TYPE STRING .
    DATA: WF_STRING1 TYPE STRING .
    DATA: WF_PROXY TYPE STRING ,
          WF_PORT TYPE STRING .
    CLEAR WF_STRING .
    Form the input string to send the Input Data to Web service.
    CONCATENATE
    '<?xml version="1.0" encoding="utf-8"?>'
    '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
    '  <soap:Body>'
    '    <GetWorkOrder xmlns="http://*******erica.net/webservices/">'
    '      <nWorkOrder>2</nWorkOrder>'
    '      <nDistributorCode>4871</nDistributorCode>'
    '      <model>HM400</model>'
    '     <type>1 </type>'
    '    </GetWorkOrder>'
    '  </soap:Body>'
    '</soap:Envelope>'
    INTO WF_STRING .
    CLEAR :RLENGTH , TXLEN .
    RLENGTH = STRLEN( WF_STRING ) .
    MOVE: RLENGTH TO TXLEN .
    CLEAR: WF_PROXY, WF_PORT .
    CALL METHOD CL_HTTP_CLIENT=>CREATE
      EXPORTING
        HOST    = '192.168.1.41' "'http://****merica.net/webservices'
        SERVICE = '8080'
        SCHEME  = '1'
      IMPORTING
        CLIENT  = HTTP_CLIENT.
    HTTP_CLIENT->PROPERTYTYPE_LOGON_POPUP = HTTP_CLIENT->CO_DISABLED.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = '~request_method'
        VALUE = 'POST'.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = '~server_protocol'
        VALUE = 'HTTP/1.1'.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = '~request_uri'
        VALUE = '/service/accurate/workorder.asmx?'.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = 'Content-Type'
        VALUE = 'text/xml; charset=utf-8'.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = 'Content-Length'
        VALUE = TXLEN.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = 'SOAPAction'
        VALUE = 'http://********merica.net/webservices/GetWorkOrder'.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_CDATA
      EXPORTING
        DATA   = WF_STRING
        OFFSET = 0
        LENGTH = RLENGTH.
    Send the Input Data to Web service.
    CALL METHOD HTTP_CLIENT->SEND
      EXCEPTIONS
        HTTP_COMMUNICATION_FAILURE = 1
        HTTP_INVALID_STATE         = 2.
    Receive the Input from Web Serice.
    CALL METHOD HTTP_CLIENT->RECEIVE
      EXCEPTIONS
        HTTP_COMMUNICATION_FAILURE = 1
        HTTP_INVALID_STATE         = 2
        HTTP_PROCESSING_FAILED     = 3.
    CLEAR WF_STRING1 .
    WF_STRING1 = HTTP_CLIENT->RESPONSE->GET_CDATA( ).
    DATA: LENGTH TYPE I.
    LENGTH = STRLEN( WF_STRING1 ).
    DATA: VALUE_FIELD TYPE NAME_KOMP.
    DATA: VALUE TYPE REF TO DATA.
    FIELD-SYMBOLS: <FS_CONVERTED_DATA>.
    DATA: TAB1 TYPE TABLE OF STRING.
    DATA: FROM_LENGTH TYPE I VALUE 1.
    DATA: TO_LENGTH TYPE I.
    DATA: DIFF TYPE I.
    DATA: START TYPE I VALUE 1.
    DO.
    JOBCODE.
      SEARCH WF_STRING1 FOR 'JobCode=' . "STARTING AT START .
      IF SY-SUBRC <> 0.
        EXIT.
      ENDIF.
      FROM_LENGTH = SY-FDPOS .
      FROM_LENGTH = FROM_LENGTH  + 8.
      SEARCH WF_STRING1 FOR 'JobDescription=' ."STARTING AT START ..
      TO_LENGTH = SY-FDPOS .
      DIFF = TO_LENGTH - FROM_LENGTH .
      MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-JOBCODE.
      TO_LENGTH = DIFF + TO_LENGTH.
      SHIFT WF_STRING1 BY TO_LENGTH PLACES.
    COMPONENT CODE
      SEARCH WF_STRING1 FOR 'ComponentCode=' .
      IF SY-SUBRC <> 0.
        EXIT.
      ENDIF.
      FROM_LENGTH = SY-FDPOS .
      FROM_LENGTH = FROM_LENGTH  + 14.
      SEARCH WF_STRING1 FOR 'ComponentDescription=' .
      TO_LENGTH = SY-FDPOS .
      DIFF = TO_LENGTH - FROM_LENGTH .
      MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-COMPONENTCODE.
      TO_LENGTH = DIFF + TO_LENGTH.
      SHIFT WF_STRING1 BY TO_LENGTH PLACES.
    AccurateHours
      SEARCH WF_STRING1 FOR 'AccurateHours=' .
      IF SY-SUBRC <> 0.
        EXIT.
      ENDIF.
      FROM_LENGTH = SY-FDPOS .
      FROM_LENGTH = FROM_LENGTH  + 14.
      SEARCH WF_STRING1 FOR 'AccurateCost='.
      TO_LENGTH = SY-FDPOS .
      DIFF = TO_LENGTH - FROM_LENGTH .
      MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-ACCURATEHOURS.
      TO_LENGTH = DIFF + TO_LENGTH.
    AccurateCost
      SEARCH WF_STRING1 FOR 'AccurateCost='.
      FROM_LENGTH =  SY-FDPOS.
      FROM_LENGTH =  FROM_LENGTH + 13.
      SEARCH WF_STRING1 FOR '/>'.
      TO_LENGTH = SY-FDPOS.
      DIFF = TO_LENGTH - FROM_LENGTH .
      MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-ACCURATECOST.
      TO_LENGTH = DIFF + TO_LENGTH.
      SHIFT WF_STRING1 BY TO_LENGTH PLACES.
      APPEND TAB TO OUTTAB.
    ENDDO.
    WRITE: (10) 'JOBCODE'.
    WRITE (20) 'COMPONENTCODE'.
    WRITE (30) 'ACCURATEHOURS'.
    WRITE (40) 'ACCURATECOST'.
    LOOP AT OUTTAB INTO TAB.
      WRITE:/ TAB-JOBCODE .
      WRITE (20) TAB-COMPONENTCODE.
      WRITE (30) TAB-ACCURATEHOURS.
      WRITE (40) TAB-ACCURATECOST.
    ENDLOOP .
    It is better to create a proxy, it then puts a level of abstraction between in that coding. All you need to do is then access the proxy class.
    Besides that i think you can do it by configuring the ITS and calling the webservice by means of using BSP applications in ABAP
    <b>I believe you need to create a proxy in order to consume your web service.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/frameset.htm
    Reward points</b>
    Regards

  • Error while calling a webservice from ABAP system

    Hi All,
    I have generated a proxy for the webservice that is there in a Java system.
    Iam getting the following error when I make a method call of that generated proxy.
    SOAP:1.026 SRT: HTTP-Code 500: ("Internal Server Error").
    Does anybody has any idea why is this happening?
    Thank You,
    Suresh.

    Hi Sridhar,
    It is active and it was working fine. It suddendly started giving this error. Do you think if there is any possibility that there would be something wrong in the system where webservice is lying?
    Thank You,
    Suresh.

  • Calling a webservice runtime from ABAP

    Hi All,
    I have a doubt regarding the usage  of webservice runtime.
    I have a scenario where we have a webdynpro ABAP program which displays all the messages for a particular interface. In our scenario we have only an Integration server of PI 7.1. In this server we have developed the web dynpro ABAP program. Now in this program we need to display the adapter status of the message also.
    For getting the adapter status from the Java Stack we developed a webservice. but now the problem is that we cannot consume the webserive using a proxy runtime from the inntegration server.
    I have heared that it can be done if we are using  webservice runntime instead of the proxy runtime, but i dont have a clue in how to use the web service runtime.
    so please somebody help me understand the concept of using the webservice runtime, and how to create and use the webservice runntime to achieve my requirement.
    Thanks in advance.
    AjithV

    Hi All,
    I have a doubt regarding the usage  of webservice runtime.
    I have a scenario where we have a webdynpro ABAP program which displays all the messages for a particular interface. In our scenario we have only an Integration server of PI 7.1. In this server we have developed the web dynpro ABAP program. Now in this program we need to display the adapter status of the message also.
    For getting the adapter status from the Java Stack we developed a webservice. but now the problem is that we cannot consume the webserive using a proxy runtime from the inntegration server.
    I have heared that it can be done if we are using  webservice runntime instead of the proxy runtime, but i dont have a clue in how to use the web service runtime.
    so please somebody help me understand the concept of using the webservice runtime, and how to create and use the webservice runntime to achieve my requirement.
    Thanks in advance.
    AjithV

  • Webservice testing from ABAP

    Hello All,
    I have created a webservice for an RFC enable function module in ABAP..
    For the FM i have created a webservice definition and release the webservice using WSCONFIG...
    Now i am trying to test the webservice from WSADMIN...
    The webservice navigator is not displaying the page in the internet explorer..
    Couly you let me know the problem for the above and provide me the solution
    Thanks in advance
    Regards
    Shiva

    in WSADMIN did you set the url of the j2ee engine from go to->administration settings ?
    Raja

  • Problem with service consumption from ABAP side "SOAPFaultCode: 1"

    Hi gurus,
    I have created a Java Web Service on our Netweaver Portal, my team partner (ABAP) has created the respective ABAP proxy class from the web service´s definition and the logical port. All works just fine on development environment but when we test all the scenario integrated at quality environment through ABAP client proxy->test(f8)) the system throws the following error: SOAPFaultCode: 1 nothing else. Could you help us to figure out the problem and solve it?
    Please Help, Regards
    MC

    Hi Mariana,
    It's good practice to post what caused the issue & how it was resolved. This helps others that may experience the same issue & come across this thread.
    Regards, Trevor

  • Webservice consumption in abap working, but which URL to be checked.

    Dear Experts,
    I am working on Consumer Proxy in SOAMANGER,
    I have created a logical port and have done all the settings.
    When i click on Ping Webservice, it is returning the message as ping is successfull.
    When through ABAP also i am not facing any error.
    But where do i check data that is going to that URL
    I am using SOAP UI.
    Regards,
    Kartheek.

    Hi Kartheek,
    Traces are active for some time like 2 hours.
    Check below thread for config
    Get the XML/SOAP request created by an ABAP Web... | SCN
    Once you save config in SRT_UTIL, it will again show the web service calls.

  • Webservice generated from ABAP

    I am using ECC 6.40. I have generated a webservice for a function module. In this function module i have an import parameter refering to a structure defined in data dictionary (SE11).
    The import parameter is optional. I see this in the virtual interface of the webservice. But i would also like to make each field of the structure optional. Goal is that the WSDL will have nillable fields or minoccurs = 0.
    What i would like to have is like the wsdl from the bapi BAPI_CUSTOMER_CREATEFROMDATA1
    <xsd:element name="PI_COMPANYDATA" minOccurs="0" type="s0:BAPIKNA106" />
    - <xsd:complexType name="BAPIKNA106">
    - <xsd:sequence>
    - <xsd:element name="TITLE" minOccurs="0">
    - <xsd:simpleType>
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="30" />
      </xsd:restriction>
      </xsd:simpleType>
      </xsd:element>
    - <xsd:element name="TITLE_KEY" minOccurs="0">
    - <xsd:simpleType>
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="4" />
      </xsd:restriction>
      </xsd:simpleType>
      </xsd:element>
    In my case i get for the my defined structure ZcvClientfilterRec:
    <xsd:element name="FilterLow" minOccurs="0" type="tns:ZcvClientfilterRec" />
    - <xsd:complexType name="ZcvClientfilterRec">
    - <xsd:sequence>
      <xsd:element name="Clientno" type="n0:char10" />
      <xsd:element name="Clientgroup" type="n0:char2" />
      <xsd:element name="Clientstatus" type="n0:char3" />
    Can anyone help me with this or tell my how i can generate the wsdl so it looks like the standard bapi

    I am using ECC 6.40. I have generated a webservice for a function module. In this function module i have an import parameter refering to a structure defined in data dictionary (SE11).
    The import parameter is optional. I see this in the virtual interface of the webservice. But i would also like to make each field of the structure optional. Goal is that the WSDL will have nillable fields or minoccurs = 0.
    What i would like to have is like the wsdl from the bapi BAPI_CUSTOMER_CREATEFROMDATA1
    <xsd:element name="PI_COMPANYDATA" minOccurs="0" type="s0:BAPIKNA106" />
    - <xsd:complexType name="BAPIKNA106">
    - <xsd:sequence>
    - <xsd:element name="TITLE" minOccurs="0">
    - <xsd:simpleType>
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="30" />
      </xsd:restriction>
      </xsd:simpleType>
      </xsd:element>
    - <xsd:element name="TITLE_KEY" minOccurs="0">
    - <xsd:simpleType>
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="4" />
      </xsd:restriction>
      </xsd:simpleType>
      </xsd:element>
    In my case i get for the my defined structure ZcvClientfilterRec:
    <xsd:element name="FilterLow" minOccurs="0" type="tns:ZcvClientfilterRec" />
    - <xsd:complexType name="ZcvClientfilterRec">
    - <xsd:sequence>
      <xsd:element name="Clientno" type="n0:char10" />
      <xsd:element name="Clientgroup" type="n0:char2" />
      <xsd:element name="Clientstatus" type="n0:char3" />
    Can anyone help me with this or tell my how i can generate the wsdl so it looks like the standard bapi

  • How to call external http client from abap system

    Hi All,
    I have browsed through sdn and google but not found any helpful document ,
    Here my requirement is to call external http client from ecc ,
    Pl suggest..,
    Regards,
    Lokeswar .

    Hi Deepak,
    I have followed the below Reference links :
    Example Program: Executing an HTTP Request - Components of SAP Communication Technology - SAP Library
    http://scn.sap.com/thread/2035765
    but while executing  get http responce i'm facing 'HTTP_COMMUNICATION_FAILURE' error
        CALL METHOD L_HTTP_CLIENT->RECEIVE
          EXCEPTIONS
            HTTP_COMMUNICATION_FAILURE = 1
            HTTP_INVALID_STATE         = 2
            HTTP_PROCESSING_FAILED     = 3.
    Pl suggest ,

  • Calling a Webservice From ABAP

    Hi All,
    Can We make a Webservice call From ABAP ???
    Regards
    Vamsi

    Vamsi,
    1. The Following links were used by me when I was working with Web services XI:
    Hope these links are useful to you.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/336365d3-0401-0010-9884-a651295aeaa9
    http://help.sap.com/saphelp_nw04/helpdata/en/31/daa0404dd52b54e10000000a1550b0/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ebb4c490-0201-0010-86be-88dd6fd46475
    /people/siva.maranani/blog/2005/03/01/testing-xi-exposed-web-services
    2. You can create webservices directly in the ABAP stack of CRM. To do so, refer to the following...
    http://help.sap.com/saphelp_nw04/helpdata/en/9b/dad1ae3908ee44a5caf57e10918be9/frameset.htm
    Web Services Development in ABAP [original link is broken]

  • Consuming Webservices in webdynpro ABAP

    Hello,
    I want to work with consuming Webservices in Webdynpro ABAP. Can anybody give an example for the same.
    Any help would be highly appreciated.
    Thanks.

    Hello
    Here is a link.
    It has many links for the webservice consumption in abap and web dynpro
    Consuming webservice in a webdynpro component
    actaully process on a high level is like this.
    1. first you need to create an client proxy., For creating this go to SE80
    and follow this link
    http://help.sap.com/saphelp_nw04/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/content.htm
    2. then you can consume this service using the service call option of the web dynpro
    here go to the web dynpro comp and right click on it and create-> service call
    and use  the proxy created in the first step here.
    it will create one custom controller which you can use.
    thanks
    sarbjeet singh

Maybe you are looking for