![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| Guest | VS2008 and WCF I have a trouble with WCF in the following code. Have created a [ServiceContract] and stuff. Now i am trying to host by writing code... Host only starts running in administrator mode. but when client(Vs2008 Add Service Reference) makes a reference it give error and I have no clue of the source of error. Problem is we had tried such small stuff in betas and now it not working smothly in VS2008 ERROR when adding a ServiceReference form Client when service is up and running There was an error downloading 'http://localhost:8000/HelloService/MyService'. The request failed with the error message: -- <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</faultcode><faultstring xml:lang="en-US">The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</faultstring></s:Fault></s:Body></s:Envelope> --. Metadata contains a reference that cannot be resolved: 'http://localhost:8000/HelloService/MyService'. Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost:8000/HelloService/MyService. The client and service bindings may be mismatched. The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'.. If the service is defined in the current solution, try building the solution and adding the service reference again. CODE [ServiceContract] public interface IDataService { [OperationContract] DataSet GetEmployeeRecords(); [OperationContract] int FindNoOfRecords(); } public class Employee : IDataService { #region IDataService Members public DataSet GetEmployeeRecords() { DataSet ds = new DataSet(); ds.ReadXml(@"D:\NewTry\WCFs\WCFServiceLibraryX\WCFServiceLibraryX\EmployeeXMLFile.xml"); return (ds); } #endregion public int FindNoOfRecords() { DataSet ds = GetEmployeeRecords(); return (ds.Tables[0].Rows.Count); } } static void Main(string[] args) { Uri baseAddress = new Uri("http://localhost:8000/HelloService"); using (ServiceHost serviceHost = new ServiceHost(typeof(Employee), baseAddress)) { serviceHost.AddServiceEndpoint(typeof(IDataService), new BasicHttpBinding(), "MyService"); serviceHost.Open(); Console.WriteLine("Press <enter> to terminate service"); Console.ReadLine(); serviceHost.Close(); } |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Windows 7 VS2008 | .NET General | |||
| VS2008 SP1 | .NET General | |||
| VS2008 new projects | .NET General | |||
| Upgrading from VS2008 standard to VS2008 Pro? | .NET General | |||
| upgrade from VS2008 standard to VS2008 pro- options? | .NET General | |||