tags:

views:

43

answers:

2

Hey,

When I want to consume my method get error:

The remote server returned an error: NotFound.

Inner exception:

{System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.BrowserHttpWebRequest.<>c_DisplayClass5.b_4(Object sendState) at System.Net.Browser.AsyncHelper.<>c_DisplayClass2.b_0(Object sendState) --- End of inner exception stack trace --- at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)}

Error shows up here, when I want to get result of My method. It is possible that my own collection is bad created ? :

    public SecretaryAppNav.ClientService.DzieckoAndOpiekunCollection EndGetChildAndOpiekunByFirstnameLastname(System.IAsyncResult result) {
        object[] _args = new object[0];
        SecretaryAppNav.ClientService.DzieckoAndOpiekunCollection _result = ((SecretaryAppNav.ClientService.DzieckoAndOpiekunCollection)(base.EndInvoke("GetChildAndOpiekunByFirstnameLastname", _args, result)));
        return _result;
    }

My web.config:

   <?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <!--<system.diagnostics>
    <sources>
      <source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          </add>
          <add name="MessageLog">
            <filter type="" />
          </add>
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add initializeData="E:\sql\UNI\projekt dyplomowy\SecretaryAppNavNewEF\SecretaryAppNav\WcfService1\Web_tracelog.svclog"
        type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        name="MessageLog" traceOutputOptions="None">
        <filter type="" />
      </add>
    </sharedListeners>
  </system.diagnostics>-->
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="WcfService1BasicHttpBindingConfig" maxBufferSize="200000"
          maxReceivedMessageSize="200000">
          <readerQuotas maxArrayLength="200000" maxStringContentLength="200000"/>
          <!--<security mode="Transport">
            <message algorithmSuite="Basic128" />
          </security>-->
        </binding>
      </basicHttpBinding>
    </bindings>
    <diagnostics>
      <messageLogging logEntireMessage="true" logMessagesAtServiceLevel="true"
        logMessagesAtTransportLevel="true" />
    </diagnostics>
    <behaviors>
      <endpointBehaviors>
        <behavior name="CrossDomainServiceBehavior">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="metadataBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
        multipleSiteBindingsEnabled="true" />
    <services>
      <service name="WcfService1.Service1">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="WcfService1BasicHttpBindingConfig"
          contract="WcfService1.IService1" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8731/WcfService1/MyService" />
          </baseAddresses>
        </host>
      </service>
      <service name="WcfService1.CrossDomainService">
        <endpoint address="" behaviorConfiguration="CrossDomainServiceBehavior"
          binding="webHttpBinding" contract="WcfService1.ICrossDomainService" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8731/" />
          </baseAddresses>
        </host>
      </service>
    </services>
  </system.serviceModel>
</configuration>

and client config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IService1" 
          maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:11598/Service1.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_IService1" contract="ClientService.IService1"
        name="BasicHttpBinding_IService1" />
    </client>
  </system.serviceModel>
</configuration>
A: 

Try to add additinal info to config:

maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxBytesPerRead="2147483647" maxArrayLength="2147483647"

Luke
Unfortunately it not help :/ Maybe it is problem with specific type of collection I send ?
netmajor
Did you try put debug point in your web service to check if return at once error or during executing web service? Can you provide maybe code snippet how look your function?
Luke
A: 

I use Fiddler and find that it is problem with connection string which generate Entity Data Model... I try solve this problem..

netmajor