Creating an InfoPath SharePoint List connecting to a Web Service


In this blog posting, I will take you step by step on creating an InfoPath Form that connects to a web service stored on another server (normally causing cross-domain issues).

The business need:

  • SharePoint List – A SharePoint List to hold SoE documents (Separation of Employment)
  • Employee’s Location Drop Down Box – The employees have different locations, but there are many locations they work at.  So we need a drop down box for the Employee’s Location, but this has to come from a database, I chose to create a web service as a proxy.
  • Employee’s List Populated – Based on the employee’s location, the list of employees should populate.
  • Auto Staff ID filled Out – When the employee is selected, the Staff ID should be filled out.

Here is the final result. 

image

 

Web Service Methods:

image

I created an ASMX service because I knew for sure that it would be compatible with Microsoft InfoPath for sure.  I didn’t want to create a WCF service that did this just to find out it didn’t work with InfoPath.

 

Rules:

  • When the form loads, the employee’s locations are populated using GetLocations in the web service
  • When the user selects the employee’s Location, the list of employee’s drop down box populates.
  • when the employee is selected, then the employee ID is filled out.
    Steps:
    First, you must select your web service after it has been deployed.

image

Next, convert all of your web service to a SharePoint connections library.  This will deploy all of your connections and allow your InfoPath to use it directly.

image

Now, you must ensure that cross domain settings are turned to allow in InfoPath Form Services.  In Central Admin, go to General Application Settings, then Configure InfoPath Form Services…

image

Next, turn on Allow for Cross-Domain Access for the User Form Templates, this enables you to use a separate server for the web service.

image

To enable rules, you will need to right click on one of your controls, then select Rules and Manage Rules…

image

For the first field, Employee’s Location, you will have to set up rules so once it is selected your InfoPath form performs an action, and that is to:

  1. Set the GetEmployeesNameByLocation location field to the selected Employees Location field
  2.              image   

                 image

  3. Perform the query on GetEmployeesNameByLocation
  4.               image

      Now, your rules should look like this:

    image

    And by this time your Employee’s drop down should be populated.

     

    I will not take you through the rest of the examples to get to this point, but please let me know if you have questions, I can fill out more to my blog if questions arise.

     

    Bill.

    Categories: SharePoint or Custom Development | 2 Comments

    Post navigation

    2 thoughts on “Creating an InfoPath SharePoint List connecting to a Web Service

    1. Good post. I learn something new and challenging
      on blogs I stumbleupon every day. It’s always interesting to read through articles from other writers and use a little something from other websites.

    2. Och om du är en professionell spelare, ju mer du tweet, desto större möjlighet till direkt kontakt med de
      riktiga dealers. När dessa tre symboler radas upp, kommer du inte ha ett
      konto hos Omni Casino just nu. I detta free spins spelet, desto
      fler spins som genomförs på en snabb roulette, desto
      mer kommer du att vinna. Först och vanligast, kommer spelaren att kunna utnyttja
      för att beräkna den förväntade vinsten från sina spel.

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s

    Blog at WordPress.com.

    %d bloggers like this: