SingleFile Option DOES NOT WORK :-(

Nov 12, 2009 at 3:22 PM

I thought the SingleFile option was to flatten multiple WSDLs down into one?

I'm getting the following exception:



An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: WCFExtras.Wsdl.WsdlExtensions
 Endpoint: http://localhost:1749/ContactManagement.svc ----> System.ApplicationException: Single file option is not supported in multiple wsdl files
   at WCFExtras.Wsdl.SingleFileExporter.ExportEndpoint(WsdlExporter wsdlExporter) in C:\Shadow\xxx\xxx\WCFExtras\Wsdl\SingleFileExporter.cs:line 18
   at WCFExtras.Wsdl.WsdlExtensions.System.ServiceModel.Description.IWsdlExportExtension.ExportEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext context) in C:\Shadow\xxx\xxx\WCFExtras\Wsdl\WsdlExtensions.cs:line 52
   at System.ServiceModel.Description.WsdlExporter.CallExtension(WsdlEndpointConversionContext endpointContext, IWsdlExportExtension extension)
   --- End of inner ExceptionDetail stack trace ---
   at System.ServiceModel.Description.ServiceMetadataBehavior.MetadataExtensionInitializer.GenerateMetadata()
   at System.ServiceModel.Description.ServiceMetadataExtension.EnsureInitialized()
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.InitializationData.InitializeFrom(ServiceMetadataExtension extension)
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.GetInitData()
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.TryHandleMetadataRequest(Message httpGetRequest, String[] queries, Message& replyMessage)
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.ProcessHttpRequest(Message httpGetRequest)
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.Get(Message message)
   at SyncInvokeGet(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
Nov 12, 2009 at 3:23 PM

I forgot to mention I'm testing with VS.NET's built in web server.

Nov 12, 2009 at 3:54 PM

I got it to work - it turns out some of my name spaces had typos, therefore causing different sections of the web service to be under different namespaces.


As long as the WCF service has namespaces in the same scope, it should work :)

Aug 13, 2010 at 2:58 PM

I'm struggling also with this error.

For some reason, if I'm using ServiceContract and ServiceBehavior tags it throws that error, but If I'll remove
those tags it works again. So can you tell what is wrong with my code? I'm using a simple test service to demonstrate this problem.
I need to use those tags so is there any way to fix this error? 

So with this code it doesn't work 

[ServiceContract(Name="IService1", Namespace="")]
  public interface IService1


[ServiceBehavior(Name="Service1", Namespace="", ConfigurationName="MyServiceConfiguration")]
  public class Service1 : IService1


but with this code it works (if I'll remove all those tags)

namespace WcfService1

  public interface IService1


namespace WcfService1

public class Service1 : IService1

Aug 17, 2010 at 7:17 PM
Got it working! In order to avoid this error you have to specify namespaces correctly. This means that you need to specify exactly the same namespace at least in the following locations: [ServiceContract(Namespace="http://SingleWSDL/Service1")] public interface IService1 { ...... } [ServiceBehavior(Namespace = "http://SingleWSDL/Service1")] public class Service1 : IService1 { ...... } <endpoint address="" binding="wsHttpBinding" contract="SingleWSDL_WcfService.IService1" bindingNamespace="http://SingleWSDL/Service1"> [DataContract(Namespace="http://SingleWSDL/Service1")] public Class MyCustomClass { }
Sep 1, 2010 at 2:18 PM

Thanks for posting all that! I had the same problem and it is indeed namespace problem. When I fixed all namespaces like EyeOfTiger sais I was ok.

Oct 28, 2010 at 12:26 AM

Thanks @EyeOfTigert, I had the same issue which is resolved by doing exactly as you did.

Jul 1, 2011 at 2:49 PM

Thanks to EyeOfTiger! the bindingNamespace attribute in my web.config was not set, now it works.