Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

SOAP Address

Avatar

Former Community Member
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

Avatar

Former Community Member
You can modify the Data Connection properties when you publish the form to point to the right server.

Avatar

Former Community Member
How do I do that?



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



thanks

Avatar

Former Community Member
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.

Avatar

Former Community Member
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?

Avatar

Former Community Member
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?

Avatar

Former Community Member
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?????

Avatar

Former Community Member
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).

Avatar

Former Community Member
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 !

Avatar

Former Community Member
Makes sense ....you must Reader Extend the form to allow Web Services for Reader. This right can only be applied by LiveCycle Reader Extensions.

Avatar

Former Community Member
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" ???

Avatar

Former Community Member
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.

Avatar

Former Community Member
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";

Avatar

Former Community Member
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.

Avatar

Former Community Member
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.

Avatar

Former Community Member
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.

Avatar

Former Community Member
that's toooooo bad. but thanks for explaination.