Skip navigation
Currently Being Moderated

Using Web Service from LiveCycle PDF Dynamic Form.

Sep 13, 2010 4:27 AM

I have developed Staff Attendance Sheet about 7 years ago using Microsoft Office Web Componenets Data Access Pages (OWC DAP).
See image below of the current report using OWC DAP:
Since we are moving our legacy systems to SAP, this report will have to be re-implemented using Adobe LiveCycle PDF which is connecting to Web Service over SAP Systems (since OWC does not connect to Web Service).
The SAP development team have developed the initial webservice which generates the required data.
I have developed the initial version of the LiveCycle PDF, which can be downloaded from this link:
The following is a screen snapshot of the LC Desinger Form:http://bit.ly/cxMK62

When the web service is executed from inside PDF the result looks as follows:

http://bit.ly/cacbCg

 

The webservice accepts the following required parameters:

 

1. Period: YYYYMM. User Specified Value.

 

2. Staff ID: 9999999. It must be supplied automatcially to the web service and it must be the Windows ID of the User Logged In to Windows
Domain.

 

Other parameters are optional.

 

Assumptions:

==========

 

1. I am not using any Adobe Forms Server Technology. I can use LiveCycle Desinger ES2 and LiveCycle Reader Extensions Server.

 

2. I can alse develop using .NET to get the Logged In User ID (Windows), generate the XDP from ASPX Page and attach the XML to the XDP.

 

3. We are using IE8 with Adobe Reader 9 Plugin (IE add-on) to display LiveCycle PDF inside IE.

 

Questions:

========

 

1. First time the webservice is executed, I will get a prompt to allow/deny execution of the webservice. This is a security issue here, becuase we do not want any user to know the link to the Web Service. How we can hide the link to the webservice and prevent any user from getting the link ?

 

2. How I can stop the Prompt to Allow/Deny execution to the Web Service for good ? As you know, users will get confused, and when we launch this PDF, it will generate a lot of calls to the Service Desk (more than 1000 users).

 

3. The Web Service uses Simple User Name/Password for authentication to run the webservice. I need to embed the User Name/Password inside
the PDF, and also prevent any user for getting them, how ?

 

4. I want to send the Staff ID Parameter to the Web Service Automatically which is the Logged In User ID (Windows). This is the same value of the "Login Name" which can be accessed using Acrobat JavaScript. But the problem, this script must be trusted, and it will be a long story. Any ideas how to implement this requirement using simple methods ?

 

5. If I manage to send the Staff ID Parameter to the Webservice automatically (Logged In User ID), also, I want to prevent the user from sending a different user ID, ie, prevent him from using Import Data to Form to specify a Different User ID for the Webservice Parameter. How ?

 

I appreciate your help if you have any ideas about the above.

 

