.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

RESTful WCF Service endpoint not being found by client

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :WCF
 

I created a RESTful WCF service which I plan to call from a client app (a custom toolpart in a Sharepoint web part), but while I can access everything just fine from a browser the client throws this error:

EndpointNotFoundException: There was no endpoint listening at http://mymachine:3217/Services/CtmsService.svc that could accept the
message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
---> System.Net.WebException: The remote server returned an error: (404) Not Found.

My service's contract looks like this:

[ServiceContract]
public interface ICtmsService
{
  [OperationContract]
  [WebGet(UriTemplate = "/GetAllSites")]
  Dictionary<string, int?> GetAllSites();
}
...and the configuration looks like this: (which is more complicated due to needing dependency injection via Spring.NET to work)

<system.serviceModel>
  
                                     
                                            
                                        

View Complete Post


More Related Resource Links

"Requested Service not found" on client when restart service with a .NET MarshalByRef remoting proxy

  

I have a client application that uses a single remoting entry point (a MarshalByRef class) to access a range of other MarshalByRef services on the server.

The server:

public class ServiceManager : MarshalByRefObject, IServiceManager
{
  IService1 service1;
  public ServiceManager(IService1 service1)
  {
    this.service1 = service1;
  }
  public override object InitializeLifetimeService()
  {
    return null; // never expire
  }

  public IService1 GetService1()
  {
    return service1;
  }
}

public class Service1 : MarshalByRefObject, IService1
{
  public override object InitializeLifetimeService()
  {
    return null; // never expire
  }
}

Ho

Problem to obtain client IP on web service

  

Friends,

I'm having problems to obtain the client IP on web service. Here's my scenario:

One server with Windows 2003, hosting the web service using .Net Framework 2.0, with IP 10.0.2.50 and host name ServerTransaction.
Other server with Windows 2003, hosting a web application using .Net Framework 2.0, that consuming the web service on  ServerTransaction, with IP 10.0.2.51 and host name ServerApplication.
Many other computers on the local network (IPs: 10.0.2.80, 10.0.2.81, 10.0.2.82, ...) acessing the web application on ServerApplication.

On the code of the web service I've tried to use HttpContext.Current.Request.UserHostAddress or HttpContext.Current.Request.ServerVariables("REMOTE_ADDR") or HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FORR"), but always I can only get the IP of ServerApplication (10.0.2.51).

Any idea or tip?


Thanks and sorry for my bad english.


Smart Client: Building Distributed Apps with NHibernate and Rhino Service Bus, Part 2

  

Smart client applications are responsive and promote interactivity with the user. In this article, we continue building a smart client application using NHibernate for data access and Rhino Service Bus for reliable communication with the server.

Oren Eini

MSDN Magazine August 2010


Smart Client: Building Distributed Apps with NHibernate and Rhino Service Bus

  

Smart client applications are responsive and promote interactivity with the user. In this article, we start the processes of planning and building a smart client application using NHibernate for data access and Rhino Service Bus for reliable communication with the server.

Oren Eini

MSDN Magazine July 2010


Service Station: Building RESTful Clients

  

This column how to build clients applications based on the REST architecture using HTTP AP1s. The article describes how to address the question of autogenerated types and code.

Jon Flanders

MSDN Magazine October 2009


Service Station: An Introduction To RESTful Services With WCF

  

We discuss some of the basic tenets of REST as well as present an implementation of a RESTful service using WCF.

Jon Flanders

MSDN Magazine January 2009


Extreme ASP.NET: Client-Side Web Service Calls with AJAX Extensions

  

Microsoft AJAX Library and the ASP.NET 2.0 AJAX Extensions provide a number of compelling features ranging from client-side data binding, to DHTML animations and behaviors. Learn all about them here.

Fritz Onion

MSDN Magazine January 2007


Looking for a simple Service and Console Client REST sample implementing BASIC authentication

  

