Expand my Community achievements bar.

Using Web Service from LiveCycle PDF Dynamic Form.

Avatar

Level 8
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.

25 Replies

Avatar

Level 8

I found out that I can use Acrobat Javascript object "identity" to get the Login Name "identity.loginName", but the main problem here is that more work is needed to deploy the form using this command, becuase:

1. The function must be called from a Priviliged context (Trusted Function), which is a Folder Level Script. This means I have to deploy the script for more than 1000 users. Also, if a user is smart, he will be able to hard-code the User ID inside the script, and we have a big problem here.

or

2. Make the PDF Certified, and ask every user to trust the certificate. Also this has to be done on every PC.

Both solutions above are not pratical.

Any suggestions how to automatically detect the User ID of the currently logged in user ?

Note: I am not convinced that I cannot use the "identity.loginName" directly inside the form using JavaScript ? As a matter of fact, putting this function in a folder level script is more risky, becusae the user can change it .

Tarek.

Avatar

Level 10

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

Avatar

Level 8

Thanks Niall,

Ok, so identity object is not the way to go. I will look for something else. I have some ideas and working on them.

Regarding the Web Service, how I can invoke the web service if it requires authentication ? The first time the web service is invoked, I get a prompt to enter User Name and Password. How I can pass the user name/password when the button is clicked ?

I am testing this using SOAP object under Javascript Console Window, because I think I can use to to pass the credentials.

I tried this in the console window:

console.println;

var service=SOAP.connect("http://www.w3schools.com/webservices/tempconvert.asmx?wsdl");
for (var i in service) console.println(i);

and I am getting output, so it is working, however, when I replace the web service URL with one which is located on a local server inside our domain network, the call to SAOP.connect(...) will always return "undefined".

Why I am unable to invoke call to SOAP if the URL is located inside our work domain network ?

Tarek.

Avatar

Level 10

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

Avatar

Level 8

Do you know how to pass credentials for the Web Service which is a DataConnection under LiveCycle ES Form (XFA) ?

Now, I am trying to pass credentials using SOAP.request call.

I have tried the following:

var cURL = "http://www.mssoapinterop.org/asmx/simple.asmx?wsdl";
var cTestString = "This is my test string";
// Call the echoString SOAP method -- it is an RPC Encoded method
var response = SOAP.request({
  cURL: cURL,
  oRequest: {"http://soapinterop.org/:echoString": {inputString: cTestString}},
  cAction: "http://soapinterop.org/"
});
var result =
response["http://soapinterop.org/:echoStringResponse"]["return"];
// This should be the same as cTestString
console.println(result + " == " + cTestString);

and ... it is working ... now, I will move on to passing the Authentication Parameters.

Do you know a public web service that requires credentials for testing ? Becuase I am unable to test against local web services

Tarek.

Avatar

Level 8

I was able to use SOPA.request with Authentication, following is a sample code:

/* Get the following from WSDL File */
var webServiceEndPoint = "http://xyz:8000/sap/hr004/ehrmdservice";
var personalInfoKey = "PersonalInfo"
var personalInfoResponse = "urn:sap-com:document:sap:soap:functions:mc-style:GetPersonalInfoResponse";
/* define web service input parameters */
var staffIDInput = "310322";
/* define Web Service Authentication */
var oAuthenticator =
  {
    Username: "user",
    Password: "pwd"
  };

/* oRequest is: "TargetNamespace:Operation" from WSDL */

/* cAction is: "TargetNamespace" from WSDL */
var response = SOAP.request(
  {
    cURL: webServiceEndPoint,
    oRequest: {"urn:sap-com:document:sap:soap:functions:mc-style:GetPersonalInfo":
      {StaffId: staffIDInput}},
    cAction: "urn:sap-com:document:sap:soap:functions:mc-style",
    oAuthenticate: oAuthenticator
  }
);
console.println;
var personalInfo = response[personalInfoResponse][personalInfoKey];
for (var i in personalInfo) console.println(i + " = " + personalInfo[i]);

It is confrmed that the above code is woking.

I have now 2 problems:

1. Why I cannot execute SOAP apis over a local URL ?

2. How I can replace the LiveCycle Web Service Data Connection with the call to the SOAP api calls so that I can pass the credentials ?

Tarek.

Avatar

Level 8

I am posting again to clarify my requirement, hoping I can get help.

Seems that no much luck with SOAP.connect() nor with Web Service Data Connection, looks like they are still under development, or limited, and that is why I cannot pass credentials easiliy or have better control using SOAP object.

