The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience. (1) [Avatar] Offline
i created web service using xml & function definition is in web services when i tried to access the service the exception was thrown.

#include "stdafx.h"

//interface class ISimpleService;
//interface class ISimpleServiceChannel;
ref class SimpleServiceClient;

using namespace System;
using namespace System::ServiceModel;
using namespace System::ServiceModel::Channels;

interface class ISimpleService
String^ GetName(String^ request);

int main(array<System::String ^> ^args)
//Console::WriteLine(L"Hello World");
WSHttpBinding^ binding = gcnew WSHttpBinding();
//ISimpleService^ single;
Uri^ baseAddress = gcnew Uri("http://localhost:2110/TestWebService.Host/SimpleService.svc");
ServiceHost^ servicehost = gcnew ServiceHost(ISimpleService::typeid, baseAddress);
Console::WriteLine("The Service is running..");

System::String^ url = "http://localhost:2110/TestWebService.Host/SimpleService.svc";
EndpointAddress^ address = gcnew EndpointAddress(url);
ChannelFactory<ISimpleService^>^ channelFactory = gcnew ChannelFactory<ISimpleService^>(binding,address);
ISimpleService^ channel = channelFactory->CreateChannel();

//System::SimpleServiceClient^ obj= gcnew SimpleServiceClient();

delete channelFactory;
delete servicehost;
return 0;

An unhandled exception of type 'System.ArgumentException' occurred in System.ServiceModel.dll

Additional information: ServiceHost only supports class service types.