SOAP Address

Avatar

22-10-2008

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

Replies

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

22-10-2008

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

Avatar

22-10-2008

How do I do that?



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



thanks

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

22-10-2008

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

22-10-2008

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

Avatar

pguerett

Avatar

pguerett

pguerett

23-10-2008

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

23-10-2008

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

Avatar

pguerett

Avatar

pguerett

pguerett

23-10-2008

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

23-10-2008

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

Avatar

pguerett

Avatar

pguerett

pguerett

23-10-2008

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