मैं कर रहा हूँ नई WCF प्रोग्रामिंग, मैं शुरू किया ट्यूटोरियल हो रही है की श्रृंखला नीचे दिए गए लिंकWCF 2012
http://msdn.microsoft.com/en-us/library/ms734712.aspx
मैं सांत्वना आवेदन में सेवा की मेजबानी की है लेकिन जब मैं एक ग्राहक बनाने की कोशिश की और से पीछा किया था सेवा संदर्भ जोड़ने की कोशिश की मुझे निम्नलिखित अपवाद मिला।
आवेदनclass Program
{
static void Main(string[] args)
{
// Step 1 Create a URI to serve as the base address.
Uri baseAddress =
new Uri("http://localhost:8000/GettingStarted/");
// Step 2 Create a ServiceHost instance
ServiceHost selfHost =
new ServiceHost(typeof(CalculatorService), baseAddress);
try
{
// Step 3 Add a service endpoint.
selfHost.AddServiceEndpoint(typeof(ICalculator),
new WSHttpBinding(),
"CalculatorService");
// Step 4 Enable metadata exchange.
var smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
selfHost.Description.Behaviors.Add(smb);
// Step 5 Start the service.
selfHost.Open();
Console.WriteLine("The service is ready.");
Console.WriteLine("Press <ENTER> to terminate.");
Console.WriteLine();
Console.ReadLine();
// Close the ServiceHostBase to shutdown.
selfHost.Close();
}
catch (CommunicationException ce)
{
Console.WriteLine("exception: {0}", ce.Message);
selfHost.Abort();
}
}
}
की मेजबानी की
There was an error downloading 'http: localhost:8000/GettingStarted/mex/_vti_bin/ListData.svc/$metadata'. The request failed with HTTP status 405: Method Not Allowed. Metadata contains a reference that cannot be resolved: 'http: localhost:8000/GettingStarted/mex'. There was no endpoint listening at http: localhost:8000/GettingStarted/mex that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The remote server returned an error: (404) Not Found. If the service is defined in the current solution, try building the solution and adding the service reference again.
कोड अब मैं यह पता लगाने की कि समस्या क्या है असमर्थ हूँ। मैं विजुअल स्टूडियो 2012 और .NET प्लेटफ़ॉर्म 4.5 का उपयोग कर रहा हूं।
सबसे पहले आप सफलतापूर्वक सेवा होस्ट करने में सक्षम थे? क्या आप अपने कंसोल एप्लिकेशन का आउटपुट साझा कर सकते हैं? – Praburaj