Expand my Community achievements bar.

SOLVED

Acessing WebService

Avatar

Level 2

How can i connect to a webservice, and execute a method?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Here is one way of doing the things..

First you need to create a Data connection using the Webservice URL. Then bound the input arguments to fields inside the form. Bound the Response value also to a field. And then follow the below steps.

//Below two lines I am assigning value to the TextFields which I bound to the Webservice input argument.

STSTripInfo.Page1.Subform13.element.rawValue = xfa.data.saveXML();

//Here I am passing the Webservice URL to the Connection..
xfa.connectionSet.SubmitWebService.soapAction.value = STSTripInfo.Page1.Subform13.txtSubmitURL.rawValue;

//Executing the webservice

xfa.connectionSet.SubmitWebService.execute(0);

//Capturing the returned value from Webservice. VAR_String was earlier bound to the Response tag of the Webservice call.
xfa.data.loadXML(STSTripInfo.Page1.Subform13.VAR_String.rawValue);

Hope this gives an idea..

Thanks

Srini

View solution in original post

5 Replies

Avatar

Former Community Member

In the Data Services view you can attach to a wsdl and then bind the inputs and outputs from the service to th efields on your form.

Paul

Avatar

Level 2

I need a way to access a method, using only code!


Avatar

Former Community Member

Look at the Acrobat Javascripting reference ...there is a SOAP object and there are lots of examples on how to do this.

Paul

Avatar

Level 2

I still can't understand, i will re-explain!

I have a web service in a iis server, which i need to access.

I have to use code, so that i can manipulate the data returned to me by a method in the webservice.

Thanks in advance!

Avatar

Correct answer by
Level 10

Here is one way of doing the things..

First you need to create a Data connection using the Webservice URL. Then bound the input arguments to fields inside the form. Bound the Response value also to a field. And then follow the below steps.

//Below two lines I am assigning value to the TextFields which I bound to the Webservice input argument.

STSTripInfo.Page1.Subform13.element.rawValue = xfa.data.saveXML();

//Here I am passing the Webservice URL to the Connection..
xfa.connectionSet.SubmitWebService.soapAction.value = STSTripInfo.Page1.Subform13.txtSubmitURL.rawValue;

//Executing the webservice

xfa.connectionSet.SubmitWebService.execute(0);

//Capturing the returned value from Webservice. VAR_String was earlier bound to the Response tag of the Webservice call.
xfa.data.loadXML(STSTripInfo.Page1.Subform13.VAR_String.rawValue);

Hope this gives an idea..

Thanks

Srini