on 05-20-2011 11:12 AM
Hello,
I would like to use a web service in my Interactive Form. Therefore, I created an RFC function module and created the corresponding web service. Then I launched SOAMANAGER to get the URL of the WSDL file, copy it, changed it a bit (removed the last part: "?sap-client=100", otherwise Adobe LiveCycle Designer would not accept it) and pasted into the "New Data Connection" dialog box in ALCD.
But this URL is system-dependent (begin with the development system hostname). So, once transported to other systems (integration, quality or production), it won't work anymore.
So, my first question is: how to make it system-independent?
My second question is: how to transport web services?
Thanks in advance.
Mathieu
Hi Mathieu,
You have to do the configuration for web service in every system you are transporting it to.
But from adobe form side you don't need to call it everytime.
Just create two dropdowns for system id and client in the form and modify your webservice url according to the selected client and system id.
For modifying and calling the web service you need to modify the code written on the button to call the web service in the form.
There pass the modified url while connecting to web service.
For more info on dynamic url generation go through the below link:
http://forums.adobe.com/thread/719890.
Transporting a web service is similar to any object transportation in SAP.
After transporting it to another system. You have to go through the process in SOAMANAGER to create the end-points for the web service.
Hope it will help a little bit.
Regards,
Vaibhav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Sorry for the late reply. It was tricky, but I finally found out how to make it system independant. It was really tricky to make it work fine, so here is the solution:
1) The Web Service URL will have to be an entry parameter of the Interactive PDF. You can generate it this way:
CONSTANTS: lc_http_protocol_id TYPE icmproto VALUE 1,
lc_web_service_name TYPE string VALUE 'my_web_service_name',
lc_http TYPE string VALUE 'http://',
lc_web_service_dir TYPE string VALUE 'sap/bc/srt/rfc/sap',
lc_sep TYPE c VALUE '/'.
CALL FUNCTION 'ICM_GET_INFO'
TABLES
servlist = lt_server_info.
LOOP AT lt_server_info INTO ls_server_info
WHERE active = abap_true
AND protocol = lc_http_protocol_id.
* AND hostname CS sy-host.
ENDLOOP.
IF sy-subrc EQ 0.
CONCATENATE lc_http ls_server_info-hostname ':' ls_server_info-service INTO lv_web_service_url.
CONCATENATE lv_web_service_url
lc_web_service_dir
lc_web_service_name
sy-mandt
lc_web_service_name
lc_web_service_name
INTO lv_web_service_url
SEPARATED BY lc_sep.
2) In the Interactive Form, use the following javascript code:
try {
var urlObject = xfa.record.WEB_SERVICE_URL;
var url = urlObject.value;
var request = {};
request["urn:sap-com:document:sap:soap:functions:mc-style:MyWebServiceMethod"] = {myParameter: 'My parameter value'};
var response = SOAP.request({
cURL: url,
oRequest: request,
cNamespace: "urn:sap-com:document:sap:soap:functions:mc-style"
});
// get the response values
xfa.record.MyValue.value = response["urn:sap-com:document:sap:soap:functions:mc-style:MyWebServiceMethod"]["MyResponseParameter"];
} catch (e) {
xfa.host.messageBox(e.toString());
}
hi Mathieu,
I have some question on the java code part.
I copy the code above and paste into the execute button event 'click' and run at 'client'.
replace 'WEB_SERVICE_URL' by the import parameter (lv_web_service_url from abap code above).
but the adobe form still point to same client (not client independent).
may I know what am I missing here?
Regards,
Lau
To add some more info to Hui's issue, (since I also have the same problem),
Even though a URL generted as described above is provided with in the Adobe form, it still points to the URL in the DataConenction - this can be seen in the XML view of the Adobe Form.
Does anybody have a solution for this?
I opened a message with SAP but did not hear back yet..
hi Candra,
I store the url in one of hidden field in form, then copy javascript below to click event, button control type: Regular.
just replace all the "<>" in the code below.
var message;
var response;
// The name of the data connection will be pulled from the WSDLConnection name in the ConnectionSet packet
var sWSDLName = <DataConnection name>;
// clone, modify and execute the connection.
var vConnection = xfa.connectionSet[sWSDLName].clone(true);
vConnection.soapAddress.value = <url>;
// Execute the connection, without remerge data after the result.
var ws_rc = vConnection.execute(true);
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.