Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a web service that is used to populate a drop-down. The web service is defined with a single parameter that is of type Nullable(Of Guid). The idea is that if no Guid is passed the service will return an unfiltered list of items but when a Guid is sent, the an appropriately filtered list will be returned instead.

The problem I am having is sending the NULL from the InfoPath form. If I call the web service without selecting a drop-down value I get the following error

The formatter threw an exception while trying to deserialize the message: There
was an error while trying to deserialize parameter
http://tempuri.org/:parameter1. The InnerException message was 'There
was an error deserializing the object of type System.Nullable`1[[System.Guid, mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]. The value ''
cannot be parsed as the type 'Guid'.'.  Please see InnerException for more details.

I think the problem is ultimately that second to last sentence -- The value '' cannot be parsed as the type 'Guid'. I think that InfoPath is treating the unselected drop-down value as an empty string and is sending that.

My question is how do I get InfoPath to send a NULL?

share|improve this question
It does this with textboxes as well. Trying to find a solution. – wtjones May 1 at 13:35

1 Answer

The "fix" I used to work around this with nullable dates is to change the web service to use string. Infopath will send empty string and you can handle that in the service.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.