I was trying to add some wcf services to my console app in VS Express 2013. I added all services to Web References successfully. For some services from the third party, I can see them in Object Browser and the client class was generated. For services I created, I cannot see them in Object Browser and the client classes were not generated. I read these (https://social.msdn.microsoft.com/Forums/en-US/d2bc41df-20ee-4fc1-9807-1cd21dee37f6/can-add-web-service-reference-but-cannot-see-it-in-object-browser-or-use-it and Why, when adding a service reference in VS2010, is the client class not generated?) and other posts but still cannot make it work. Here are the codes for the problematic service:
IFileProviderService.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.IO;
using System.ServiceModel.Web;
namespace MyServices
{
[ServiceContract]
public interface IFileProviderService
{
[OperationContract]
[WebGet(UriTemplate = "/AppInstaller/{userID}/{fileName}/{os}")]
Stream AppInstaller(string userID, string fileName, string os);
}
}
FileProviderService.svc.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.IO;
using System.ServiceModel.Web;
using System.ServiceModel.Activation;
namespace MyServices
{
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class FileProviderService : IFileProviderService
{
public Stream AppInstaller(string userID, string fileName, string os)
{
......
}
}
}
Reference.cs
#pragma warning disable 1591
namespace ServiceTest.MyFileProviderService {
}
#pragma warning restore 1591
This service is running and working properly. Any help is appreciated.