[英]There was no endpoint listening at {0} that could accept the message. This is often cause by an incorrect address or SOAP action. (Xamarin Android)
I can normally run the application on the emulator and do some action before, but for some reason this suddenly appeared even though the webservice runs properly on the browser.我可以在模拟器上正常运行应用程序并在之前执行一些操作,但是由于某种原因,即使 web 服务在浏览器上正常运行,这也会突然出现。
I looked for a solution with similar case as this but I can't seem to figure out how to do it because I am using Xamarin which has a different way of adding service reference.我寻找了一个与此类似的解决方案,但我似乎无法弄清楚如何去做,因为我使用的是 Xamarin,它具有不同的添加服务引用的方式。
Here are my codes:这是我的代码:
ServiceReferences.ClientConfig ServiceReferences.ClientConfig
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IFSREmployee" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:51678/FSREmployee.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IFSREmployee" contract="IFSREmployee"
name="BasicHttpBinding_IFSREmployee" />
</client>
<extensions />
</system.serviceModel>
</configuration>
Web.config网页配置
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="SQL_HCMConnectionString" connectionString="Data Source=ADGTAPPS5;Initial Catalog=SQL_HCM;User ID=hcm;Encrypt=False;TrustServerCertificate=True"
providerName="System.Data.SqlClient" />
<add name="OFFICEConnectionString" connectionString="Data Source=ADGTAPPS5;Initial Catalog=OFFICE;User ID=office;Encrypt=False;TrustServerCertificate=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
</httpModules>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https"/>
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="ApplicationInsightsWebTracking"/>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
preCondition="managedHandler"/>
</modules>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
</configuration>
Which emulator are you using it might be the problem of your emulator.您使用的是哪个模拟器可能是您的模拟器的问题。 Use genymotion emulator it is the works smooth without any problems.
使用 genymotion 模拟器它是工作顺利没有任何问题。 And a service hosted on localhost can be accessed through a proxy or with the IP.
并且可以通过代理或使用 IP 访问托管在 localhost 上的服务。
已经通过再次创建网络服务解决了,现在它可以正常工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.