We have created a Wcf Service that’s hosted in a Windows Service. We have succeeded at the following:
- View its metadata at the appropriate httpGetUrl.
- Run it’s operations with the WcfTestClient.exe
- Generate working code using the SvcUtil.exe
-
Generate working code using the MFSvcUtil.exe
- This works with the default namespace
- This doesn’t work with custom namespaces.
The last point works if and only if we do NOT set a namespace for our ServiceContract and DataContract. If we do set a namespace, all the other steps still work, but with MFSvcUtil.exe, we end up getting generated code that looks like this:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// .NET Micro Framework MFSvcUtil.Exe
// Runtime Version:2.0.00001.0001
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Xml;
using System.Ext;
using System.Ext.Xml;
using Ws.ServiceModel;
using Ws.Services.Mtom;
using Ws.Services.Serialization;
using XmlElement = Ws.Services.Xml.WsXmlNode;
using XmlAttribute = Ws.Services.Xml.WsXmlAttribute;
using XmlConvert = Ws.Services.Serialization.WsXmlConvert;
namespace tempuri.org
{
// why are there no classes in here
// when we set an explicit namespace?
}
We are aware that the default namespace is http://tempuri.org. The problem arises when we try to use a non-default namespace as follows:
[ServiceContract(Name="IOurService", Namespace="http://OurCompany/OurApp/2014/03")]
[DataContract(Name="OurData", Namespace="http://OurCompany/Schema/2014/03")]
Why does MFScvUtil.exe not work when we set explicit namespaces on our contracts? Why does it still use the tempuri.org namespace? Is this a limitation of the Micro Framework SvcUtil tool?