I have made some progress.

I have attached the web service to the PDF, executed the web service and the data was bound successfully inside the PDF.

But, this is not practical, becuase PDF is calling the Web Service from the Client. I need to make it a server based operation, so that I can identify the Windows Logged In User, perform Authorization, and pass the required credentials to the Web Service. Such operations cannot be done under PDF XFA Form, right ?

I have an idea, but I need help.

After executing the Data Connection Web Service Method from Adobe LoveCycle Form (XFA), I have exported the resultant Form Data from the PDF into XML file (which was returned by the web service call), and the XML looks something like the following:


<form1>
<Body>
<GetMonthlyAttendanceReport>
<Period>201007</Period>
<StaffId>310332</StaffId>
<UseHijri>0</UseHijri>
<WithOthers>0</WithOthers>
</GetMonthlyAttendanceReport>
</Body>
<Body>
<sfStaffList>
<sfStaffItem>
<StaffId>00310332</StaffId>
<StaffName>TIME MGMT TEST for Overtime</StaffName>
<Department>Human Resource Department</Department>
<sfAttendances>
<sfAttendancesItem>
<Date>13.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>14.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>15.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>16.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>17.06.2010</Date>
<Status>Non working day</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>18.06.2010</Date>
<Status>Non working day</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>19.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>20.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>21.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>22.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>23.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>24.06.2010</Date>
<Status>Non working day</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>25.06.2010</Date>
<Status>Non working day</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>26.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>27.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>28.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>29.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>30.06.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>01.07.2010</Date>
<Status>Regular</Status>
<TimeIn>08:30a</TimeIn>
<TimeOut>04:39p</TimeOut>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>02.07.2010</Date>
<Status>Irregular / Missing clock</Status>
<TimeIn>08:45a</TimeIn>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>03.07.2010</Date>
<Status>Regular</Status>
<TimeIn>08:10a</TimeIn>
<TimeOut>04:45p</TimeOut>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>04.07.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>05.07.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>06.07.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>07.07.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>08.07.2010</Date>
<Status>Non working day</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>09.07.2010</Date>
<Status>Non working day</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>10.07.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>11.07.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
<sfAttendancesItem>
<Date>12.07.2010</Date>
<Status>Full day absense</Status>
<TimeIn/>
<TimeOut/>
<sfTimeEvents xfa:dataNode="dataGroup"/>
</sfAttendancesItem>
</sfAttendances>
</sfStaffItem>
</sfStaffList>
</Body>
</form1>

Then, I have opened an empty PDF Form, and imported back the above XML into the empty form (Template) and I got the same result like calling the web service.

The above XML Strucutre is matching the structure defined in the WSDL. So I think if I can call the web service using ASP.NET, and convert it to XML, then I will get same or close result, right ?

My plan, is to call the web service using ASP.NET (server side), convert the result to XML, so it looks like the structure above, or as close as possible, and finally, I will simply attach the XML to an empty PDF Form (Template) using XDP format, and using "response.write()" I can generate the final PDF under IE on the Client.

The simple question here is:

How to convert the Web Service Call Result to XML String (not XML Document), so that I can manipulate it to make it look like the above structure ?

Tarek.

Avatar

Former Community Member

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

Avatar

Level 8

I have developed a Web Service that will get the User ID of the currently logged in user. It is working fine.

Also, I can develop a Web Service Wrapper in ASP.NET to call the SAP Web Service. So, in the Web Service Wrapper, I will do all logic which requires Windows Based Authentication and other authorization logic, and finally call the SAP Web Service, and return the results back as usual.

I can see your idea about binding the full XML String to a hidden field, which I think it will work. But, I still do not know how to convert the result of the web service call to XML String. I am still working on that.

Could you please explain to me why it is a security concern to allow the client program to get the Windows Login ID ?

Don't you think that if you allow the user to write his own script (Folder Level Script) to get the Login ID, then it is of a higher risk ?

This reminds of the story of the mouse, the cat and the elephant .

Thank you for your feedback.

Tarek.

Avatar

Former Community Member

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

Avatar

Level 1

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.

Avatar

Level 8

Hi eindog,

I am not sure I understand what you want.

Why do you want to get a copy of my WSDL ? I am afraind I cannot post it due to privacy reasons.

There are many public web services that you can try. See this as an example:

http://www.w3schools.com/webservices/ws_example.asp

