Ask a questionAsk a question
 

AnswerInfopath Webservices

  • Monday, November 02, 2009 6:59 PMtyamp Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,
    What I have:
    A database.

    My need:
    1. Implement a form service solution.

    I want to:
    1. have the database as back-end
    2. InfoPath 2007 form as front end
    3. Publish the forms to sharepoint so that I can use workflows for approvals

    What I did:
    1. Wrote a web service in 2008 that would get and put data in the database.
    2. Desinged a form based on that web service.

    Problem:
    1. InfoPath form seems to put "require" tag infront of all data types except string data type.
    2. I cannot get way around for dates and master table ID (primary key, identity)
    3. When submit button is clicked it say, successfully submitted but there is no data in database.

    Any suggestion or help is appreciated.

    Thank you,
    Tyampoo

Answers

  • Monday, November 02, 2009 7:02 PMClayton Cobb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Create a new, blank form not based on the web service, then add the web service as a submit and as a receive data connection.  The fact that you are using a web service is great and allows you more flexibility than if you based the form directly off the DB schema.  If you create it as a blank form, then you can define your form schema/fields and then choose what to receive and what to push back into the DB while also choosing what shows up in SharePoint.
    SharePoint Architect || My Blog

All Replies

  • Monday, November 02, 2009 7:02 PMClayton Cobb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Create a new, blank form not based on the web service, then add the web service as a submit and as a receive data connection.  The fact that you are using a web service is great and allows you more flexibility than if you based the form directly off the DB schema.  If you create it as a blank form, then you can define your form schema/fields and then choose what to receive and what to push back into the DB while also choosing what shows up in SharePoint.
    SharePoint Architect || My Blog
  • Monday, November 02, 2009 9:57 PMtyamp Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Clayton,

    As of now I have designed a form from blank form representing all data field. Now how would I attache the web service to the form? In Tools->Submit Options; there is no option for web service. Where am I missing? Where and how would I interact with the web service? Will I need to change my web service in this design?

    Any help or direction is appreciated.

    Thank you,
    Tyampoo
  • Monday, November 02, 2009 10:07 PMBalaji Baskar Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    As of now I have designed a form from blank form representing all data field. Now how would I attache the web service to the form? In Tools->Submit Options; there is no option for web service. Where am I missing? Where and how would I interact with the web service? Will I need to change my web service in this design?

    Hi Tyampoo, Now that your form is ready, In order to submit data to webservice you must add the submit data connection.
    On Tools menu Click Submit Options. In the dialog box click send form data to a single destination and the click webservice. the next set of screens will allow you to select the operations.

    Refer this document for Infopath 2007 form submitting to webservice: http://weblog.vb-tech.com/nick/archive/2007/01/17/2100.aspx

    Also, refer Submit form data to a web service: http://office.microsoft.com/en-us/infopath/HA101070481033.aspx
    Balaji Baskar
  • Monday, November 02, 2009 10:16 PMClayton Cobb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Tyampoo, you need to add the data connections.  Tools > Data Connections > Add.  Receive and submit.
    SharePoint Architect || My Blog
  • Monday, November 02, 2009 10:31 PMtyamp Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,

    I tried using Tools->Submit Options; chose "Send form data to a single destination" and chose "Web service"; added a data submit connection to point to the web service. It says data has been submitted successfully but there is no data in database?

    I have made class for table, master and child tables. the main web method takes array of objects that represent master table and may have array of objects that represents child tables.

    I also see 18 groups where as I create 4 repeating tables, 1 in section and 3 in optional section, if that makes different.

    Any direction?


    Tyampoo
    • Edited bytyamp Monday, November 02, 2009 10:38 PM
    •  
  • Monday, November 02, 2009 10:33 PMClayton Cobb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    There is a lot more to this than those simple steps.  I don't personally use the submit options like that, but you can.  You have to make sure you have fields in your main data source mapped to the data fields you're sending with the submit web service.  You probably need a receive to see what it's in the DB, too.  The data in your fields is not related to the web service just by adding the web service as a submit data connection.  You need to tell the form to send the data from your fields to the relevant fields in your web service.
    SharePoint Architect || My Blog
  • Monday, November 02, 2009 11:43 PMtyamp Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Is there any sample that I could work on?
    Tyampoo
  • Monday, November 02, 2009 11:59 PMClayton Cobb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    When I did it, I had to piece together everything myself with the help of many blogs and tons of troubleshooting around the permissions piece.  There was no single place to get it all.  I should write up an entire blog on it, but it would be the equivalent of about 30 pages in a book (including screenshots).
    SharePoint Architect || My Blog
  • Thursday, November 05, 2009 9:22 PMjhsimh Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I found a writeup at http://www.codeproject.com/KB/sharepoint/InfopathForm.aspx that answered a lot of my questions.  However, the Submit and Recieve connections serialize different data sets.  In IP, take a look at the data connections and you will see what I mean.  In the next week, I hope to get a project put together that can initialize the form and use the same data set to do updates.

    To bad there aren't more event handlers in IP....