Tarek.

 
Replies
  • Currently Being Moderated
    Sep 14, 2010 12:47 AM   in reply to tarekahf

    Hi,

     

    Getting identity properties was discussed here: Keep user from printing and seeing certain pages

     

    However while the folder level javascript working, when the form was Reader Enabled through Acrobat, the script no longer worked as expected. I am not sure how it would behave if Reader Enabled through LCRE ES2.

     

    I don't think you can access the identity properties, other than the two solutions you mentioned.

     

    Hope that helps,

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2010 2:38 AM   in reply to tarekahf

    Sorry Tarek,

     

    I have limited experience with web services (have used public services only).

     

    The temperature convert works here as well (obviously), but I can shed much light on the internal URL. I am not sure why it is not making the call.

     

    Sorry,

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 4:50 AM   in reply to tarekahf

    No you cannot get the Windows identity from the client. This is restricted by security concerns. I do not know how you will get it from the server. Most other Customers will either bring up the security dialog to allow the user to enter credentials or they use a common ID that is used across all queries.

     

    Are you calling the ASP.Net web service from the form? If so then you shoudl be abel to return a single string (that is the XML result). Then you can bind that result to a hidden field and finally load the xml into the data dom on the client side and then let the natural binding in the form take over and put the data into the fields.

     

    Hope that helps

    Paul

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 7:47 AM   in reply to tarekahf

    There are no Window APIs exposed in Arobat and the reason given is that it has been deemed a security risk. It doesn't matter whether I agree or not ...I cannot change it!

     

    Paul

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 23, 2010 6:01 AM   in reply to tarekahf

    I would like to try your javascript code, but I have trouble selecting the correct values from my web service definition. Can you possibly post your wsdl? Thanks.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 23, 2010 7:16 AM   in reply to tarekahf

    Hello Tarek,

     

    I'm asking for the wsdl because I cannot figure out how this line of code works:

    var personalInfo = response[personalInfoResponse][personalInfoKey];

    I suppose the syntax is closely tied to your response object. As I don't know its structure, I cannot translate this line for my response object. Never mind.

     

    Maybe you can tell me where to find the documentation for the SOAP object? I cannot find it in the Livecycle scripting reference.

     

     

    Ein

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 24, 2010 6:38 AM   in reply to tarekahf

    Hello Tarek,

     

    Thanks for the information! That should do the trick

     

    About the local web service: I sucessfully called a web service running on the same computer I used to fill the PDF form. So yes, calling "local" web services does work. I used a Tomcat server however, not IIS.

     

    Ein

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 12, 2010 8:20 PM   in reply to tarekahf

     

    Hi Tarek,

     

     

     

    First of all, Thank for your replying.

     

     

     

    I have developing Adobe LiveCycle xdp form with a button. The SAP Web Service will be called when the button is pressed.

     

     

     

    Before that, I ‘m able to call another ASP.NET web services by using SOAP.request call. However, when I apply the code to call SAP web service, it doesn’t work. I checked that the web service is valid. And I found that there is something wrong when implementing the SOAP.request call. But I have no idea what wrong is it. So, I beg your help

     

     

     

    The following is the code in the click event of the button:

     

     

     

    //mainData.sfMain.Button7[1]::click - (JavaScript, client)

     

        var webServiceEndPoint = "http://xxxxxxx.xxxxxxx.com:8000/sap/bc/srt/wsdl/bndg_DEDB492BB032E7F1B09F001CC4FBCEC9/wsdl11/allinone/ ws_policy/document?sap-client=300";

     

     

     

        var staffIDInput = "9999999";

     

        var oAuthenticator = {

     

        Username: "usr",

     

        Password: "pw"

     

         };

     

     

     

    app.alert("1");

     

        var response = SOAP.request({

     

           bEncoded: false,

     

           cResponseStyle: SOAPMessageStyle.Message,

     

           cURL: webServiceEndPoint,

     

           oRequest: {"urn:Z_RFC_GET_STAFF_BANK_INFO":{A_STAFF_ID: staffIDInput}},

             cAction: "urn:sap-com:document:sap:rfc:functions",

            oAuthenticate: oAuthenticator

      }

    );

    app.alert("2");

    WSDL is shown as follow:

    <?xml version="1.0" encoding="utf-8" ?>

    - <wsdl:definitions targetNamespace="urn:sap-com:document:sap:rfc:functions" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-com:document:sap:rfc:functions" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-uti lity-1.0.xsd">

    - <wsdl:documentation>

    <sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl" />

    </wsdl:documentation>

    <wsp:UsingPolicy wsdl:required="true" />

    - <wsp:Policy wsu:Id="BN_ZWS_ALC_GET_STAFF_BANK_INFO">

    - <wsp:ExactlyOne xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">

    - <wsp:All>

    - <sp:TransportBinding>

    - <wsp:Policy>

    - <sp:TransportToken>

    - <wsp:Policy>

    <sp:HttpsToken />

    </wsp:Policy>

    </sp:TransportToken>

    - <sp:AlgorithmSuite>

    - <wsp:Policy>

    <sp:TripleDesRsa15 />

    </wsp:Policy>

    </sp:AlgorithmSuite>

    - <sp:Layout>

    - <wsp:Policy>

    <sp:Strict />

    </wsp:Policy>

    </sp:Layout>

    </wsp:Policy>

    </sp:TransportBinding>

    </wsp:All>

    </wsp:ExactlyOne>

    <saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" wsp:Optional="true" />

    </wsp:Policy>

    - <wsp:Policy wsu:Id="IF_ZWS_ALC_GET_STAFF_BANK_INFO">

    - <sapsession:Session xmlns:sapsession="http://www.sap.com/webas/630/soap/features/session/">

    <sapsession:enableSession>false</sapsession:enableSession>

    </sapsession:Session>

    <wsp:ExactlyOne xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" />

    </wsp:Policy>

    - <wsp:Policy wsu:Id="OP_Z_RFC_GET_STAFF_BANK_INFO">

    <sapcomhnd:enableCommit xmlns:sapcomhnd="http://www.sap.com/NW05/soap/features/commit/">false</sapcomhnd:enableCommit>

    <sapblock:enableBlocking xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/">true</sapblock:enableBlocking>

    <saptrhnw05:required xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/">no</saptrhnw05:required>

    <saprmnw05:enableWSRM xmlns:saprmnw05="http://www.sap.com/NW05/soap/features/wsrm/">false</saprmnw05:enableWSRM>

    </wsp:Policy>

    - <wsdl:types>

    - <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:rfc:functions">

    - <xsd:element name="Z_RFC_GET_STAFF_BANK_INFO">

    - <xsd:complexType>

    - <xsd:sequence>

    <xsd:element name="A_STAFF_ID" type="xsd:string" />

    </xsd:sequence>

    </xsd:complexType>

    </xsd:element>

    - <xsd:element name="Z_RFC_GET_STAFF_BANK_INFOResponse">

    - <xsd:complexType>

    - <xsd:sequence>

    <xsd:element name="L_BANK_ACC" type="xsd:string" />

    <xsd:element name="L_BANK_ACC_HOLDER" type="xsd:string" />

    <xsd:element name="L_BANK_NAME" type="xsd:string" />

    </xsd:sequence>

    </xsd:complexType>

    </xsd:element>

    </xsd:schema>

    </wsdl:types>

    - <wsdl:message name="Z_RFC_GET_STAFF_BANK_INFO">

    <wsdl:part name="parameters" element="tns:Z_RFC_GET_STAFF_BANK_INFO" />

    </wsdl:message>

    - <wsdl:message name="Z_RFC_GET_STAFF_BANK_INFOResponse">

    <wsdl:part name="parameter" element="tns:Z_RFC_GET_STAFF_BANK_INFOResponse" />

    </wsdl:message>

    - <wsdl:portType name="ZWS_ALC_GET_STAFF_BANK_INFO">

    - <wsp:Policy>

    <wsp:PolicyReference URI="#IF_ZWS_ALC_GET_STAFF_BANK_INFO" />

    </wsp:Policy>

    - <wsdl:operation name="Z_RFC_GET_STAFF_BANK_INFO">

    - <wsp:Policy>

    <wsp:PolicyReference URI="#OP_Z_RFC_GET_STAFF_BANK_INFO" />

    </wsp:Policy>

    <wsdl:input message="tns:Z_RFC_GET_STAFF_BANK_INFO" />

    <wsdl:output message="tns:Z_RFC_GET_STAFF_BANK_INFOResponse" />

    </wsdl:operation>

    </wsdl:portType>

    - <wsdl:binding name="ZWS_ALC_GET_STAFF_BANK_INFO" type="tns:ZWS_ALC_GET_STAFF_BANK_INFO">

    - <wsp:Policy>

    <wsp:PolicyReference URI="#BN_ZWS_ALC_GET_STAFF_BANK_INFO" />

    </wsp:Policy>

    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />

    - <wsdl:operation name="Z_RFC_GET_STAFF_BANK_INFO">

    <soap:operation soapAction="" style="document" />

    - <wsdl:input>

    <soap:body use="literal" />

    </wsdl:input>

    - <wsdl:output>

    <soap:body use="literal" />

    </wsdl:output>

    </wsdl:operation>

    </wsdl:binding>

    - <wsdl:service name="service">

    - <wsdl:port name="ZWS_ALC_GET_STAFF_BANK_INFO" binding="tns:ZWS_ALC_GET_STAFF_BANK_INFO">

    <soap:address location="http://xxxxxxx.xxxxxxx.com:8000/sap/bc/srt/rfc/sap/zws_alc_get_staff_b ank_info/300/zws_alc_get_staff_bank_info/zws_alc_get_staff_bank_info" />

    </wsdl:port>

    </wsdl:service>

    </wsdl:definitions>

     

     

     

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points