开发者

The remote server returned an error: NotFound. when trying get own collection result of service method

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.DzieckoAndOpiekunCollect开发者_运维知识库ion 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>


Try to add additinal info to config:

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