Solved

Web Services and Infopath 2010

Posted on 2010-11-18
5
1,184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

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…
Invest in your employees with these five simple steps to improve employee engagement and retention.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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