Expand my Community achievements bar.

XDP - connection - changing WSDL url

Avatar

Level 2

Hello all !!!


I have application (Livecycle Porcess) with UI forms in XDP format.

On some forms connection to service (web service) is required.

I noteced that url pointing to WSDL in hardcoded (in XDP file)

<connectionSet xmlns="http://www.xfa.org/schema/xfa-connection-set/2.8/">
   <xsdConnection name="DataConnection" dataDescription="form1">
      <uri>MY_XSD</uri>
      <rootElement>form1</rootElement>
      <?templateDesigner fileDigest shaHash="mDqQnS47+hG+P00fF7FVHBwQN4c="?></xsdConnection>
   <wsdlConnection name="SearchService" dataDescription="SearchService">
      <soapAddress>MY_URL</soapAddress>
      <wsdlAddress>MY_URL?wsdl</wsdlAddress>
      <soapAction>invoke</soapAction>
      <operation input="invokeRequest" output="invokeResponse">invoke</operation>
      <?templateDesigner fileDigest shaHash="gAauLB0WfzbFy4vlCvQCne8JCiw="?></wsdlConnection>
</connectionSet>

I want to change url to WSDL on every deployment (I have to deploy appication on several environments) without opening Designer and clicking Connection Properties etc.

I try to change in manually (using XML editor) - but deployment fails - probably shaHash value is invalid.


I also tried to calculate SHA-1 for my WSDL file but also no luck on deployment.

My question:

is there any posibility to change WSDL url without openinig LC Designer (maybe configuration variable with url) in XDP?

How to calculate sha "templateDesigner fileDigest shaHash"?

6 Replies

Avatar

Former Community Member

You can change the address but you cannot change it programmatically because of security issues in Acrobat/Reader. You can clone the connection and then chnage the cloned version and then call the cloned version of the data connection. Here is the code that 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 = "new WSDL address";

app.alert(oCS.soapAddress.value);

oCS.execute(0);

Hope that helps

Paul

Avatar

Level 2

Thanks for anwser,

but that solution does not help me to sove my probelm.


Maybe I do not understand it

I have a Form1.xdp

There is web service call inside that form, so wsdl url is in XDP file content.

Developer set url to <DEVELOPMENT_WSDL_URL>

Now I have to deploy whole application to ohter server setting web service url to <QA_WSDL_URL>.

I want to write a script to alter XDP files (they are xmls) and build a package for QA.

As I understand I have to edit (with  Designer) all XDP forms that use  <DEVELOPMENT_WSDL_URL> and edit data connection settings (changing WSDL url to new one).

Am  I right?

LC Designer can change this url (Designer probably calculates SHA-1 - but I don't now what is source data for digest?) so there must be some kind of way to do that. As I mentioned before after changing WSDL url Designer calculate shaHash and saves it in XDP like this

<?templateDesigner fileDigest shaHash="gAauLB0WfzbXy4vlCvQCne8JCiw="?></wsdlConnection>

Can anyone tell me how to calculate this value (This is probably BASE64 from SHA-1 digest - I checked this is not WSDL file digest)?

Avatar

Former Community Member

My solution allows you to add code to the form to do it when the form renders .....you are trying to change the XDP before it is made into

a PDF ...don't think you will be able to decrypt that value then encrypt with the same key.

Paul

Avatar

Level 2

So this solution is for runtime.

so it is usless for me - right ?.

I have three different environments (3 different servers) and I have to deploy application on those 3 servers.


So If I change url in runtime I must determinate on which server application is running.

An I have to hardcode 3 urls in every form ...

Is there any way to get current url - from which pdf is hosted ?

Avatar

Former Community Member

Yes you can use:

event.target.URL

to return the URL that the form was loaded form.

Paul

Avatar

Level 1

@

> Can anyone tell me how to calculate this value (This is probably BASE64 from SHA-1 digest - I checked this is not WSDL file digest)?

Did you ever find a solution for this?