WCFJSONPWebサービスで「興味深い」エラーが発生しています。それは私が持っている唯一のものであり、1つのメソッドしか公開していません。内部でWebブラウザーを介してサービスにアクセスすると、MEXが有効になっていない(true)というメッセージがポップアップ表示されます。私がネットワークの外部からそれをヒットした場合(私の会社のマシンを使用していない場合のように)、それはただ座って、最終的にタイムアウトします。URLは次のとおりです:http://demo.rivworks.com/services/Negotiate.svc。この動作を引き起こしている可能性があるものについてのアイデアはありますか?
web.configは次のとおりです。
<!-- WCF configuration -->
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="JsonpServiceBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="RivWorks.Web.Service.NegotiateService">
<endpoint address=""
binding="customBinding"
bindingConfiguration="jsonpBinding"
behaviorConfiguration="JsonpServiceBehavior"
contract="RivWorks.Web.Service.INegotiateService" />
</service>
</services>
<extensions>
<bindingElementExtensions>
<add name="jsonpMessageEncoding" type="RivWorks.Web.Service.JSONPBindingExtension, RivWorks.Web.Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</bindingElementExtensions>
</extensions>
<bindings>
<customBinding>
<binding name="jsonpBinding" >
<jsonpMessageEncoding />
<httpTransport manualAddressing="true"/>
</binding>
</customBinding>
</bindings>
</system.serviceModel>
</configuration>
コードは次のとおりです。
namespace RivWorks.Web.Service
{
//----------------------------------------------------------------------------------------------------------//
// Data class //
//----------------------------------------------------------------------------------------------------------//
[DataContract(Name = "NegotiateSetup", Namespace = "http://rivworks.com/DataContracts/2009/01/15")]
public class NegotiateSetup : INegotiationInitialize
{
#region Declarations
...
#endregion
#region INegotiationInitialize Members
...
#endregion
}
//----------------------------------------------------------------------------------------------------------//
// Service Implementation //
//----------------------------------------------------------------------------------------------------------//
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class NegotiateService : INegotiateService
{
public NegotiateService() { }
public INegotiationInitialize GetSetup(string method, string jsonInput)
{
...
return resultSet;
}
}
}
私はここでいくつかのことを求めています:
- ローカルネットワークの外部からヒットできないのはなぜですか?
- MEXを正しく機能させるにはどうすればよいですか
注:私はここにあるJSONPクラスを使用しています:http://msdn.microsoft.com/en-us/library/cc716898.aspx