以下の設定でAzureでwebroleとしてホストされているWCFアプリケーションがあります。ブラウザで3つのサービスwsdlのいずれかにアクセスしようとしているとき、またはプロキシを設定しようとしているときに、400 Bad Requestが発生しています。このWCF設定が400の悪い要求を引き起こしていますか?
<?xml version="1.0"?>
<configuration>
<appSettings>
</appSettings>
<system.web>
<customErrors mode="Off"></customErrors>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<connectionStrings></connectionStrings>
<system.diagnostics>
<sharedListeners>
<add name="AzureLocalStorage" type="Example.AzureLocalStorageTraceListener, Example"/>
</sharedListeners>
<sources>
<source name="System.ServiceModel" switchValue="Verbose, ActivityTracing">
<listeners>
<add name="AzureLocalStorage" />
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging" switchValue="Verbose">
<listeners>
<add name="AzureLocalStorage" />
</listeners>
</source>
</sources>
</system.diagnostics>
<system.serviceModel>
<services>
<service name="Service1" behaviorConfiguration="MetaBehavior">
<endpoint address="http://example.com/service1.svc" binding="basicHttpBinding" name="basicEndpoint1" contract="IService1" />
</service>
<service name="Service2" behaviorConfiguration="MetaBehavior">
<endpoint address="http://example.com/service2.svc" binding="basicHttpBinding" name="basicEndpoint2" contract="IService2" />
</service>
<service name="Service3" behaviorConfiguration="MetaBehavior">
<endpoint address="http://pexample.com/service3.svc" binding="basicHttpBinding" name="basicEndpoint3" contract="IService3" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MetaBehavior">
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true"/>
<serviceThrottling maxConcurrentSessions="90" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false" aspNetCompatibilityEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
私の設定が正しくないと確信していますが、私は間違っているものについて少しガイダンスが必要です。
インターフェースは次のように定義されて:あなたは間違っバインディングを使用している
[ServiceContract(Name = "Service1", Namespace = "http://example.com")]
public interface IService1
{
[WebGet]
[OperationContract]
Result Create();
}
SOAPを使用する場合、正しい構成は何ですか? – Digbyswift
soapとWebGetの両方をサポートするようにWCFを設定できます。私は答えを広げました。 –