Also try:

http://www.whitemesa.com/interop.htm  then http://www.mssoapinterop.org/asmx/simple.asmx?wsdl

If you have a specific issue, please let me know, may be I can help.

In any case, any one who is interested, I have managed to develop a middle layer using Web Service in .NET to perform Integrated Windows Authentication and Authorization without any annoying prompt.

In short, I am using Native XFA Data Source Connection over a WSDL File. SOAP.connect() did not work for me due to the reasons I mentioned earlier.

Tarek.

Avatar

Level 1

Hello Tarek,

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

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

Avatar

Level 8

Ok, I see your point, I will get back to you soon on this.

Tarek.

Avatar

Level 8

I know it is difficult, but here are the parts of the WSDL where I got the key values from:

- <xsd:element name="GetPersonalInfoResponse">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="PersonalInfo" type="tns:ZbcpiSEhrmdPersonalInfo" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

The ="urn:sap-com:document:sap:soap:functions:mc-style" is the TargetNameSpace:

- <wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" 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:soap:functions:mc-style" xmlns:n1="urn:sap-com:document:sap:rfc:functions">

The "GetPersonalInfoResponse"  is the name of the operation:

- <xsd:element name="GetPersonalInfo">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="StaffId" type="n0:char8" />
<xsd:element name="UseHijri" type="n0:boolean" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
- <xsd:element name="GetPersonalInfoResponse">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="PersonalInfo" type="tns:ZbcpiSEhrmdPersonalInfo" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

I got it from this document "Developing Acrobat® Applications Using JavaScript™ / Adobe Acrobat SDK version 8.0 November 2006"

I hope this will be of help to you.

Can you tell if you are able to use SOAP.connect()/SOAP.request() to invoke a web service on a local IIS Server in the same domain of your machine ?

Tarek.

Avatar

Level 1

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

Avatar

Level 8

Just confirmed the reason why SOAP.connect() not working for a local web service hosted under IIS.

This is beuase the web service virtual folder was configured to use Integrated Windows Authentication. It seems that SOAP.connect() does not support this.

I am happy that WSDL Connection does support Integrated Windows Authentication.

Tarek.

Avatar

Level 8

I spent quite some time trying to understand how to call web service from PDF. I like to share my findings with others.

The correct way for calling the web service which is Document/Literal based (not RPC), is the following method.

Use this script as a guid:


console.println("");
var myRequest = {Celsius: "50"};
var service = SOAP.connect( "http://www.w3schools.com/webservices/tempconvert.asmx?WSDL")
var response = service.CelsiusToFahrenheit(myRequest);
console.println("value = " + response);

And if you want to use SOAP.request(), this is the way:

var myRequest = {};
myRequest["CelsiusToFahrenheit"] = {Celsius: 50};
var response = SOAP.request({
cURL: "http://www.w3schools.com/webservices/tempconvert.asmx?WSDL",
oRequest: myRequest,
bEncoded: false,
cAction: "http://tempuri.org/CelsiusToFahrenheit",
cNamespace: "http://tempuri.org/",
cResponseStyle: SOAPMessageStyle.Message
});
var value = response[0].soapValue[0].soapValue;
console.println("value = " + value);

The WSDL part that indicates it is a Document/Literal is as follows:

- <wsdl:operation name="CelsiusToFahrenheit">
  <soap:operation soapAction="http://tempuri.org/CelsiusToFahrenheit" style="document" />
- <wsdl:input>
  <soap:body use="literal" />
  </wsdl:input>
- <wsdl:output>
  <soap:body use="literal" />
  </wsdl:output>
  </wsdl:operation>

I hope this will be of help to others.

Tarek.

Avatar

Level 2

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-utility-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_bank_info/300/zws_alc_get_staff..." />

</wsdl:port>

</wsdl:service>

</wsdl:definitions>

Avatar

Level 8

Hi Jack,

I will do my best to help.

First tell me what happens when you call the web service ? Nothing ?

Try to print the result of the "response" variable, and if there is something, print all child nodes ...etc using:

for (var i in response) console.println(i + ", " + response[i]);

Also, confirm the type of the web service, RPC or Document/Literal ? Based on the type, you will have to use the right way to pass the request object, and then the right way to parse the response object.

Also, try to call the SAP web service using test .NET Console Application. Or try other ways to test the web service.

Can you tell me why do you want to use SOAP.request() instead of XFA WSDL Connection ?

Tarek.