Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOAP Address

Not applicable
Hi,



I have two LCES servers, one for development, the other Production.

Client environment is Reader 8.



On my form, I have a WSDL data connection, the URL is like this:

http://development:8080/soap/services/name?WSDL

The Invoke Button is set as "Run at Server".



but when I move this form to Production, I want it to call the "name" Web Servie that's running on the production server.



How do I dynamically set the SOAP Address such that it can call the right Web Service on the right server?



thank you

p
16 Replies
pguerett
Level 10
Level 10
You can modify the Data Connection properties when you publish the form to point to the right server.
Not applicable
How do I do that?



you mean I have to create a new version of the form in WorkBench for each server?



thanks
pguerett
Level 10
Level 10
You could do that or when you move from dev to production open the form, right click on the data connection, look at its properties and update the WSDL address. Now save your form and it will go against the prod environment.
Not applicable
But if you do that, the form will no longer work on the development server, you will get the "Error attempting to read from file..." error message.



Is there a way to dynamically set the correct soap address without modifying the form at all?
pguerett
Level 10
Level 10
You can programmatically set the address but something has to tell the program which server you want to connect to. Do you have a flag or something on the form for this?
Not applicable
I was planning on doing this:



in a table in our database, it stores the server IP. in the development database, it stores development server's IP; in the production database, it stores production server's IP.



so, I thought I could make a query at the Render form service, and get that IP and put it in a hidden field on the form. Then, at the time the form is loaded, I can use a line of script to set the soapAddress like this:



xfa.connectionSet.myDataConnection.soapAddress.value = IPfield.rawvalue + "/soap/services/myWSname";



But it did not work, the above line of script never got executed for some reason, I don't know why... is it because I am in Reader and that script only works in a Reader-extended form?????
pguerett
Level 10
Level 10
That technique is OK ...what event do you have the script on? Put it on a button so you can see the execution and ensure that IPField is filled. Once you know the code is good put it on the Form Ready event.



Also make the target version of the form something less than 8.0 or else it will not allow you to change that setting (File/Form Properties/Defaults).
Not applicable
I just tried it again. I put it in the ready:form event, and set traget version to 6.



It worked fine when I have Acrobat Pro running. But it failed when I used Reader 8.1.2 !
pguerett
Level 10
Level 10
Makes sense ....you must Reader Extend the form to allow Web Services for Reader. This right can only be applied by LiveCycle Reader Extensions.
Not applicable
I have been told that to make Web Services calls from Client side, I'll need to Reader Extend my forms. But I don't need to Reader-extend the form when I call the Web Service Server-side.



We don't have money to buy Reader Extensions, thus we are trying to use Server-side Web Service calls.



So you are telling me that I can't programmatically set my SOAP address in my no-Reader-Extensions environment? why Adobe sets up all these little traps to "gotcha" ???
pguerett
Level 10
Level 10
Setting the soap address is no problem ....executing it is the issue. If you run it server side you should it will react the sam eway whether it is Acrobat or Reader. All I am saying is that to execute the web service client side in Reader you need Reader Extensions.
Not applicable
but I can't set the soap address with Reader.



this line of code fails:

xfa.connectionSet.myDataConnection.soapAddress.value = IPfield.rawvalue + "/soap/services/myWSname";
pguerett
Level 10
Level 10
I just tried it and as soon as I reader extend the form the code starts working.



Are you getting an error or does nothing happen.
Not applicable
as I said, I don't have Reader Extensions, I can't Reader-extend my form.



does that line of code work for you if you don't Reader-extend the form?



setting the SOAP address is a problem for me in an environment that does NOT have Reader Extensions.



Am I understanding you correctly, that this technique can only work after the form is Reader Extended???



If so, is there another way to make it work for a form that's not Reader-extended?



to answer your question:

I have some other lines of script after that soapAddress line, and those lines of scripts never got executed, the execution terminated at the soapAddress line. and I didn't get any error message, it just terminated.
pguerett
Level 10
Level 10
The line of code does not work if you do not have Reader extensions and here is why.



When you create a soap connection the information for that connection is stored in the DOM under connectionSet. If you run this in Reader it will not allow you to create a conectionSet (unless you Reader Extend). So the script is failing because connectionSet does not exist and the failure halts execution of the script. So...the Reader extensions does not allow the script to run but it allows the creation of the connectionSet which in turn is referenced by your script.



There is no other way to make a client side soap call without Reader Extending.



In summary, the Reader Extensions is for the ability to allow Soap to run not to allow your scripts to execute.
Not applicable
that's toooooo bad. but thanks for explaination.