Webservice using ABAP

Hi, 
  I am creating my first webservice  and I am facing problems while testing it.
By using SAP HELP on WS I created a  Web servive for a RFC FM in SAP. Once the WS is created I went to txn WSADMIN and clicked on test icon to test the webservice I just created.
I get  Page not found error.  The reason I guess i s because the correct J2EE url is not updated in Adminisration settings of WSADMIN.
How can we know the correct URL of the J2EE server of the SAP system  for which I logged in using SAP GUI.
Thanks,
Arpitha.

Hi,
Calling a web service in ABAP that validates an email id and even this link has the code for that.
Create a program and use the following code:
REPORT zvalidate_email.PARAMETERS: p_mail(100) LOWER CASE.                 " E-Mail id to be verifiedDATA: http_client TYPE REF TO if_http_client .DATA: w_string TYPE string ,
      w_result TYPE string ,
      r_str    TYPE string .DATA: result_tab TYPE TABLE OF string.START-OF-SELECTION .
  CLEAR w_string .
  CONCATENATE
  'http://www.webservicex.net/ValidateEmail.asmx/IsValidEmail?Email=' p_mail
INTO
  w_string .  CALL METHOD cl_http_client=>create_by_url
    EXPORTING
      url                = w_string
    IMPORTING
      client             = http_client
    EXCEPTIONS
      argument_not_found = 1
      plugin_not_active  = 2
      internal_error     = 3
      OTHERS             = 4.  CALL METHOD http_client->send
    EXCEPTIONS
      http_communication_failure = 1
      http_invalid_state         = 2.  CALL METHOD http_client->receive
    EXCEPTIONS
      http_communication_failure = 1
      http_invalid_state         = 2
      http_processing_failed     = 3.
  CLEAR w_result .
  w_result = http_client->response->get_cdata( ).  REFRESH result_tab .
  SPLIT w_result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .  READ TABLE result_tab INTO r_str INDEX 2.
  IF r_str+44(1) = 't'.
    WRITE:/ 'Valid email address'.
  ELSE.
    WRITE:/ 'Invalid email address'.
  ENDIF.
thanks and regards
Manohar
Edited by: Gouri  Manohar Gadhamsetty on Jan 6, 2009 5:57 PM

Similar Messages

  • 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

  • Invoking Webservice using ABAP Proxy

    Hi,
        I have a synchronous scenario with ABAP proxy invoking the external webservice.In the SOAP receiver target URL confiuration,do I need to give the operation(method)name in the webservice? I have read in the forum that we need to give the target URL with .asmx extension.What is the meaning of .asmx extension?
    Thanks,
    Leo

    Hi Teresa,
    We meet again !!
    Right, we have a simple solution for this without using BPM.
    In the proxy, set a field on the outbound data structure from the proxy to indicate to XI which receiver determination in XI can use to send the message to the right interface.
    We have exactly the scenario you are talking about and it works like a treat.
    Send me an e-mail @ [email protected] and I will send you a screenshot of how simple this is without using BPM.
    Cheers
    Colin.

  • 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

  • Problem while Calling Webservice from ABAP

    Hello All,
                 I am Calling the Webservice using ABAP-Class from abap,i getting the following HTML response error from the Webservice.Can any one help me.
    tional//EN">######
    ####td {font-family : Arial, Tahoma
    , Helvetica, sans-serif; font-size : 14px;}##A:lin
    k ##A:visited
    ##A:active ####
    Thanks and Regards,
    Kamal

    It is not finding the correct URL - hence the 404 - page not found error.
    Correct the URL and try again.

  • 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

  • Consume ABAP Webservice using AJAX javascript

    Hi,
    We created webservice for  ABAP BAPI. And I want to consume this using AJAX javascript.
    But I am getting "Access Denied" javascript error.
    Please let me know how to pass the credentials while trying to consume this webservice
    I tried below code, but its NOT workng
    var URL ="http://hostname/sap/bc/srt/rfc/sap/servicename?sap-client=400&sap-user=testuser&sap-password=testpassword";
    xmlhttprequest.open("POST", URL, true);
    Please let me know your thoughts ...
    Thanks
    Edited by: sona p on Feb 27, 2010 12:18 AM

    Hi,
    Thanks for your response. I did the same as mentioned in the link provided by you. But it is not working . I am still getting "Access denied" javascript error in the second line ( xmlhttprequest.open) . Below is my code.
    var auth = make_base_auth('userid','password');
    xmlhttprequest.open("POST", URL, true);
    xmlhttprequest.setRequestHeader('Authorization', auth);
    xmlhttprequest.setRequestHeader ("Content-Type", "text/xml");
    xmlhttprequest.onreadystatechange = getDataList;
    xmlhttprequest.send(SOAPEnvelope);
    Please let me know your thoughts. Thanks again for your response.

  • Passing table from ABAP to webservice using SOAP

    Hello:
    I am trying to pass table data from ABAP code to a webservice using SOAP.  I have seen many examples of passing single value parameters such as:
      DATA: osoap   TYPE REF TO CSoapDocument.
        GET REFERENCE OF p_refno INTO dref.
        CALL METHOD osoap->add_parameter
          EXPORTING
            direction  = CSoapConstants=>ic_param_in
            name       = 'ws_ref_no'
            value      = dref.
        CALL METHOD osoap->set_tag_name_format
          EXPORTING format = CSoapConstants=>ic_tagfmt_default.
    However I cannot find any code examples of passing table data to a webservice.  Can anyone provide a sample or documentation for how to pass table data to a webservice?
    Thanks,
    Craig

    Hi Craig
    i just posted this on SAPfans for you too!
    if you are not using PI, then follow this....
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/bb/ddb33d2ae46b3be10000000a114084/frameset.htm
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/9b/dad1ae3908ee44a5caf57e10918be9/frameset.htm
    this is converting XSD to ABAP....
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/de/705c3c3806af06e10000000a11402f/frameset.htm
    i have only used PI to do this via ABAP Proxies....

  • Problem when trying to use Google WebService with abap

    Hello,
    I want to call a Google webservice from abap but I can't create the proxy class.
    The WSDL of this webservice is located at   
    [<a href="http://api.google.com/GoogleSearch.wsdl">http://api.google.com/GoogleSearch.wsdl</a>
    When I try to create the proxy class with transaction SE80, I have the following error message (SPRX046) : <i>Proxy generation terminated: Message must have exactly one part     
    </i>     
    Does anyone have an idea to solve this problem  (We are in ECC 6.0 NW 2004S) ?
    How can we do if <message> has multiple <part> entries ?
    Thanks
    JLG

    hi,
    you can't create a proxy for the google API because Google's webservices are <b>RPC style</b> and the proxy wizard of WAS ABAP on NW2004s supports <b>document style</b> webservices only.
    Search Google for the keywords mentioned and you'll find a lot of discussions and explanations of the difference of these two styles.
    regards,
    anton

  • 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 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.

  • Creation of webservices using SOAMANAGER

    Hi All,
    Can someone let me know how to create web services using the new transaction SOAMANAGER. I have earlier used WSCONFIG & WSADMIN transactions but these seem to obsolete in the latest versions.
    I have done the following steps so far
    1. Create a function module with required parameters
    2. Set the FM as RFC enabled and activated.
    3. Created the webservice using the wizard in SE37
    When i checked for the node for the webservice in SICF it was inactive. Hence i had right clicked and activated the service.
    I have also checked the following blog,
    /people/bv.pillai/blog/2008/01/27/new-service-definitions-in-the-abap-development-environment-soamanager-150-sap-nw-70-sp14
    I navigated to the following path to test my webservice
    Txn: SOAMANAGER->Business admin->web service admin-><Z* webservice>Apply selection->Open Web Service navigator for selected binding
    When i try this i am getting an error "J2EE host or port not specified; define them under "System Settings"
    Can someone let me know in identifying what i have missed out?
    Also it would be great if someone can let me know the URL for SAP help documentation on SOAMANAGER. I am unable to locate it in SAP library.
    Thanks,
    Prasath N

    hi,
    you don't need the webservice navigator to activate a service or binding. it's just there to allow testing of the service if you have no other options. like the "webservice homepage" in WSADMIN the webservice navigator requires a J2EE instance up, running and configured.
    the help pages for SOAMANAGER are to be found under [this general node|http://help.sap.com/saphelp_nw70/helpdata/EN/9b/dad1ae3908ee44a5caf57e10918be9/frameset.htm].

  • Read data from SharePoint using ABAP sql command

    We need to read data from a SharePoint site and update the sap object services with the information. There is a lot of information on how to put data into Sharepoint from SAP, but we need to get data from SharePoint and put it into SAP. Is it possible to retrieve data from SharePoint using sql command in ABAP program? If it is possible, what do we need to do to have SAP recognize where to get the SharePoint data?
    Richard Newman

    Hi Newman,
    You can use native sql in your abap code to read data from SharePoint's database. But I would suggest you to generate a SharePoint webservice which can provide you the neccessary data so that you can consume this webservice in ABAP
    (Will be quite faster than native sql).
    Regards,
    Ozcan.

  • How to call webservice using standalone application

    Hi,
    Actually i am trying to connect with one free webservice using client. but i am uanble to get the result and it is throwing the Exception.Exception is Execution failed. Exception: java.net.ConnectException: Connection timed out: connection reset
    i am using the following code.
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;
    import org.apache.axis.utils.Options;
    import javax.xml.namespace.QName;
    import java.io.*;
    public class AddFunctionClient {
    public static void main(String [] args) {
    try {
         String endpoint = "http://www.startvbdotnet.com/web/sample2.asmx?wsdl";
         System.setProperty("http.proxyHost", proxyHost);
              System.setProperty("http.proxyPort", portNumber);
         Service service = new Service();
         Call call = (Call) service.createCall();
         call.setTargetEndpointAddress( new java.net.URL(endpoint) );
         call.setOperationName(new QName(endpoint, "add"));
              System.out.println("connected");
              System.out.println("value is"+call.invoke(new Object[]{new Integer(10),new Integer(20)}));
         } catch (Exception e) {
         System.err.println("Execution failed. Exception: " + e);
    can any one help on this

    Hi,
    If your  JAVA Application is Web based application, you can expose it as Webservice.
    JAVA People will pick the data from Dbase using their application and will send the data to XI by using our XI Details like Message Interface and Data type structure and all.
    So we can Use SOAP Adapter or HTTP in XI..
    If you use HTTP for sending the data to XI means there is no need of Adapter also. why because HTTP sits on ABAP Stack and can directly communicate with the XI Integration Server Directly
    If you are dealing with the Webservice and SAP Applications means check this
    Walkthrough - SOAP  XI  RFC/BAPI
    REgards
    Seshagiri

  • Access KM using ABAP

    Hi All,
      How to access / create files in KM using ABAP code? Any FM available to create folder in KM via ABAP code? Searched the forum but most of the similar queries are unanswered.
    Requirement:
        Need to upload and retrieve documents from KM for web dynpro ABAP application.
    Thanks
    Krishnan

    Hi,
    KM is an application on SAP portal platform developed using Java. So direct communication from ABAP to KM through RFC or FM would not be possible.
    I think through webservice there is a possibility. You can create a webservice on SAP. Portal This webservice can be used in your ABAP code.
    Regards,
    Jigar Oza

Maybe you are looking for

  • Writing to file limiting system performanc​e

    Hello, I really could use some help with my VI in terms of writing data.  I've had a LOT of help optimizing my code and am trying to enhance the performance in terms of data acquisition.  However, it seems as though writing to a data file is really l

  • How to insert a image file into oracle database

    hi all can anyone guide me how to insert a image file into oracle database now i have created table using create table imagestore(image blob); but when inserting i totally lost don't know what to do how to write query to insert image file

  • Linked btn for AR invoice returnes "no matching record found AR inv. OINV"

    hi all, linked button (see the code bellow)  upon click returns "no matching record found AR invoice OINV" error message. If I cut & paste the number into AR Invoice FORM, invoice 'opens'  without any problems. Please help oUserDataSource= oForm.Data

  • Disk size after copying a disk with dd

    Hi all, I recently bought a new hard drive, larger than my old one. I thought I'd be smart, and copied partitions using dd: dd if=/dev/sda1 of=/dev/sdb1 I noticed today that there is something wrong with the size remaining on the new drive, and after

  • Time stamps in Seconds from Epocho

    Hi, I have a requirement, where I need to calculate the Time stamp for sy-datum. That is. I have to calculate the number of seconds from 01/01/1970. www.unixtimestamp.com gives more infor. But how do I do this in my report?