How to make web service in xdp file working in HTML form after conversion | Adobe Higher Education
Skip to main content
Level 2
June 11, 2021
Beantwoord

How to make web service in xdp file working in HTML form after conversion

  • June 11, 2021
  • 1 reactie
  • 1245 Bekeken

Hello there,

How to make web service in xdp file work after the xdp file is converted to HTML form? 

For example, the xdp contains javascripts (or use ConnectionSet) to call web service

form1.#subform[0].Button1::click - (JavaScript, server)

      var countryTextField = "AFK";

      var cURL = "http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL";
      SOAP.wireDump = false;
      var service = SOAP.connect(cURL);
      var Input = {sCountryISOCode:countryTextField};
      var result = service.FullCountryInfo(Input);
      tfCurrency.rawValue = result.sCurrencyISOCode;
      tfCapital.rawValue = result.sCapitalCity;

 

Is there any way make the web service working in previewHTML or HTML form converted from xdp?

Please suggest.

Thanks in advance.

Harry

 

 

Er kunnen geen reacties meer worden geplaatst op dit onderwerp.
Beste antwoord door Pulkit_Jain_

@harry2ca 

xfa.connectionSet won't work in this case, if rendered at client but you can make a web service call if the script is rendered at server. Yes, if the requirement is to run the script at the client, then you can make an Ajax call to the webservice as below:

 

if (typeof(xfa.connectionSet)=="undefined") { var data = new FormData(); var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange=function() { //Custom logic// } }; xhttp.open("POST", http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL, true); xhttp.send(data); } else { xfa.connectionSet.LookupUser.execute(0); }

 

Hope that helps!

1 reactie

Pulkit_Jain_
Adobe Employee
Pulkit_Jain_Adobe EmployeeAntwoord
Adobe Employee
June 17, 2021

@harry2ca 

xfa.connectionSet won't work in this case, if rendered at client but you can make a web service call if the script is rendered at server. Yes, if the requirement is to run the script at the client, then you can make an Ajax call to the webservice as below:

 

if (typeof(xfa.connectionSet)=="undefined") { var data = new FormData(); var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange=function() { //Custom logic// } }; xhttp.open("POST", http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL, true); xhttp.send(data); } else { xfa.connectionSet.LookupUser.execute(0); }

 

Hope that helps!

harry2caAuteur
Level 2
June 21, 2021
I couldn't make POST work. I hope to call the FullCountryInfo to get the CountryName from CountryISOCode "AFK". How to pass parameter to a method? Could you provide more details of the code?