Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

WebService and dynamic subform

Avatar

Former Community Member
Hi all!



I have this situation: i need to execute a call to a webservice, passing to

it the value that is contained in a dynamic generated field called

string[*]. I don't know how many strings I will pass to the webservice:

named it "i".

So I have to do multiple calls to the same webservice, more precisely i

calls to the webservice.

Value has to be inserted in dynamic subforms, that are generated i times,

after we received the value of "i".

But even if the value of the string[*] are correct, I received only one

answer that contains the value of the fields of the last string I passed.

In all the binded fields for each subform I can see the same values.



How can I do in order to obtain the correct value for each string?



Thanks,

Alessio
9 Replies

Avatar

Former Community Member
For something complex like this I think you'd be better off using Acrobat's SOAP object that a designer data connection to do the web service calls. That way your script would have the logic to make the calls with the string value from the appropriate subform instance and setting the return value to the field in the appropriate subform instance.



You can read more about using the SOAP object in the Acrobat JavaScript Reference.



http://partners.adobe.com/public/developer/pdf/topic_js.html



Chris

Adobe Enteprise Developer Support

Avatar

Former Community Member
<Chris_Trubiani@adobeforums.com> ha scritto nel messaggio <br />news:3bbfaf28.0@webcrossing.la2eafNXanI...<br />> For something complex like this I think you'd be better off using <br />> Acrobat's SOAP object that a designer data connection to do the web <br />> service calls. That way your script would have the logic to make the calls <br />> with the string value from the appropriate subform instance and setting <br />> the return value to the field in the appropriate subform instance.<br />><br />> You can read more about using the SOAP object in the Acrobat JavaScript <br />> Reference.<br />><br />> <a href=http://partners.adobe.com/public/developer/pdf/topic_js.html><br />><br />> Chris<br />> Adobe Enteprise Developer Support<br /><br />Hi Chris,<br />we have a web service in dotnet. Wen we call a method that doesn't require <br />parameters, the webservice answers well. On the contrary, when I call a <br />method that require a parameter, in the debug mode i can see that the value <br />passed is always "null". This is the script:<br /><br />SOAP.wireDump = false;<br />var cListURL = "http://192.168.1.16/forecast/Service1.asmx?WSDL";<br /><br /> var service = SOAP.connect(cListURL);<br /> var cTextString = "OK";<br /> var result = service.function1(cTextString);<br /> string.rawValue = result<br /><br />The function is done that it come back to me "1", but we have always "Empty" <br />because the data the webservice received is always "null".<br /><br />Please help me :)<br />Alessio

Avatar

Former Community Member
Alessio,



I'm not sure how to help you, I don't see anything wrong with the script. Your saying that the soap request sent to your webservice doesn't have a valid value for the parameter? Is it possible that your WSDL defines the method not to take parameters?



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
<Chris_Trubiani@adobeforums.com> ha scritto nel messaggio <br />news:3bbfaf28.2@webcrossing.la2eafNXanI...<br />> Alessio,<br />><br />> I'm not sure how to help you, I don't see anything wrong with the script. <br />> Your saying that the soap request sent to your webservice doesn't have a <br />> valid value for the parameter? Is it possible that your WSDL defines the <br />> method not to take parameters?<br />><br /><br />My WSDL take parameter.<br />The funny thing is that if I bind directly to the webservice (by drag the <br />webservice in the dataconnection to the button) it works, but I can't do <br />this with subform in the way I need.<br /><br />Another thing: also if i write directly the parameter in the script (i.e. <br />service.servicename("nameoftheparameter")) it doesn't work.<br />My script seems to work only for webservice without parameter (i.e. <br />service.servicename())<br /><br />Thanks for helping,<br />Alessio

Avatar

Former Community Member
Odd. What version of Acrobat are you using? I'll give it a try here as soon as I get a chance.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
<Chris_Trubiani@adobeforums.com> ha scritto nel messaggio <br />news:3bbfaf28.4@webcrossing.la2eafNXanI...<br />> Odd. What version of Acrobat are you using? I'll give it a try here as <br />> soon as I get a chance.<br />><br /><br />Acrobat Pro 7.0.3<br /><br />Bye,<br />Alessio

Avatar

Former Community Member
<Chris_Trubiani@adobeforums.com> ha scritto nel messaggio <br />news:3bbfaf28.4@webcrossing.la2eafNXanI...<br />> Odd. What version of Acrobat are you using? I'll give it a try here as <br />> soon as I get a chance.<br />><br />> Chris<br />> Adobe Enterprise Developer Support<br /><br />Sorry, on the test PC we are using 7.0.0<br /><br />Thanks,<br />Alessio

Avatar

Former Community Member
<Chris_Trubiani@adobeforums.com> ha scritto nel messaggio <br />news:3bbfaf28.4@webcrossing.la2eafNXanI...<br />> Odd. What version of Acrobat are you using? I'll give it a try here as <br />> soon as I get a chance.<br />><br />> Chris<br />> Adobe Enterprise Developer Support<br /><br />Maybe we understand part of the problem: in order to work with the data <br />connection (WSDL type) it has to be http post, while in order to work with <br />my script it has to do the call via SOAP protocol.<br />Now the problem is: I have to pass a lot of parameters via SOAP, how can I <br />bind all the values to their specific fields? I succedeed in making it works <br />only if I pass a string.<br /><br />Ciao,<br />Alessio

Avatar

Former Community Member
Hi Alessio,



If you need to pass in values for multiple fields as parameters to you webservice call, you could pass the rawValue of each field you are interested in as a paremeter.



Another idea would be to use xfa.data.saveXML(). This will return the data DOM as a string. You could then pass this 1 parameter to the webservice call and then on the server side parse the DOM for the field values you are interested in.



Chris

Adobe Enterprise Developer Support