Solved

Web Services and Infopath 2010

Posted on 2010-11-18
5
1,179 Views
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.
0
Comment
Question by:Bryan Pigg
  • 3
  • 2
5 Comments
 
LVL 28

Expert Comment

by:clayfox
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.
0
 
LVL 2

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.
0
 
LVL 28

Expert Comment

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

Maybe replace the value to Null there.
0
 
LVL 2

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.
0
 
LVL 28

Accepted Solution

by:
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
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…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

912 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

21 Experts available now in Live!

Get 1:1 Help Now