Does anyone know of a C# code sample demonstrating WCF REST services and console test client with OperationContracts (GET and POST) implementing mutiple paramaters using BASIC authentication? Also, perhaps, using Fiddler as a test client as well? I have searched high and low for something like this, but have not had any success.


Error Build: Type or namespace could not be found, when referencing a web service

  
Hello, I'm new in writing C# application in Visual Studio 2008. I'm currently writing a web application for CRM 4.0 Reporting Service rendering. I reference my web application to our Reporting Service web service http://reportservername /ReportServer/ReportExecution2005.asmx and name it 'RSWebReference'. Then I want to reference it in my code: Using RSWebReference; Not sure why, but I cannot build my solution, saying "The type or namespace name 'RSWebReference' could not be found (are you missing a using directive or an assembly reference?)". I read this thread in http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/74f70e30-83e8-4817-b5e0-7729450730a1 that the website probably is using .net 1.1, and I should change it to .net 2.0. However, I think the website is already using 2.0. Is it probably because I'm using VS 2008? How can I tell and change if the website is using 1.1 or 2.0? Or could I be doing something wrong? Thanks in advanced for your help! -Elizabeth K.

WCF client to WSE 3.0 service

  
Dear all,   I try to create WCF client to WSE 3.0 service. I have already working WSE3.0 client to the same service. Here is it's configurations:   <microsoft.web.services3> <security> <timeToleranceInSeconds value="10000"/> <x509 allowTestRoot="true" verifyTrust="true" storeLocation="CurrentUser"/> <binarySecurityTokenManager> <add valueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"> <keyAlgorithm name="RSA15"/> </add> </binarySecurityTokenManager> </security> </microsoft.web.services3>   And the policy for the service client created in such a way:   MutualCertificate10Assertion assertion = new MutualCertificate10Assertion() { EstablishSecurityContext = false, RenewExpiredSecurityContext = true, RequireSignatureConfirmation = false, MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncrypt, RequireDerivedKeys = false, TtlInSeconds = 300 }; assertion.ClientX509TokenProvider = new X509TokenProvider(StoreLocation.LocalMachine, StoreName.My, "ClientCerfiticateName", X509FindType.FindBySubjectName); assertion.ServiceX509TokenProvider = new X509TokenProvider(StoreLocatio

WCF client to WSE 3.0 service

  
Dear all,   I try to create WCF client to WSE 3.0 service. I have already working WSE3.0 client to the same service. Here is it's configurations:   <microsoft.web.services3> <security> <timeToleranceInSeconds value="10000"/> <x509 allowTestRoot="true" verifyTrust="true" storeLocation="CurrentUser"/> <binarySecurityTokenManager> <add valueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"> <keyAlgorithm name="RSA15"/> </add> </binarySecurityTokenManager> </security> </microsoft.web.services3>   And the policy for the service client created in such a way:   MutualCertificate10Assertion assertion = new MutualCertificate10Assertion() { EstablishSecurityContext = false, RenewExpiredSecurityContext = true, RequireSignatureConfirmation = false, MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncrypt, RequireDerivedKeys = false, TtlInSeconds = 300 }; assertion.ClientX509TokenProvider = new X509TokenProvider(StoreLocation.LocalMachine, StoreName.My, "ClientCerfiticateName", X509FindType.FindBySubjectName); assertion.ServiceX509TokenProvider = new X509TokenProvider(StoreLocatio

The service cannot be started. This service has no endpoint defined....But it has!?!

  
Hi Foks,I'm following this tutorial on how to create RESTful services in WCF:http://www.codemeit.com/wcf/wcf-restful-pox-json-and-soap-coexist.htmlI would like to test the created service using the WCF Default Test Client, but when I run the application (F5) the service does not start and I get this message:"The service cannot be started. This service has no endpoint defined. Please add at least one endpoint for the service in config file and try again."However I do have endpoints defined for this service..I also have two other services running in the same application, which work fine:This is the relevant portion of my app.config:<behaviors>              <serviceBehaviors>                        <behavior name="WCF_Lib_Default.Service1Behavior">                   <serviceMetadata httpGetEnabled="True"/>                   <serviceDebug includeExceptionDetailInFaults="False" />             &nbs

