私は Web サービスを稼働させており、ブラウザーを介してそれにアクセスし、稼働していることを確認できます。また、https がなくても、Web サービスを呼び出すことができます。
現時点で電話をかけるために、小さなコンソール アプリケーションを使用してテストし、結果を確認しています。
サーバー側の私の web.config は次のとおりです。
サービス部門
<services>
<service name="Website.mynamespace.Service1">
<endpoint address="/service.svc" behaviorConfiguration="" binding="wsHttpBinding" contract="SomeDLLFile.Anothernamespace.Services.Proxy.Interface1" ></endpoint>
<endpoint address="/service.svc" behaviorConfiguration="" binding="wsHttpBinding" contract="SomeDLLFile.Anothernamespace.Services.Proxy.Interface1" bindingConfiguration="myBinding" />
<endpoint address="mex" binding="wsHttpBinding" contract="IMetadataExchange"/>
</service>
<service name="Website.mynamespace.Service2">
<endpoint address="/service.svc" behaviorConfiguration="" binding="wsHttpBinding" contract="SomeDLLFile.Anothernamespace.Services.Proxy.Interface2" ></endpoint>
<endpoint address="/service.svc" behaviorConfiguration="" binding="wsHttpBinding" contract="SomeDLLFile.Anothernamespace.Services.Proxy.Interface2" bindingConfiguration="myBinding" />
<endpoint address="mex" binding="wsHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
使用したバインディング
<wsHttpBinding>
<binding name="myBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</wsHttpBinding>
クライアント側 (コンソール アプリケーション) で、Web サービスへのサービス参照を追加しました。このようにして、HTTP 経由で呼び出しを行うことができます。ただし、HTTPS を使用すると、次のようなエラーが表示されます
"There was no endpoint listening at https://test.mywebsite.nl/service.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."
コンソール アプリケーションの app.config は次のようになります。
<client>
<endpoint address="https://test.mywebsite.nl/service.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IProxyInterface1"
contract="Service.IProxyInterface1"
name="BasicHttpBinding_IProxyClientInterface" />
<endpoint address="https://test.mywebsite.nl/service.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IProxyInterface2"
contract="Service.IProxyInterface2"
name="BasicHttpBinding_IProxyInterface2" />
</client>
<behaviors>
<serviceBehaviors>
<!--
Step 2. Inside a <serviceBehaviors> section, add
a name attribute in the <behaviors> element that
matches the behaviorConfiguration attribute in the
<service> element above.
-->
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
内部例外を見ていると、404 エラーが表示されます。SOに関する他のトピックやMSの記事からさまざまな提案を試みましたが、まだ同じエラーが表示されているため、何かが欠けているに違いありません。ここで私が間違っていることを誰か知っていますか?