![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | How to retrieve metadata from self-hosted service Hello all <disclaimer>I'm just getting started with WCF, so this is probably just a dumb newbie question.</disclaimer> I have a simple service (the usual ICalculator sample) hosted in a console app. The app starts up OK and is listening on the configured port. Application config file follows: <?xml version="1.0" encoding="utf-8" ?> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <system.serviceModel> <services> <service name="MathServer.MathServer" > <endpoint address="http://localhost:1234/MathServer" binding="basicHttpBinding" contract="MathServer.IMath" /> </service> </services> </system.serviceModel> </configuration> Using IE I am attempting to query the metadata from this service, using a URL of http://localhost:1234/MathServer?wsdl. However this is returning an error "500 Internal Server Error". The body of the reply from the service contains a SOAP envelope containing more information about the error as follows: "DestinationUnreachable" "The endpoint is unable to process the message at this time". I don't understand why my service does not return metadata when requested. Is this supposed to work for self-hosted services? I have setup a similar example, hosted using IIS, and this returns wsdl metadata without problem. Thanks in advance for any assistance Peter Evans |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How to retrieve metadata from self-hosted service hello, You can see wsdl in the ie when wcf is hosted in the self-hosted.Maybe your service class has some problem "Peter Evans" <PeterEvans@discussions.microsoft.com> wrote in message news:E8DF2E24-DAE2-4289-9B3C-BF6B3989F64A@microsoft.com... > Hello all > > <disclaimer>I'm just getting started with WCF, so this is probably just a > dumb newbie question.</disclaimer> > > I have a simple service (the usual ICalculator sample) hosted in a console > app. The app starts up OK and is listening on the configured port. > Application config file follows: > <?xml version="1.0" encoding="utf-8" ?> > <configuration > xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> > <system.serviceModel> > <services> > <service > name="MathServer.MathServer" > > <endpoint > address="http://localhost:1234/MathServer" > binding="basicHttpBinding" > contract="MathServer.IMath" /> > </service> > </services> > > </system.serviceModel> > </configuration> > > > Using IE I am attempting to query the metadata from this service, using a > URL of http://localhost:1234/MathServer?wsdl. However this is returning > an > error "500 Internal Server Error". The body of the reply from the service > contains a SOAP envelope containing more information about the error as > follows: "DestinationUnreachable" "The endpoint is unable to process the > message at this time". > > I don't understand why my service does not return metadata when requested. > Is this supposed to work for self-hosted services? > > I have setup a similar example, hosted using IIS, and this returns wsdl > metadata without problem. > > Thanks in advance for any assistance > Peter Evans |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How to retrieve metadata from self-hosted service hello, You need to make sure your service is still running when you want to get wcf wsdl from ie "Peter Evans" <PeterEvans@discussions.microsoft.com> wrote in message news:E8DF2E24-DAE2-4289-9B3C-BF6B3989F64A@microsoft.com... > Hello all > > <disclaimer>I'm just getting started with WCF, so this is probably just a > dumb newbie question.</disclaimer> > > I have a simple service (the usual ICalculator sample) hosted in a console > app. The app starts up OK and is listening on the configured port. > Application config file follows: > <?xml version="1.0" encoding="utf-8" ?> > <configuration > xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> > <system.serviceModel> > <services> > <service > name="MathServer.MathServer" > > <endpoint > address="http://localhost:1234/MathServer" > binding="basicHttpBinding" > contract="MathServer.IMath" /> > </service> > </services> > > </system.serviceModel> > </configuration> > > > Using IE I am attempting to query the metadata from this service, using a > URL of http://localhost:1234/MathServer?wsdl. However this is returning > an > error "500 Internal Server Error". The body of the reply from the service > contains a SOAP envelope containing more information about the error as > follows: "DestinationUnreachable" "The endpoint is unable to process the > message at this time". > > I don't understand why my service does not return metadata when requested. > Is this supposed to work for self-hosted services? > > I have setup a similar example, hosted using IIS, and this returns wsdl > metadata without problem. > > Thanks in advance for any assistance > Peter Evans |
My System Specs![]() |
| | #4 (permalink) |
| | Re: How to retrieve metadata from self-hosted service Thanks for the reply. Yes, my service host program (a console app) is running when I try to get wsdl. Some part of WCF is working, because my service host is accepting the connection from IE, processing the request and returning a SOAP error reply (along with HTTP error 500). If I try to query wsdl when my service host is not running then IE returns "The page cannot be display", as expected. The source for my service follows: using System; using System.ServiceModel; namespace MathServer { [ServiceContract] public interface IMath { [OperationContract] int Add( int x, int y ); } class MathServer : IMath { static void Main( string[] args ) { Console.WriteLine( "Starting" ); ServiceHost sh = new ServiceHost( typeof( MathServer ) ); sh.Open(); Console.WriteLine( "Press enter to terminate" ); Console.ReadLine(); Console.WriteLine( "Stopping service listener" ); sh.Close(); Console.WriteLine( "Stopped" ); } public int Add( int x, int y ) { return x + y; } } } "chenxu zhang" wrote: > hello, > You need to make sure your service is still running when you want to > get wcf wsdl from ie > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: How to retrieve metadata from self-hosted service hello, In Feb CTP,Instance a ServiceHost class,you need pass a uri to let wcf know where to find WCF metadata information ServiceHost sh = new ServiceHost(typeof(MathServer),new Uri("http://localhost:1234/MathServer")); "Peter Evans" <PeterEvans@discussions.microsoft.com> wrote in message news:98B72602-E6AB-47C9-BCDC-D37F8A8FFB3B@microsoft.com... > Thanks for the reply. > > Yes, my service host program (a console app) is running when I try to get > wsdl. Some part of WCF is working, because my service host is accepting > the > connection from IE, processing the request and returning a SOAP error > reply > (along with HTTP error 500). > > If I try to query wsdl when my service host is not running then IE returns > "The page cannot be display", as expected. > > > The source for my service follows: > > using System; > using System.ServiceModel; > > namespace MathServer > { > [ServiceContract] > public interface IMath > { > [OperationContract] > int Add( int x, int y ); > } > > class MathServer : IMath > { > static void Main( string[] args ) > { > Console.WriteLine( "Starting" ); > ServiceHost sh = new ServiceHost( typeof( MathServer ) ); > sh.Open(); > Console.WriteLine( "Press enter to terminate" ); > Console.ReadLine(); > Console.WriteLine( "Stopping service listener" ); > sh.Close(); > Console.WriteLine( "Stopped" ); > > } > > public int Add( int x, int y ) > { > return x + y; > } > } > } > > > > "chenxu zhang" wrote: > >> hello, >> You need to make sure your service is still running when you want to >> get wcf wsdl from ie >> > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: How to retrieve metadata from self-hosted service Thanks, wsdl query working fine now. I still don't understand why I have to pass a uri to the constructor when that same uri is in my config file. "chenxu zhang" wrote: > hello, > In Feb CTP,Instance a ServiceHost class,you need pass a uri to let wcf > know where to find WCF metadata information > > ServiceHost sh = new ServiceHost(typeof(MathServer),new > Uri("http://localhost:1234/MathServer")); > > > > "Peter Evans" <PeterEvans@discussions.microsoft.com> wrote in message > news:98B72602-E6AB-47C9-BCDC-D37F8A8FFB3B@microsoft.com... > > Thanks for the reply. > > > > Yes, my service host program (a console app) is running when I try to get > > wsdl. Some part of WCF is working, because my service host is accepting > > the > > connection from IE, processing the request and returning a SOAP error > > reply > > (along with HTTP error 500). > > > > If I try to query wsdl when my service host is not running then IE returns > > "The page cannot be display", as expected. > > > > > > The source for my service follows: > > > > using System; > > using System.ServiceModel; > > > > namespace MathServer > > { > > [ServiceContract] > > public interface IMath > > { > > [OperationContract] > > int Add( int x, int y ); > > } > > > > class MathServer : IMath > > { > > static void Main( string[] args ) > > { > > Console.WriteLine( "Starting" ); > > ServiceHost sh = new ServiceHost( typeof( MathServer ) ); > > sh.Open(); > > Console.WriteLine( "Press enter to terminate" ); > > Console.ReadLine(); > > Console.WriteLine( "Stopping service listener" ); > > sh.Close(); > > Console.WriteLine( "Stopped" ); > > > > } > > > > public int Add( int x, int y ) > > { > > return x + y; > > } > > } > > } > > > > > > > > "chenxu zhang" wrote: > > > >> hello, > >> You need to make sure your service is still running when you want to > >> get wcf wsdl from ie > >> > > > > > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| WCF service hosted in IIS | .NET General | |||