I used the Data Connections Wizard to create a Webservice to submit from InfoPath to a Sharepoint list using the UpdateListItem service. I'm using custom_code, triggered from a submit form button, to accomplish this and execute the Webservice. What I can't figure out is how to programmatically get at the results of that service in order to extract some crucial information I need. I want to get a hold of the new ID that was assigned for my new list item. I want to be able to use this ID in order to trigger a secondary Webservice call (addAttachment) to add attachments to the newly created list item.
Some more details:
In my submit form programming, I am creating a WebServiceConnection object that ties back to the Data Connection I created with the wizard in Infopath:
WebServiceConnection
wsSubmit = (WebServiceConnection)this.DataConnections["Web Service Submit"];
I perform a series of steps to create CAML code and then finish things up by executing the WebServiceConnection:
wsSubmit.Execute();
I want to be able to get the new ID that was created for my list item, assign it to field defined in Main which is referenced in a second WebServiceConnection that calls the AddAttachment service which utilizes the listitemID.
In addition, I just want to be able to access any return results from the web service (e.g. error codes).
Any suggestions on this?