Web Services and Infopath 2010

Posted on 2010-11-18
Last Modified: 2012-06-21
I created a stored procedure that is attached to a database in sql.  I then created a SOAP endpoint that offers up the stored procedure as a web service.  I then create an Infopath form and use the web service as the data connection.  In the form there are several fields.  All of the fields will not have data when the form is submitted.  The data that is entered into the fields on the Infopath form passes to the sql table.  The problem is that the fields that are blank on the form are being represented by a zero in the table instead of NULL.  All fields are of the float data type. If data is not entered into a field on the Infopath form I need NULL to be passed to the table.
Question by:Bryan Pigg
  • 3
  • 2
LVL 28

Expert Comment

ID: 34165360
In form properties, on one of the last tabs there is a place to specify how to treat blank values. I beleive by default it is 0 rather than a blank.

I would try changing that.

Author Comment

by:Bryan Pigg
ID: 34165388
I did try changing that and it did not work.  That setting is described as "Select this option to have Infopath treat blank values in mathematical operations as zero."  I believe this has to do with expressions embedded in fields.
LVL 28

Expert Comment

ID: 34174539
I think you would have to make the conversion or fix in the webservice then.

Maybe replace the value to Null there.

Author Comment

by:Bryan Pigg
ID: 34174762
If I change the data type to varchar it will leave a blank value. Could I specify that all my parameters be varchar and convert back to decimal before writing to the database.

Just odd how infopath just assigns a 0 to an empty parameter.
LVL 28

Accepted Solution

clayfox earned 500 total points
ID: 34174795
Yah InfoPath defaults all decimals to 0. Have you tried binding a text box to the decimal field and see if it still defautls it to zero. I am not sure it is the field or the control that is putting the 0 in there.

I think your idea would be one fix.  You can still format your controls liek a decimal in InfoPath but it will accept blank values as well.

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Before you can digitally sign infopath forms, you must have a digital certificate. Microsoft Certificate Services will need to be enabled on a Windows Server 2008 to facilitate the creation and verification of the digital certifciates on the web ser…
Learn how the use of a bunch of disparate tools requiring a lot of manual attention led to a series of unfortunate backup events for one company.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now