MrAgile
asked on
WCF - The remote server returned an error: (404) Not Found.
Hi There,
I'm trying to connect to a service that resides on a remote machine. I have added the service reference and then edited the configuration file using the WCF config editor. I keep getting the following error: {"There was no endpoint listening at http://myip/myservice.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."} The inner exception is :The remote server returned an error: (404) Not Found.
I have verfied that the service works, shows metadata etc as i'm calling it from some AJAX methods on the same machine as the service resides.
Sean
code that i'm using to call the service
!------------------------------------------------------------------
using (Service.ServiceClient serv = new ServiceClient())
{
bool result = serv.mywebservicemethod();
}
config file from the website i'm trying to call from
!--------------------------------------------------------------------------
<system.serviceModel>
<client>
<endpoint address="http://myip/myservice.svc" binding="basicHttpBinding"
bindingConfiguration="basicHttp" contract="Service.IService"
name="client" />
</client>
<bindings>
<basicHttpBinding>
<binding name="basicHttp" />
</basicHttpBinding>
</bindings>
<services>
<service name="Service.Service">
<endpoint address="http://myip/myservice.svc" binding="basicHttpBinding"
bindingConfiguration="basicHttp" name="myendpoint" contract="Service.IService"/>
</service>
</services>
</system.serviceModel>
web config file from remote server
!--------------------------------------------------------------------------
<system.serviceModel>
<diagnostics wmiProviderEnabled="true">
<messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<bindings/>
<client/>
<behaviors>
<endpointBehaviors>
<behavior name="Myservice.Behavior">
<enableWebScript/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="metadataSupport">
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service name="Service.Service" behaviorConfiguration="metadataSupport">
<endpoint address="http://myip/myservice.svc" behaviorConfiguration="Myservice.Behavior"
binding="webHttpBinding" name="myendpoint" contract="Service.IService" />
</service>
</services>
</system.serviceModel>
ASKER
HI There,
when I type the address into IE I get endpoint not found. I do have an endpoint defined or at least I thought so.
when I type the address into IE I get endpoint not found. I do have an endpoint defined or at least I thought so.
<diagnostics wmiProviderEnabled="true">
<messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<bindings/>
<client/>
<behaviors>
<endpointBehaviors>
<behavior name="Myservice.Behavior">
<enableWebScript/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="metadataSupport">
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service name="Service.Service" behaviorConfiguration="metadataSupport">
<endpoint address="http://myip/myservice.svc" behaviorConfiguration="Myservice.Behavior"
binding="webHttpBinding" name="myendpoint" contract="Service.IService" />
</service>
</services>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you type the http://myip/myservice.svc into IE and get a response? Can you pull a simple function and retrieve data once you have this page up?
I'm assuming the .svc is a regular .asmx page?