Solved

Web Services and Infopath 2010

Posted on 2010-11-18
5
1,178 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

17 Experts available now in Live!

Get 1:1 Help Now