send & submit WebService - InfoPath Dev Sign in | Join | Help in Web Services InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Web Services » send & submit WebService Use our Google Custom Search for best site search results. send & submit WebService Last post 10-12-2005 08:58 AM by fredarwin. 10 replies. Page 1 of 1 (11 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 10-06-2005 09:36 AM fredarwin Joined on 10-06-2005 Mexico Posts 89 send & submit WebService Reply Contact Hi, i did a webservice with two methods to send and submit data to infopath to then send the document to a sharepoint site.Thats work fine, but when i edit the document and i try to edit some field i have a infopath message that tell me:"To modify form data, you must recovery from data conexion"I wish retrieve only data based on specefic id of the table, not all records of the table, how can i do that?thanksFred Darwin Villareal 10-06-2005 09:52 AM In reply to vt_asparagus Joined on 08-05-2005 USA Posts 285 Re: send & submit WebService Mark as Not AnswerMark as Answer... Reply Contact Could you verify the error message that you are getting? I have not seen that one before.As for you second comment, in your web service you can add a parameter your your web method. For example an int for ID. Then in InfoPath:- Make a connection to your web service and method with the ID parameter- Then go to your data source task pane and in the data source dropdown, select the web service- There are two nodes, dataFields and queryFields. dataFiels are vaules that you will pass into your web service and queryFields are values that will be returned.- Open up the dataFields node, select the ID field and drag onto your InfoPath form.- Move over fields from the queryFields as well.- You can add a button to execute your web service.Now the user can enter in an ID into the textbox for the ID field, then press the button, that will run your webservice and the webservice can return data based on that ID. Jasonhttp://www.k2distillery.com/ 10-06-2005 10:49 AM In reply to fredarwin Joined on 10-06-2005 Mexico Posts 89 Re: send & submit WebService Mark as Not AnswerMark as Answer... Reply Contact thanx vt_asparagus by ur comments,but my problem i thought is the next.my two methods are:<WebMethod()> Public Function RetrieveDataTyped(ByVal id As Integer) As DataSet SqlDataAdapter1.SelectCommand.Parameters(0).Value = id SqlDataAdapter1.Fill(DsTyped3) Return DsTyped3 End Function<WebMethod()> Public Function SubmitDataTyped(ByVal ds As DataSet) SqlDataAdapter1.Update(ds) End Functionmy table have 3 fields but the first is a identity field.After i fill all my fields(except the firts),i send my form in this sequence: first i send to my submitdata webservice and then i send to sharepoint site, my data are saved fine in sql but in my sharepoint document library inside the elements of xml i dont have the new id value created in sql table just apperar cero value.1. I need the new value created in my xml document how can i do that.When i Open my xml document from the sharepoint document library and i try to edit some field i have a infopath message."This value canĀ“t modify because has been send throght a data conexion and could be updated.To modify form data, must be retrieve of data conexion".2. How can pass the id saved in my xml document when i open it for automatically retrieve specefic data.For point 2, i did a sample putting a manual parameter and clicking a button query but, i need to do : when the form is opening query the specific data with the specific parameter saved in my xml document.Thnaks, i hope make myself understood.Fred Darwin Villareal 10-06-2005 12:50 PM In reply to vt_asparagus Joined on 08-05-2005 USA Posts 285 Re: send & submit WebService Mark as Not AnswerMark as Answer... Reply Contact Ummm...Thanks for the clarification. It helps. What you are explaining makes sense. You SubmitData webservice is pushing that data in. I will make an assumption that you are generating the ID in the DB as should be doing. That ID is not going to get back to your InfoPath form for free :-) One thing that comes to mind is your Submit Data web service could return the new generated ID after the Update has been commited to the DB.Although I am not sure that would be the best solution. I know someone else must have encountered this issue before. Anyone else? Jasonhttp://www.k2distillery.com/ 10-07-2005 06:27 AM In reply to fredarwin Joined on 10-06-2005 Mexico Posts 89 Re: send & submit WebService Mark as Not AnswerMark as Answer... Reply Contact thanks vt_asparagus,I try returning something(dataset or integer data) from submit webservice but no data was returning.<WebMethod()> Public Function SubmitDataTyped(ByVal ds As DataSet) as dataset SqlDataAdapter1.Update(ds) return dsEnd FunctionWell, anyelse with this problem?thanx.Fred Darwin Villareal 10-07-2005 02:46 PM In reply to vt_asparagus Joined on 08-05-2005 USA Posts 285 Re: send & submit WebService Mark as Not AnswerMark as Answer... Reply Contact You will not be able to do what you wrote:First - I would verify the web service in the VS studio as working before I integrate it with InfoPath. That will save you some time. Try debugging and ensure of the data is or is not being returned. If the new ID is not in the data set, read my second comment. I am not 100% if that is your issue but it is something you can look into.Second - Please confirm, is the ID being generated when a record is inserted into a table? I will assume so. If that is the case, when your SqlDataAdapter1.Update(ds) is executed, the ID is not in "ds". You need to get the new record from the DB, set the ID back into dataset and then you can return the dataset. A simple but very accurate way would be to select MAX from the table to get the ID. Although that would be a very poor coding practice if the webservice is supporting a highly transactional application. Suggest your do some research on generation of unique IDs in ADO.NET. Jasonhttp://www.k2distillery.com/ 10-10-2005 12:46 PM In reply to fredarwin Joined on 10-06-2005 Mexico Posts 89 Re: send & submit WebService Mark as Not AnswerMark as Answer... Reply Contact vt_asparagus,I very desesperate with this problem, i do the next.i pass all my webservice from typed to no-typed.i am using right now store procedures with managed code to submit my data and return my new id.Fourtunally my new submit webservice its working fine, but i cant take yet my new id identity created.Then i save my record and i return the new id(identity value) and then assign this data to my dataset and for last i return my ds updated, but i dont know why in my infopath field this data no is updated.I thought thats is the problem, How update my infopath field with my submite webservice o maybe i need to query again my retrieve webservice after executing submit.What do u thing? Thanks!!Fred Darwin Villareal 10-10-2005 07:45 PM In reply to vt_asparagus Joined on 08-05-2005 USA Posts 285 Re: send & submit WebService Mark as Not AnswerMark as Answer... Reply Contact Ok, so it sounds like you were able to overcome your issue of getting the new ID of your inserted record. Here is some psuedo code for a web service:Public Function SubmitDataTyped(ByVal ds As DataSet) as dataset '1 - update the date using SqlDataAdapter1.Update(ds) '2 - get the new id '3 - populate a new dataset with all the same data including the new id '4 - return the new datasetEnd FunctionOnce you verify that as working in Visual Studio Debugger, then integrate with InfoPath.- Add the web service as a data source to the form.- Add a button to the form that will execute the web service.- Go to the task bar and go to data sources. Select the web service data source from the dropdown.- There are two groups of nodes dataFields and queryFields. dataFields are values you send to the web service and queryFields are values you get back.- Drag and drop those fields onto the InfoPath form. After you press the submit button in Preview mode, the queryFields that you dropped on the form should have values.I hope this helps... Jasonhttp://www.k2distillery.com/ 10-11-2005 10:16 AM In reply to fredarwin Joined on 10-06-2005 Mexico Posts 89 Re: send & submit WebService Mark as Not AnswerMark as Answer... Reply Contact ok, i think that some step is wrong in my form.look,1. i do from 1-4 steps marked for u2. i work with Visual Studio Debugger and its fine, data is returned.3.i start my infopath form: a)Design a Form. In the Design a Form task pane, click New from Data Connection. b)In the Data Connection Wizard, click Web service, and then click Next. c)On the next page of the wizard, click Receive and submit data, and then click Next. d)Under Select an operation on the next page of the wizard, click ReceiveDataSet and then SubmitDatasetBecause the ReceiveDataSet method have one parameter (id to search), there are one query field to insert into the form.Well, i understand what are dataFields and queryFields but when u ask me:"Go to the task bar and go to data sources. Select the web service data source from the dropdown"i have only the principal data source(web service data source) and in my queryfield i have only one parameter mentioned above(id).I did drag and drop queryfield and datafield but after insert i dont have the new id in my infopath.What part i am doing wrong?is necesary to do a second query with a max(id) in infopath?ThanksFred Darwin Villareal 10-11-2005 07:54 PM In reply to vt_asparagus Joined on 08-05-2005 USA Posts 285 Re: send & submit WebService Mark as Not AnswerMark as Answer... Reply Contact Ok. Think I understand what is going on here. I typically do not use a submit web service data connection. This could be implemented using a single receive web service data source but it would require a little bit extra work. Since you are passing of a dataset back and forth, I would continue with what you have. Try writing a second query to get the data. Jasonhttp://www.k2distillery.com/ 10-12-2005 08:58 AM In reply to fredarwin Joined on 10-06-2005 Mexico Posts 89 Re: send & submit WebService Mark as Not AnswerMark as Answer... Reply Contact Thanks for u'r help vt_asparagus,it was good and helpful.I make a second query and was succesfully i have my new id back to infopath.Fred Darwin Villareal Page 1 of 1 (11 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Use our Google Custom Search for best site search results.