Expand my Community achievements bar.

Can I alter soapAddress using script before making a web service connection

Avatar

Level 3

Originally I set up a data connection on Data View using a local wsdl file.

I found following codes on the XML source:

<connectionSet xmlns="http://www.xfa.org/schema/xfa-connection-set/2.1/">
   <?originalXFAVersion http://www.xfa.org/schema/xfa-connection-set/2.1/?>
   <wsdlConnection name="WebServiceDC" dataDescription="WebServiceDCgetAddressXMLDD">
      <soapAddress>https://myURL/myWebServiceFunction</soapAddress>
      <wsdlAddress>.\myWebServiceFunction.wsdl</wsdlAddress>
      <soapAction/>
      <operation input="getAddressXMLRequest" output="getAddressXMLResponse">getAddressXML</operation>
      <?templateDesigner fileDigest shaHash="uKcwzAn9YOsLHWypIz9ycuoeBPE="?></wsdlConnection>
</connectionSet>

Does it mean that if I use the form on another machine, I need to place the same file myWebServiceFunction.wsdl on the exact location of the form as well?

Another question:

How about I set up a data connection on Data View using a wsdl file from web.

Then is it possible to change the <soapAddress> from script to alter the connection before I issue:

xfa.connectionSet.WebServiceDC.execute(false);

I need to do this because the wsdl's soapAddress point to another endpoint that I need to change.

Or should I write script at all to make the data connection?

Rgds.

7 Replies

Avatar

Level 3

Extra info for my question,

Actually I need to modify the Web Service URL before execute the connection which had previously specified on the wsd file,

does it mean the soapAddress?

Rgds.

Avatar

Level 3

Just find from the forum that it cannot be altered but need to be cloned first:

var oCS = xfa.connectionSet.WebServiceDC.clone(1);
oCS.soapAddress.value = "http://pgdell:8080/soap/services/WebServiceTest";

oCS.execute(0);

But I have a question, how can I access the data returned from the cloned connection oCS?

Originally in the postExecute event of WSResponsePreProc :

var rootXml = null;
var soapFault = null;
if (xfa.event.soapFaultCode)
     soapFault = {code:xfa.event.soapFaultCode, message:xfa.event.soapFaultString};
else
     rootXml = xfa.datasets.connectionData.WebServiceDC.Body;               <=========  how can I refer to the cloned oCS  ??

preProcessor.processResponse(rootXml, soapFault);

Rgds.

Avatar

Level 4

Hi

Anybody found an anwser to this problem:

<=========  how can I refer to the cloned oCS  ??

EDIT:

I found out that it is working just fine, only showing a messageBox does not work here.

I now placed a console.println("') script and this works perfect.

Regards

Rony