Error in consuming web service using WCF client

  
Hi, I have consumed an external webservice in my client application using WCF. And every thing works great in my Dev box(XP with IIS5.1) But when the same application is moved to Prod server(Win Server 2003 with IIS6.0) it fails. Below is the exception caught: There was no endpoint listening at http://MyExternalWebServiceUrlWithSessionId could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. And the InnerException is: Unable to connect to the remote server My Config file has the below settings:<system.serviceModel> <bindings> <basicHttpBinding> <binding name="Default_Binding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCoun

.NET Client and Java Web Service Interoperability

  
I have a .net client that consumes an operation on a java based web service that appears to work accept for an issue with passing Boolean values back to the service in the soap message. Any member of the complex type that are defined as Boolean in the service contract will not be present in the soap message generated from the client even though they are set in the code. Sample Client Code: UpdateChecklistItemStatusPortTypeClient     proxy = new UpdateChecklistItemStatusPortTypeClient();     updateChecklistItemStatusReq request = new updateChecklistItemStatusReq(); request.ouid =   "P000122112"; request.applicationId =   "00000032"; request.adminFunction =   "ADMA"; request.checklistItemTypeCode =   "UHSTRN"; request.ceebCode =   "052046"; request.transcriptTerm =   "FINAL"; request.transcriptScores =   true;     updateChecklistItemStatusRsp response = new updateChecklistItemStatusRsp(); response = proxy.UpdateChecklistItemStatusOp(request); Client Soap Message Generated: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">   

Async Web Service behavior on client disconnect

  
Hi all, I was wondering what is the best way to detect client disconnect in the middle of an async web service call. I'm asusming that if a client disconnects while the server is still processing the async web method call, an exception will be thrown. First, I wonder if someone can confirm that this is the right assumption. If that's the case, then I was wondering where should I set up the SEH block to catch this exception. My gut tells me to set up the SEH block in side the delegate funciton, but I might be wrong. Also, what kind of an exception would I be getting if the client disconnects? Finally, if the SEH is set up in the delegate, what happens if a client disconnects in the tiny window before or after the delegate gets called? If someone can shed some light here I'd really appreciate it! Thanks, - K.  

How to set and map a Method in the Service file with endpoint elements and binding elements

  
Hi all, I have created a service file like OSService.svc in that i have two methods like one is FileUpload and FileDownload for e.g :- [WebInvoke(UriTemplate = "/fileupload/{fileName}" , Method = "POST" )]         [OperationContract]         void FileUpload(string fileName, Stream fileContents); same as Filedownload also. People you may know these methods are inside the interface of service file what you are using i'e i have created a interface as IOSService.cs. So, what i need now is i want to write separate endpoint for FileUpload and Filedownload.Because i want to set separate value for receiveTimeout  and openTimeout for the Fileupload and FileDownload process in binding section in the web.config file itself. The below code was i'm using right now but still i'm not able to the set separate value of endpoint elements in the bindings. EndPoint Section:- <endpoint name = "endPoint1"  address  = "localhost:8000/OSService.svc/" bindingConfiguration = "TransactionalTCP"   binding  = "netTcpBinding"          contract = "IOSService"/> Binding Section:-  <binding name = "TransactionalTCP"  transactionFlow = "true"   /&

WCF Service client problem.

  
Hi,I have hosted a wcf service over IIS with Windows Authentication. All the users are able to access the WCF service Url from their machine. The problem is that some of the user are able to consume the webservice method while few of them when try to consume the service ,the error is thrown connection - reset error.I have tried to go through the IIS log also but it did'nt helped.Can any one help me regarding this. What settings I need to check/change to solve the proble.Thanks,AKB
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend