Consume SAP Web service with parameters in Forms using JS

Hi All
I am trying to execute a call to a webservice using javascript from my adobe form .
I can get this working by creating a DataConnection and mapping input fields on the form to the Request structure (XFA method) .
But when I use JS, i cannot get it working while using paramters.
Here is my sample code.
var cUrl = http://XXXXXXX:XXXX.........;
var service = SOAP.connect(cUrl);
var inputVal = {IvMatnr:MATNR.rawValue, Ivlgort:LGORT.rawValue, IvWerks:WERKS.rawValue};
var result = service.ZppTestGetBatchNumbers(inputVal);
txtResult.rawValue = result;
Any help would be greatly appreciated

Instead of using parameters, I am now using hidden text fields on the foem which I have bound to the web service call.
This is a work around that is working fine for me..

Similar Messages

  • Consuming SAP web services with tables

    I'm doing kind of feasibility study on consuming SAP web
    services from CF.
    So far so good, but I'm stuck dealing with tables
    (import/export parameters in SAP world).
    I know how to receive a table object from SAP functions:
    * With Apache Axis v1.2: pass an empty CF structure as a
    * With Apache Axis v1.4: pass an empty CF array as a
    Then the parameter is filled with data (replaced with Java
    object) and we can just parse the object accordingly.
    My question here is whether or not we can pass a *table with
    actual records*.
    For example, I want to pass a table with multiple records to
    update DB records under SAP.
    I tried passing (1) CF array of structure and (2) Java
    ArrayList with no chance.
    The web service call itself completes without errors (no
    method signature error), but the SAP function seems to see the
    parameter as an empty table.
    Anyone has been successful with this case?
    Any suggestion would be much appreciated.

    Thanks Dan,
    Unfortunately CF query object didn't work either.
    Now I'm looking at the code generated by Flex Builder to see
    how the classes are like ;-)
    It's just an ArrayCollection of simple value objects
    (representing a row).
    So CF array of structure or Java ArrayList looks a reasonable
    approach though they don't at all.

  • Exporting to Microsoft Excel from a DataView Web Part consuming a Web Service with Parameters

    In Sharepoint Designer, I've developed a page displaying a DataView Web Part which consumes an XML Web Service with three parameters.  These parameters are passed in from a simple Form Web Part containing three input fields.  I am able to provide default values for the web service so the dataview is initially populated, and when I enter in new parameters, the web service goes back, grabs the requested data and displays in the dataview nice and slick.
    The problem I'm having is this: In Internet Explorer 7, when I right-click on the DataView Web Part and select Export to Microsoft Excel, Excel opens up, says "ExternalData_1: Getting Data..." and returns the data from the web service which applies to the default parameter values each and every time, regardless of whether I have changed the parameters on the web page, and contrary to what the DataView Web Part displays on the screen.
    Has anyone else run into this, and is there a solution to the problem?
    Best regards,
    Mark Christie

    Hi Bullish35,
     It's possible to provide single export button and export your 4 dataview webparts. Here's the modified code.
    <Script Language="Javascript">
    function isIE() // Function to Determine IE or Not
    return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
    function exportToExcel() // Function to Export the Table Data to Excel.
    var isIEBrowser = isIE();
    if(isIEBrowser== false)
    alert('Please use Internet Explorer for Excel Export Functionality.');
    return false;
    var strTableID1 = "detailsTable1", strTableID2 = "detailsTable2", strTableID3 = "detailsTable3", strTableID4 = "detailsTable4";
    var objExcel = new ActiveXObject("Excel.Application");
    var objWorkBook = objExcel.Workbooks.Add;
    var objWorkSheet = objWorkBook.Worksheets(1);
    var detailsTable = document.getElementById(strTableID1);
    var intRowIndexGlobal= 0;
    for (var intRowIndex=0;intRowIndex<detailsTable1.rows.length;intRowIndex++)
    for (var intColumnIndex=0;intColumnIndex<detailsTable1.rows(intRowIndex).cells.length;intColumnIndex++)
    if(intColumnIndex != 3)
    objWorkSheet.Cells(intRowIndexGlobal+1,intColumnIndex+1) = detailsTable1.rows(intRowIndex).cells(intColumnIndex).innerText;
    for (var intRowIndex=0;intRowIndex<detailsTable2.rows.length;intRowIndex++)
    for (var intColumnIndex=0;intColumnIndex<detailsTable2.rows(intRowIndex).cells.length;intColumnIndex++)
    if(intColumnIndex != 3)
    objWorkSheet.Cells(intRowIndexGlobal+1,intColumnIndex+1) = detailsTable2.rows(intRowIndex).cells(intColumnIndex).innerText;
    for (var intRowIndex=0;intRowIndex<detailsTable3.rows.length;intRowIndex++)
    for (var intColumnIndex=0;intColumnIndex<detailsTable3.rows(intRowIndex).cells.length;intColumnIndex++)
    if(intColumnIndex != 3)
    objWorkSheet.Cells(intRowIndexGlobal+1,intColumnIndex+1) = detailsTable3.rows(intRowIndex).cells(intColumnIndex).innerText;
    for (var intRowIndex=0;intRowIndex<detailsTable4.rows.length;intRowIndex++)
    for (var intColumnIndex=0;intColumnIndex<detailsTable4.rows(intRowIndex).cells.length;intColumnIndex++)
    if(intColumnIndex != 3)
    objWorkSheet.Cells(intRowIndexGlobal+1,intColumnIndex+1) = detailsTable4.rows(intRowIndex).cells(intColumnIndex).innerText;
    objExcel.Visible = true;
    objExcel.UserControl = true;
    I haven't tested this. But it should work! :)Regards,
    Venkatesh R
    /* My Code Runs in Visual Studio 2010 */

  • Consuming a Web Service with WEB AS 6.40

    i try to consume a Webservice from the internet. I have configured the logical port and i created the client proxy as shown in the following real good weblog from
    Thomas Jung.
    But when i try to test the proxy in SE80 I retrieve the following error:
    What's wrong here? Someone can help me?
    Thanks for your help!

    We had the same error message for one of our Proxy Web Service calls.
    We tried to use an RFC instead of the URL, and performed a TEST CONNECTION.  And low and behold, we received an error message that was much more helpful than the "Unallowed RFC-XML Tag (SOAP_EINVALDOC)" message.
    The problem for us was that the Server that we were trying to consume the Web service from was blocking the IP address of our Web Application Server.
    We contacted the administrator, he verified that was the case, removed the restriction, and all is good now.
    Here was the message we saw when we tested it in the RFC:
    The Web server you are attempting to reach has a list of IP addresses that are not allowed to access the Web site, and the IP address of your browsing computer is on this list.  Please try the following: Contact the Web site administrator if you believe you should be able to view this directory or page.
    Hope this helps!

  • Consuming a Web Service with ABAP in WAS 6.40 (SS3)

    Hi Everyone,
         Has anyone successfully consumed a web service (based on an EJB) that is published to the J2EE engine of their WAS 6.40 server by creating a proxy from the ABAP layer?
         We are encountering the following problem: When executing method of the proxy to call the Web Service on the J2EE engine, the CX_AI_SYSTEM_FAULT exception is triggered with the message "Unallowed RFC-XML Tag (SOAP_EINVALDOC)".
         This same problem has occurred with multiple web services, even though the proxy generation seems to execute without a problem.  Is there some system setting that could cause this?  We have run the SOAP Runtime trace, but only receive the same basic information about the problem.
         If anyone has any thoughts at all, I'd be grateful to hear them.

    We encountered problems when consuming a foreign WS. It seems to be that RPC style WSDL isn't supported by the WAS 6.4 WS proxy. An interesting reading on this is difference between rpc and document style wsdl.article

  • Consuming  a Web Service with PasswordDigest Authentication in ABAP

    I need to consume a web service in ABAP from a non-SAP application. The web service uses wsse:UsernameToken with PasswordDigest in the SOAP Header for authentication. However, I havent seen any documentation for using Password Digest in ABAP.
    Is it possible to use Password Digest in ABAP?

    Hi Marc,
    Here is the ABAP Code to build the SOAP header.
    *"*"Local Interface:
    *date and time data
      data: lv_sys_date like sy-datum,
            lv_sys_time like sy-uzeit,
            lv_year(4) type c,
            lv_month(2) type c,
            lv_date(2) type c,
            lv_hour(2) type c,
            lv_min(2) type c,
            lv_sec(2) type c.
      data : lv_created type string,
            lv_snonce type string,
            lv_b64nonce type string,
            lv_webservice_password type string,
            lv_webservice_userid type string,
            lv_spassword type string,
            lv_xpassword type xstring,
            lv_hpassword type hash160x,
            lv_b64password(255) type c,
            lv_xpasslen type i,
            lv_hpasslen type i.
    *xml declartions
      data : lv_sheader type string,
            lv_xheader type xstring,
            xml_document TYPE REF TO if_ixml_document,
            xml_root TYPE REF TO if_ixml_element,
            xml_element TYPE REF TO if_ixml_element,
            xml_node TYPE REF TO if_ixml_node.
    *get the c-link password.
        EV_USER_ID  = lv_webservice_userid
        EV_PASSWORD = lv_webservice_password
    *Evaluate created date time
      lv_sys_date = sy-datum.
      lv_sys_time = sy-uzeit.
      lv_year = lv_sys_date(4).
      lv_month = lv_sys_date+4(2).
      lv_date = lv_sys_date+6(2).
      lv_hour = lv_sys_time(2).
      lv_min = lv_sys_time+2(2).
      lv_sec = lv_sys_time+4(2).
      CONCATENATE lv_year '-' lv_month '-' lv_date 'T' lv_hour ':' lv_min ':' lv_sec '.000Z' into lv_created.
    *Create and encode the nonce
          NUMBER_CHARS  = 24
          RANDOM_STRING = lv_snonce.
      CALL METHOD cl_http_utility=>ENCODE_BASE64
          UNENCODED = lv_snonce
          ENCODED   = lv_b64nonce.
    *create the password to be sent to web service
      CONCATENATE lv_snonce lv_created lv_webservice_password into lv_spassword.
    *encode password to xstring
          TEXT   = lv_spassword
          BUFFER = lv_xpassword.
      lv_xpasslen = xstrlen( lv_xpassword ).
          ALG      = 'SHA1'
          DATA     = lv_xpassword
          LENGTH   = lv_xpasslen
          HASHX    = lv_hpassword
          HASHXLEN = lv_hpasslen.
          INPUT            = lv_hpassword
          INPUT_LENGTH     = lv_hpasslen
          OUTPUT           = lv_b64password
          OUTPUT_TOO_SMALL = 1
          OTHERS           = 2.
      IF SY-SUBRC <> 0.
    * build the header
    '<soap-env:Header xmlns:soap-env="">'
    '<wsse:Security xmlns:wsse="">'
    '<wsse:UsernameToken wsu:Id="########" xmlns:wsu="">'
    '<wsse:Password Type="">'
    INTO lv_sheader.
    *Build the xml header element
      lv_xheader = cl_proxy_service=>cstring2xstring( lv_sheader ).
              xml           = lv_xheader
              document      = xml_document
              invalid_input = 1
              OTHERS        = 2.
          IF sy-subrc = 0 AND NOT xml_document IS INITIAL.
            xml_root = xml_document->get_root_element( ).
            er_security_element ?= xml_root->get_first_child( ).
            gr_soap_security_header = er_security_element.
        CATCH cx_ai_system_fault .

  • Consuming a web service with an applet...

    Hi, Ive created an applet in netbeans 5.5, which consumes a web service - it works 100% "run file" in the ide, but when i look at it via web browser, it seems the webservice object cannot be instantiated. I'm guessing I need to somehow include jax-ws objects in my deployment, but how do I do this? - I'm a little out of my depth here, so please explain thoroughly

    We encountered problems when consuming a foreign WS. It seems to be that RPC style WSDL isn't supported by the WAS 6.4 WS proxy. An interesting reading on this is difference between rpc and document style wsdl.article

  • Consuming Java Web Service with complex return types

    I'm consuming a Java Web Service and the return I get in
    ColdFusion is a typed Java Object (with custom Java classes like ...)
    Within this object I don't get direct accessible properties
    as when I'm consuming ColdFusion Web Services, instead I get a
    getPROPERTYNAME and setPROPERTYNAME method for each property.
    How can I handle this? I don't want to call this methods for
    each property (and there are nested objects with arrays of custom
    classes below, which would really make this complicated).
    What's the best way to cope up with this?
    Thanks a lot,

    The web service is actually the function, not the cfc and you
    didn't show a function.
    My own opinion is that since webservices by definition should
    be available to any calling app (cold fusion, .net, flash, etc),
    whatever gets returned from the method should be as universally
    recognizable as possible. This generally means text, numbers,
    boolean, or xml.

  • Consuming Domino web service with JAXB encounters Method Response element

    I am able to consume a Domino R7 (Axis) web service with JAX-WS using Dispatch<SOAPMessage>. When I try using Dispatch<Object> however, JAXB throws an exception because it encounters an unexpected tag.
    The XML from the web service looks like this:
                    The meaning of life
    </Envelope>With Dispatch<SOAPMessage>, I can get to the meaning of life quickly using SOAPBody.getElementsByTagName( "WebServiceMethodReturn" ) but with Dispatch<Object>, it appears I must also create a class for the WebServiceMethodResponse element to make JAXB happy. I don't see this happening in other people's examples. Has the Return-element-within-Response-element design been eliminated in pure JAX-WS web services, or is this something that only IBM does?

    In case anyone's search leads them here, I've posted the solution at:
    It is an exhaustive article (not "Hello World"!) that goes through several versions of the web service and client - hopefully explaining all+ pieces of the puzzle:
    ~ web service code,
    ~ WSDLs
    ~ schema
    ~ thoroughly-documented clients that do and do not use JAXB
    ~ ... that use generated artifacts
    ~ ... that customize existing POJOs
    ~ the SOAP messages generated in each direction
    ~ the necessary JAXB annotations
    ~ explanations of how the code works
    ~ explanations of how namespaces affect the code
    ~ on and on and on...
    My constant goal was to write an uncomplicated solution that uses as few artifacts (two) and annotations as possible. The end result is a small, fast JAX-WS 2.0 client that uses JAXB to invoke and consume a secured Domino 7 (1.4.2 JVM + AXIS) web service, using RPC/literal SOAP messages.

  • Consuming a web service with header

    I am trying to consume a web service in BIP.
    But the problem is that the authentication is in the header of the SOAP, it does not take the values provided in username/password field in complex type service.
    (However i am able to see the methods in the body of the web service.)
    hence i get an error "username not specified"
    how do i pass the credentials in the header of the soap?
    I am using BIP

    This is the output at the oc4j when I try to execute:
    After WSS soapMessage = <soap:Envelope xmlns:soap="http://sche">
    <soap:Body xmlns:ns1="urn:XYZ_Request">
    Notice that Header is null. I want to pass the authentication in the header.

  • Consuming a web service with a java client

    wanted to consume the following web service:
    so i used WSDL2Java to create client stubs n then followed it with a client program
    public class XmethodsAccessor {
    public static void main(String[] args) throws Exception{
    org.apache.axis2.databinding.types.UnsignedLong x = new org.apache.axis2.databinding.types.UnsignedLong(10000L);
    NumberConversionStub stub = new NumberConversionStub();
    NumberConversionStub.NumberToWords request = new NumberConversionStub.NumberToWords();
    NumberToWordsResponse response = stub.NumberToWords(request);
    System.out.println("answer is : " + response.getNumberToWordsResult());
    Upon running the program i get error
    Exception in thread "main" org.apache.axis2.AxisFault: Connection reset
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(
    at org.apache.axis2.engine.AxisEngine.send(
    at org.apache.axis2.description.OutInAxisOperationClient.send(
    at org.apache.axis2.description.OutInAxisOperationClient.execute(
    at com.dataaccess.www.webservicesserver.NumberConversionStub.NumberToWords(
    at com.dataaccess.www.webservicesserver.XmethodsAccessor.main(
    Caused by: org.apache.axis2.AxisFault: Connection reset
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(
    ... 5 more
    Caused by: org.apache.axis2.AxisFault: Connection reset
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(
    at org.apache.axis2.transport.http.HTTPSender.send(
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(
    ... 6 more
    Caused by: Connection reset
    at org.apache.commons.httpclient.HttpParser.readRawLine(
    at org.apache.commons.httpclient.HttpParser.readLine(
    at org.apache.commons.httpclient.HttpConnection.readLine(
    at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(
    at org.apache.commons.httpclient.HttpMethodBase.readResponse(
    at org.apache.commons.httpclient.HttpMethodBase.execute(
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(
    at org.apache.commons.httpclient.HttpClient.executeMethod(
    at org.apache.commons.httpclient.HttpClient.executeMethod(
    at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(
    ... 8 more
    Can any one please tell me what im doin wrong and why is it not working.
    PS: am using Eclipse 3.2/Axis2 Eclipse plugin .. there were no compilation errors

    Hi steve_224,
    Would be extremely grateful if you could post the answer when you get a chance, have this problem too and haven't managed to resolve it yet...
    Thanks in advance...
    Kind regards,

  • Start GP Process from VC using Web Service with parameters

    II´m trying to instantiate a GP process from a Vc iView using a Web Service; I always used Instantiation via URL but using this method I don´t have any "return" data from GP saying "Ok - The process started succesfully".
    The questions are:
    1) Is possible to start a GP process via Web Services through a VC Flash iview? If so, is posible to send input parameters to the process via the web service?
    2) Does the web service returns any message with the status of the process? ( something like: "the process started succesfully")
    Best regards,

    1) Is possible to start a GP process via Web Services through a VC Flash iview? If so, is posible to send input parameters to the process via the web service?
    A: Yes. You can send input parameters to the service through WS.
    2) Does the web service returns any message with the status of the process? ( something like: "the process started succesfully")
    A: Yes. The return message can be added to the WS. It depends on how do designed the WS.

  • How to call web service with parameters?

    I'm testing a distributed architecture where parameters are queried from an ODBC database, and a web service called with resulting parameters as input, returning a computed result to the integrated Crystal report. I'm unable to successfully associate the database fields with the web service parameters - the web service is always called with empty parameters. When I call the web service manually from CR by entering parameters, it works as expected. I'm using a sub-report with fields linked to the main report.
    Has anyone done something like this / know how to correctly link database fields with web service parameters?
    Help much appreciated,

    An update - I solved this problem as follows:
    In CR Design view, right-click on sub-report object, select 'Change Subreport Links'. In the links dialog, transfer database fields into 'Field(s) to link to' list. Select a field in 'Field(s) to link to' and in 'Subreport parameter field to use' below, map the field to the appropriate web service parameter field in the dropdown.
    Tested with version
    - Lance

  • Report published as web service with parameters

    Post Author: kevinzebeste
    CA Forum: Publishing
    hi,I have a problem in a report published as web service.indeed, the report has a parameter, a date.Client side I do this://I create the parameter             ParameterFields paramFields = new ParameterFields();            ParameterField paramField = new ParameterField();            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();            paramField.Name = "date";            paramDiscreteValue.Value = "10/10/2006";            paramField.CurrentValues.Add(paramDiscreteValue);            paramFields.Add(paramField);//I add the parameter into the crVievwer            crystalReportViewer.ParameterFieldInfo = paramFields;//I call the web service to get data            crystalReportViewer.ReportSource = "http://localhost/WebService/Rapport1Service.asmx"; Server Side :Now, I want to get back the parameter in the web service (in Rapport1Service.asmx, so server-side) to be able to call my storedprocedure with the good parameter, this one which was put on the client side (10/10/2006).I tried to do crystalReportViewer.ReportSource = "http://localhost/WebService/Rapport1Service.asmx?date=22/10/2006" on the client side but no way. i don't find a solution, is there any way to make this possible ?Moreover, i have one database for each user, so i need to pass the user name, password and account too..

    Post Author: kevinzebeste
    CA Forum: Publishing
    I have found a solution.
    I  create a web service in which i return a dataset, filled with the data wanted.the web service take as parameter: the report name we want, the parameter(s), and the username and password (to check if the user has right to access to data.)After that, I fill the report, client side, with the datasen given. i don't know if it's the best solution but it works !

  • Consuming MapPoint Web Service with MX7

    Can anyone offer any pointers for working with Microsoft's
    MapPoint web service? I've searched around but haven't found any
    usable information. My immediate concern is how to get my CF7
    application to perform the Digest Authentication, but I'd also
    welcome tips for any other obstacles that can be expected after

    So here's what I needed to do to get this to work with CF7:
    1. Edit wwwroot/WEB-INF/client-config.wsdd to use
    CommonsHTTPSender per the Tom Jordahl blog post (
    2. Put commons-httpclient-3.1.jar and commons-codec-1.3.jar
    into CFusionMX7/lib. These jars are available from the Apache
    Commons project (
    3. Add a web service entry in the CF Administrator. For the
    sample code to work, use the name MapPoint. The URL is the normal
    staging wsdl (,
    and the username and password are the ones issued by Microsoft for
    your mappoint account.
    The CF application service needs to be restarted to pick up
    the apache commons jars. At this point, the sample code should be
    runnable. It displays an input field which you can type an address
    into (e.g. "1 microsoft way, redmond, wa"), and displays a map when
    submitted. The code is fairly simplified and ignores things like
    the possibility of multiple find results.
    Since this is entirely done in CFML, some of the helper
    objects used as function inputs need to be built up as CF structs
    mirroring the data members of the java objects. This is problematic
    in creating a MapView object because there's no way to indicate
    which of the derived classes (ViewByHeightWidth, ViewByScale, etc)
    you intend. My workaround was to use a view object returned by
    Hope this will be helpful to somebody.

Maybe you are looking for

  • SOAP: error occured: invalid content type for SOAP: TE

    Hi, We are implementing an XI scenario as follows: Mail Adapter->XI->SOAP Receiver. Basically, we pass the XML File attachment from the Mail Adapter through XI to the SOAP Adapter. However, we keep getting the following error: <i>SOAP: error occured:

  • Help ~~ Cannot compile servlet program

    I have recently written a servlet program. When I compile the program (let's say ""), I've got the following error message: package javax.servlet does not exist I've download the class files and set the classpath already. Have I missed

  • Company code for operational units in different countries

    In this organizational structure (logistics industry) we have the main office in country A and operational units in different countries. The operatioanl units are legal entities. do these operational units require separate company codes ? pl send you

  • Please Suggest - new java.text.DecimalFormat Question

    table2.setValueAt( "$"+new java.text.DecimalFormat("#.##").format     ((Double.valueOf(table2.getValueAt(row,1).toString())).doubleValue())*     ((Double.valueOf(table2.getValueAt(row,2).toString())).doubleValue()) row, 3 );Is there a way to force De

  • Gmail notification center without mail or browser open

    Hi all Notification center works well if is open (i don't use it anymore, so i'm not sure) and when the browser is open and Gmail open. Does exist any solution to be notified about new emails (maybe just the imporatant one) having gmail clos