This post originated from an RSS feed registered with .NET Buzz
by Anand M.
Original Post: InfoPath and EDRA
Feed Title: .NET From India
Feed URL: http://www.dotnetindia.com/index.rss
Feed Description: Your daily dose of .NET From India
If you are using EDRA based Webservices, do note that you may have a problem accessing them from Infopath.
There are two problems with EDRA WS that makes it difficult to use with Infopath.
1. EDRA by default packages the response with UTF-16 encoding. Infopath 2003 SP1, supports only UTF-8. So Infopath will not be able to understand the data coming back from the WS. This is easily fixed, by changing the Encoding in the XMLWriter part.
2. The more serious one is the way EDRA actually parses the incoming message. When a .NET program calls a web service it actually create the SOAP envelope without any spaces. But if you look at Infopath's SOAP envelope, it is formatted with tabs and whitespaces. EDRA currently seems to have a problem with this as it does not expect whitespaces in the incoming message. Thus the Infopath call will fail. The way to fix this is to change the XML reader to read with IgnoreWhiteSpaces setting.
I am not sure if these changes affect anything else, but they sure make your WS accessible from Infopath. And the worst thing is that due to Error 1, Infopath cannot even show you the error the web service raises "Client Error", since it is returned as a SoapException (encoded in UTF-16), but rather shows a Soap parsing error.
More testing is needed, but stuff seems to work as of now. :-)