views:

37

answers:

1

locally I am not having any issues running a silverlight application. site comes up just fine. we deploy our code to our test environment and our site (or access to our data) stops working. I dont think our svc file is being recognized. I am leaning towards an issue with the endpoints. Im fairly new to wcf and service references. below is our code for the webconfig and the code for our clientconfig. wondering if anyone can give some direction onto what our issues may be.

our web.config

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <behavior name="">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true"/>
      </behavior>
    </serviceBehaviors>
  </behaviors>
  <bindings>
    <customBinding>
      <binding name="AlgaeTrackerDataServices.customBinding0">
        <binaryMessageEncoding/>
        <httpTransport/>
      </binding>
    </customBinding>
  </bindings>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" 
         multipleSiteBindingsEnabled="true"/>
  <services>
     <service name="AlgaeTrackerDataServices">
        <endpoint address="" 
                  binding="customBinding" 
                  bindingConfiguration="AlgaeTrackerDataServices.customBinding0" 
                  contract="AlgaeTrackerDataServices">
        </endpoint>
        <endpoint address="mex" 
                  binding="mexHttpBinding" 
                  contract="IMetadataExchange"/>
     </service>
   </services>
</system.serviceModel>

Our client config

 <system.serviceModel>
    <bindings>
        <customBinding>
            <binding name="CustomBinding_AlgaeTrackerDataServices">
                <binaryMessageEncoding />
                <httpTransport maxReceivedMessageSize="2147483647" 
                               maxBufferSize="2147483647" />
            </binding>
        </customBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:8080/AlgaeTrackerDataServices.svc"
                  binding="customBinding" 
                  bindingConfiguration="CustomBinding_AlgaeTrackerDataServices"
                  contract="AlgaeTrackerServices.AlgaeTrackerDataServices" 
                  name="CustomBinding_AlgaeTrackerDataServices" />
    </client>
</system.serviceModel>

Locally...when I click on the svc file and view in browser it comes up fine and I'm able to look at the wsdl. On our server I am unable to view the svc file..

I get an error that says that unable to launch asp.net develop...port 8080 is in use

Our event log says this..

WebHost failed to process a request. Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/31852487 Exception: System.Web.HttpException (0x80004005): The service '/AlgaeTrackerDataServices.svc' does not exist. ---> System.ServiceModel.EndpointNotFoundException: The service '/AlgaeTrackerDataServices.svc' does not exist. at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) Process Name: w3wp Process ID: 13128

Thanks in advance for the help...

A: 

Using a SVC file and http transport would indicate you're probably hosting this WCF service in IIS, right??

In that case, the address of the service is determined by:

  • your server name
  • your server port (optionally)
  • the virtual directory (and possible subdirectories thereof) that your SVC file is contained in
  • the *.SVC itself

So from a "remote" client, an address would typically look something like:

http://(servername)/(virtual directory name)/YourService.svc

On a remote client, your service will definitely not be on localhost - that would be that client machine itself. You need to use the server name (or ip address) of the server that has the service on it. So all you need to do (most likely) is adapt the client's config to reference the server address / URL for the service instead of localhost. Also, unless you've specifically changed your IIS configuration, your service will be on port 80 - not 8080.

marc_s