2016-05-04 5 views
-1

私は通常、エミュレータ上でアプリケーションを実行して何らかのアクションを実行できますが、Webサービスがブラウザ上で正常に動作しても何らかの理由でこれが突然表示されます。{0}でメッセージを受け入れることができるエンドポイントがありませんでした。これは、しばしば不正なアドレスまたはSOAPアクションによって引き起こされます。 (Xamarin Android)

error

私はこれと同様のケースで解決策を探しましたが、私はサービス参照を追加する別の方法を持っているXamarinを使用していますので、私はそれを行う方法を見つけ出すように見えることはできません。ここで

は私のコードです:

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> 
+0

エミュレータまたはデバイスでlocalhostを使用してサービスにアクセスすることはできません。おそらくマシンIPやプロキシを使用する必要があります。 – Cheesebaron

+0

@Cheesebaron私はいつもlocalhostを使ってそれを実行していましたが、私のWebサービスで何かを編集して突然このエラーが発生し、私のプロジェクトでメタデータを再追加しました。 –

+0

「http:// localhost:51678/FSREmployee.svc」というローカルホストを自分のIPアドレスに変更しましたが、同じエラーが表示されました。 –

答えて

-1

もう一度Webサービスを作成して解決しましたが、今は正しく機能しています。

+0

私はこの同じ問題を抱えています。もう一度Webサービスを作成するとどういう意味ですか?サービス自体またはサービス参照?私は呼び出す必要のあるSOAPサービスを制御することはできませんが、WCFを使用するコンソールアプリケーションで問題なく呼び出すことができますが、Xamarin Forms PCLプロジェクトとまったく同じコードを使用してこのエラーが発生します。 –

0

。 genymotionエミュレータを使用すると、問題なくスムーズに動作します。また、localhostでホストされているサービスには、プロキシまたはIP経由でアクセスできます。

+0

私はビジュアルスタジオのエミュレータに組み込まれて使用しています。 –

+0

ポートのためかもしれませんか?ポートの有効期限はありますか? –

+0

もう一度Webサービスを作成して解決しました。これを再び起こらないようにするにはどうしたらいいですか? –

関連する問題