Skip to main content

Hello,


I've created an Excel document to do date calculations. I'm using it via the REST API from an InfoPath form. InfoPath will make a GET request to a URL such as http://mysite.com/_vti_bin/ExcelRest.aspx/Workflow/ExcelCalculationWorkbooks/DaysOffCalculation.xlsx/model/Ranges('Result')?$format=atom&Ranges('StartDate')=4/25/2012&Ranges('EndDate')=4/27/2012 and the Excel service responds with XML containing the number of business days between the two dates. I'm currently connecting using a UDCX file. However, when I publish the form to production the data connections aren't properly updated to the new site. I've run into this in the past with List connections, and switched to SmartObjects instead. However there doesn't appear to be a way to connect to REST services through SmartObjects.


How can I use a SmartObject to connect to a RESTful service. Alternatively, is there another way to connect to a REST service that works well when publishing to multiple environments.

You are correct that when publishing the InfoPath form to a different environment the non SmartObject dataconnections UDCX are not automatically created in the new environment.


In the past I've had to manually recreate those UDCXs in the staging and production environments.  Normally I'd just copy the one from development and then manually edit the URL that its calling.  You'll also have to change the Infopath form so that it knows the new location of the UDCX. 


Its a pain but it worked.


Hope this helps.


Tim


Thanks Tim. I had tried copying the udcx files to production after testing, but there isn't an easy way to update the InfoPath form to use the new production server. I actually had to resort to extracting the InfoPath form into it's xml and xsl files, then manually edit the connections, which was slow and error prone.


Correct, now that you mention it I believe I also had to extract and recompile the InfoPath form.  As you mentioned it was slow and error prone although I don't know a better way.


I believe if you manually publish the Infopath form (not through K2, but from the Infopath publish wizard) it will detect that you're publishing to a different site and ask if you'd like to update all of the data connections to point to the new relative path.


There might be a prerequisite that it must have been manually published to the original dev site, however.


Yup:


http://sharepoint.stackexchange.com/questions/17383/infopath-change-publish-location


You're correct, and before I started using K2, that worked well for me. However, I've had trouble republishing a form once it's been in the k2 process, and even if it worked, I'd have to republish that extra time for every update.


Reply