Expand my Community achievements bar.

SOLVED

fill hidden field with xml - Web service call

Avatar

Level 3

Hi everyone,

I have a developed a web service, my web service method expects an xml string.

I have a new data connection, which is my wsdl file...

Now my challenge is how do I populate that field with my form's xml,so that my my method can manupulate it.

Secondly, I would like the same button that calls my web service to email the form once the web service has been called, email the form as PDF.

Will really appreciate your assistance.

Ace

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can use the below command to populate a field with the form's XML.

    

     FieldName.rawValue = xfa.data.saveXML("pretty");

To execute the webservice and then send an email,

     1. First place Execute button binding to the Webservice and make it either invisible/ hidden

     2. Place a normal button on the form and in the click event write code to call the webservice and then send the email.

          //Call the webservice button click event

          WebserviceExecuteButton.execEvent("click");

    

          //Send an email

          event.target.submitForm({cURL:"mailto:"+ strToAddress + "?subject=" + strSubject + "&body=" + strMessage,cSubmitAs:"PDF",cCharset:"utf-8"});

     Replace the names with the variables in your form in the above line.

Thanks

Srini

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

You can use the below command to populate a field with the form's XML.

    

     FieldName.rawValue = xfa.data.saveXML("pretty");

To execute the webservice and then send an email,

     1. First place Execute button binding to the Webservice and make it either invisible/ hidden

     2. Place a normal button on the form and in the click event write code to call the webservice and then send the email.

          //Call the webservice button click event

          WebserviceExecuteButton.execEvent("click");

    

          //Send an email

          event.target.submitForm({cURL:"mailto:"+ strToAddress + "?subject=" + strSubject + "&body=" + strMessage,cSubmitAs:"PDF",cCharset:"utf-8"});

     Replace the names with the variables in your form in the above line.

Thanks

Srini

Avatar

Level 3

Hi Srini,

I was starting to think what I was asking was impossible.

It works perfectly, just the way I wanted :-)

Thanks a lot Srini, you saved me. Thank you