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

SOLVED

Dynamically changing an existing dataconnection's server / port

Luigi__8_BIT_PL
Level 3
Level 3

Hi All,

Moving from one development environment to the next is sometimes a real pain.

Scenario:

- I have three environments: DEV, QA & PROD

- I have a livecycle designer pdf - FORM A - that has the following dataconnection: http://DEVserver:8080/....

- When I move FORM A from DEV to QA, i need to update the dataconnection to http://QAserver:8090/...

- When I move FORM A from QA to PROD, I need to update the dataconnection (again) to http://PRODserver:7890/...

1) this is a pain

2) this is a nightmare, when you have multiple dataconnections and many forms.

Proposed Solution, that I need input on.

The binding XML, will pass in the server name and required port number.

Then via code, I change the server & port of an existing dataconnection dynamically.

I tried:

WebserviceCallButton.event__click.submit.target = "http://" + vServer + ":" + vPort + vURLCall;

However, it does not allow the change.

Am I missing something?

ANY INPUT OR ALTERNATIVE IDEAS

Thanks alot in advance.

I thought of maybe a trying to wrap a dataconnection into a fragment... no luck!

1 Accepted Solution
pguerett
Correct answer by
Level 10
Level 10

Note that you do not want to cahnge the submit URL but the soapAddress......but that is protected too. The soapAddress is not a bindable property but you get get the value from a bound hidden field or you can get the address from the data dom yourself.

Either way the issue is with Acrobat security .....it will not allow you to modify the soap address on the fly. The dom which holds this information is protected (for security reasons). So we can clone it and use the cloned connection and change that address. Here is some code which does that:

//xfa.connectionSet.DataConnection.soapAddress.value

var

oCS = xfa.connectionSet.DataConnection.clone(1);

app.alert(oCS.soapAddress.value);

//app.alert(xfa.connectionSet.DataConnection.soapAddress.value)

oCS.soapAddress.value

= "http://pgdell:8080/soap/services/WebServiceTest";

app.alert(oCS.soapAddress.value);

oCS.execute(0);

Hope that helps

Paul

View solution in original post

3 Replies
pguerett
Correct answer by
Level 10
Level 10

Note that you do not want to cahnge the submit URL but the soapAddress......but that is protected too. The soapAddress is not a bindable property but you get get the value from a bound hidden field or you can get the address from the data dom yourself.

Either way the issue is with Acrobat security .....it will not allow you to modify the soap address on the fly. The dom which holds this information is protected (for security reasons). So we can clone it and use the cloned connection and change that address. Here is some code which does that:

//xfa.connectionSet.DataConnection.soapAddress.value

var

oCS = xfa.connectionSet.DataConnection.clone(1);

app.alert(oCS.soapAddress.value);

//app.alert(xfa.connectionSet.DataConnection.soapAddress.value)

oCS.soapAddress.value

= "http://pgdell:8080/soap/services/WebServiceTest";

app.alert(oCS.soapAddress.value);

oCS.execute(0);

Hope that helps

Paul

View solution in original post

Luigi__8_BIT_PL
Level 3
Level 3

legendry response...

makes sense why they wouldn't want one to change the "set" dataconnection.

thanks for this...

will try it on monday!

jeanetter358457
Level 2
Level 2

I am so new to adobe designer and just figuring things out.

Did this solution work for you and where did you place the script to do this?