私は関連しているかもしれないし、そうでないかもしれないいくつかの問題を抱えています。Visual Studioで[サービス参照の追加]を使用してデータサービスへの参照を追加すると、生成されるreference.csがコンパイルされないことに気付きました。名前空間がないことについて文句を言います。コンパイルするために修正することはできますが、これは参照を更新するたびに発生し、「これにより他の問題が発生するか」など、他のレベルでも心配です。
また、これを行うと、ホストサーバー(データサービスをホストするコンソールアプリケーション)が次のログを記録することに気付きました。
An exception occurred [System.Data.Services.DataServiceException] :: The URL
representing the root of the service only supports GET requests.
これはサービス構成です:
<service behaviorConfiguration="behaviour" name="StatsPlus.Server.HostedServices.SPDataServiceHost">
<endpoint address="svc" binding="webHttpBinding" contract="System.Data.Services.IRequestHandler" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8752/DataService/"/>
</baseAddresses>
</host>
</service>
そしてその振る舞い:
<behavior name="behaviour">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="10"/>
</behavior>
実行しようとするとsvcutil http://localhost:8752/DataService/
、次のようになります。
HTTP GET Error
URI: http://localhost:8752/DataService
There was an error downloading 'http://localhost:8752/DataService'.
The request failed with HTTP status 405: Method Not Allowed.
何か案は?とても有難い
ありがとう