"Ajax対応WCFサービス"を作成しました。私はjavascriptコードからサービスを消費することができ、WebServiceは意図したとおりに動作します。しかし、私はそれの周りにATPを書いてみたい。だから、私はATPプロジェクトに "サービスリファレンス"としてWebサービスを追加しています。それから私はいつものようにwebserviceを呼び出すことを使用しています。それはすべてコンパイルされます。エンドポイントの名前を持つ要素 『ServiceReference1.IWCFService』とServiceModelクライアント構成セクションで契約 『ServiceReference1.IWCFService』が見つかりませんでした。これは:。私はATPを実行したときしかし、それはC#コードにAjax対応WCFサービスを公開する
」System.InvalidOperationExceptionがこのエラーを私に戻って投げますアプリケーションに設定ファイルが見つかりませんでした。または、この名前に一致するエンドポイント要素がクライアント要素に見つかりませんでした。
これは、私が自分のApp.configファイルにあるATPです。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IWCFService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://yashworkspace/BSS/WS/ServiceReference1.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWCFService"
contract="ServiceReference1.IWCFService" name="BasicHttpBinding_IWCFService" />
</client>
<services>
<service name="ServiceReference1.WCFService">
<endpoint address="http://yashworkspace/BSS/WS/ServiceReference1.svc" behaviorConfiguration="org.proj.WebServices.WCFServiceAspNetAjaxBehavior"
binding="webHttpBinding" contract="org.proj.WebServices.IWCFService" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="org.proj.WebServices.WCFServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
どうすれば間違っているのか教えてください。 私は通常のWCFサービスを持っており、それはまったく問題なく動作しています。
助けてください。それは名も"ServiceReference1.IWCFService"
ことを期待エラーメッセージによると
<endpoint address="http://yashworkspace/BSS/WS/ServiceReference1.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWCFService"
contract="ServiceReference1.IWCFService" name="BasicHttpBinding_IWCFService" />
: ヤシュ
実際にC#からSOAPを使って通信する必要はありません。 webHttpBindingを使用するようにクライアントバインディングを変更すると、JSONを使用して同じ方法で通信するようになります。 –