Mark Barto's Blog
Technical Blog about the Microsoft .NET Platform and everything that surrounds it such as .Net, C#, BizTalk, WCF, ASP.NET, SQL, Silverlight, IIS ...WCF, BizTalk: Root element is missing
We had a strange behavior when generating a WCF Service with the BizTalk Publishing Wizard. When we browse to the generated service in our browser we got the message "Root element is missing".
After some investigation on the Internet we have seen a lot of people which had the same problem. Most of all the problem is based on a security issue so the message about "Root element is missing" is odd.
We have checked all the security issues and we checked if the application pool was running under the correct credentials which had privileges to access BizTalk. This is mostly the same user where the BizTalk Service is running under.
We're running under Windows Server 2008 with BizTalk 2009 and the SQL 2008 database will be on an another server.
After all We logged in as domain user which is a member of the BizTalk groups and the local administrator group.
We created a new application pool within IIS 7 and set the username and password to the domain which We logged into and not the user where the BizTalk Service is running under. Then We set the Virtual Directory to this application pool and resets IIS.
When we browsed to the WCF Service the error message was disappeared.
We have checked what the difference was between these accounts and have seen that there are not any. Also when we try to set the application pool identity back to the BizTalk Service credentials we are getting the error again. When we changed it back to the domain user and we did a IIS Reset and recycle the application pool the error was still appearing.
We created a new application pool with the domain credentials and configured the virtual directory to the new application pool and the error was disappeared.
My strange conclusion was that when you set another credentials in your application pool it will be cached also if you do a IIS Reset or a recycle. Also deleting this application pool and recreate again will not solve the problem. Only a restart will work.
I'm not satisfied with the outcome but it could be that you must set the application pool identity under the same user which you have used for creating this WCF Service.
UPDATE 11 June:
After some more investigation we have found out that the difference between the domain user and the user of the application pool was that the domain user has SysAdmin rights within SQL Server.
The error was related that the user where the application pool was running under has not enough rights on the database such as the BizTalkMgmtDb, BizTalkMsgBox and the SSODB.
Because you don't want to give SysAdmin rights we have decided to give the user db_owner owner rights on these databases, see next figure.
It's strange why you must set additional db_owner rights for this domain user because on a local machine where you don't use domain account's and installed everything on one machine you don't have to do this.
Leave a comment