Submit a repeating section using a SP - InfoPath Dev
in

InfoPath Dev

Submit a repeating section using a SP

Last post 10-27-2005 12:55 PM by vt_asparagus. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 10-24-2005 10:32 AM

    Submit a repeating section using a SP

    Hello

    I have moved my topic here since it has turned into a Web Service question. The previous thread can be found here:http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1107

    My question regards the use of a Web Service to submit multiple entries located in a repeating section or repeating table.

    The Web Service is generated using SQLXML and it is based on a Stored Procedure taking multiple parameters (12 of them). The SP is on a MS SQL 2000 Server.

    My problem is that when I fill out a couple of sections with data that I would like submitted to the Web Service only the first entry in the repeating section is submitted.

    I have setup the link between the parameters of the SP and the fields in my dataset to point to the individual fields under the repeating section.

    I could really use a hint to how I get all entries submitted. Will I need to rewrite the SP to take the full dataset so I can link it to the repeating section itself or is it possible at all to use a parameterized SP?

    Thanks in advance.

    Best regards

    Emil Moelgaard
    Vestas Wind Systems A/S
  • 10-24-2005 10:53 AM In reply to

    Re: Submit a repeating section using a SP

    Glad you moved it over here.

    My personal preference would be if you have a Webservice named GetDataSet(), that returned a dataset that you used to fill a repeating table in InfoPath, I would create another method called SetDataSet(). Name it whatever you want, but the point is that it would be consistent. Then your SetDataSet would call your SP. You can all a SP directly in InfoPath if you prefer.
    Jason
    http://www.k2distillery.com/
  • 10-24-2005 01:51 PM In reply to

    Re: Submit a repeating section using a SP

    Hi,

    So you think I should write my own Web Service? However I actually like the simple approach of letting SQLXML generate the Web Service interface to the Stored Procedure. I gives me less code to maintain.

    Shouldn't it be possible to use a parameterized Web Service for submitting several entries in a repeating table/section?

    Best regards

    Emil Moelgaard
    Vestas Wind Systems A/S
  • 10-24-2005 11:06 PM In reply to

    Re: Submit a repeating section using a SP

    Hi Emil,
    This is exactly what our Database Accelerator web service does. It maps everything to SQL dynamically using a data-driven mapping form which you can change without having to write any code. There's a free evaluation available in Downloads->Free. Check it out.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 10-27-2005 01:34 AM In reply to

    Re: Submit a repeating section using a SP

    Hi,

    I have now created my own Web Service that uses a DataSet to send and receive entries to the database. It works fine now.

    However, there's still a small issue that I could use some input to. When I base my form on the DataSet some fields are automatically marked as required (red asterisk). When I look at the SQL table in the Enterprise Manager some of the required fields are configured to allow nulls, and should then be optional. Common for all the required fields are that they are 'Int32's.
    Can anyone help me by giving me a hint to where the requirement is set. Is it in Visual Studio when designing the Web Service, is it in the Stored Procedures that the Web Service uses or is it an InfoPath bug?

    If anyone know a forum where this type of issue fits better, please let me know.


    Best regards

    Emil Moelgaard
    Vestas Wind Systems A/S
  • 10-27-2005 07:59 AM In reply to

    Re: Submit a repeating section using a SP

    I would be guessing but seems that it would probably be occurring at InfoPath because I believe that it is inferring the schema from the dataset being returned from your webservice. I would have to start playing with some code see what you are experiencing.

    I know someone else must have come across this issue.

    Is the dataset strongly typed? That could help...
    Jason
    http://www.k2distillery.com/
  • 10-27-2005 08:03 AM In reply to

    Re: Submit a repeating section using a SP

    Also, check out these threads:

    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1048
    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=339
    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=74

    This nillable issue I have run into before...see if this helps...
    Jason
    http://www.k2distillery.com/
  • 10-27-2005 12:20 PM In reply to

    Re: Submit a repeating section using a SP

    Hi,

    Thanks for your help! I got i working now. First I tried to edit the DataSet in my Web Service project. I set the 'nillable' attribute on the elements. After rebuilding I checked the Web Service and could confirm that the attributes was set.
    Then I generated a new InfoPath form based on the updated Web Service. The result was the same. The Integers were still marked as required... By extracting the form files I could see that the 'nillable' attribute was NOT set in InfoPaths DataSet schema.

    Then I tried to create a Visual Studio project for my form. After searching a little I found the right schema file. I edited it to set the 'nillable' attribute, rebuild the solution and now it works like it's supposed to.

    How does InfoPath get the information for the DataSet schema it's using? To me it seems that the DataSet is generated by InfoPath itself. Wouldn't it be natural to use the DataSet that is described in the Web Service? After all it is placed in the Web Service folder.

    Anyway, thanks for your help.

    Best regards

    Emil Moelgaard
    Vestas Wind Systems A/S
  • 10-27-2005 12:55 PM In reply to

    Re: Submit a repeating section using a SP

    Unfortuneatly I have no idea how it is being generated. The closest thing that comes to mind is that InfoPath is "Inferring" the schema when it reads the data when setting up the data connection. It seems to be similar to using the Infer option when reading an XML document into a DataSet in ADO.Net.

    I have noticed is that lets say you have a web service and in the sample data set something such that the web service returns <items><item></item></items>. In this case InfoPath may not treat <item> as a repeating group. Although it you return something like <items><item></item><item></item></items> InfoPath will Infer that it is a repeating group.

    I wonder if it would do the samething if you had a strongly typed DS returned from your Webservice? Another thing is that you could create a schema externally from InfoPath and use that in your webservice and subsequently manually replace that schema into InfoPath on top of the one that was generated. I am not sure if that will work either but it is an idea.
    Jason
    http://www.k2distillery.com/
Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.