【发布时间】:2015-06-12 20:15:09
【问题描述】:
调用服务失败。可能原因:服务离线 或无法访问;客户端配置不匹配 代理;现有代理无效。请参阅堆栈跟踪 更多详情。您可以尝试通过启动新代理来恢复,恢复 到默认配置,或者刷新服务。
The Address property on ChannelFactory.Endpoint was null. The ChannelFactory's Endpoint must have a valid Address specified.
at System.ServiceModel.ChannelFactory.CreateEndpointAddress(ServiceEndpoint endpoint)
at System.ServiceModel.ChannelFactory`1.CreateChannel()
at System.ServiceModel.ClientBase`1.CreateChannel()
at System.ServiceModel.ClientBase`1.CreateChannelInternal()
at System.ServiceModel.ClientBase`1.get_Channel()
at InstantBankVerificationPostBackClient.PostBack(String data)
Web.Config:
<services>
<service behaviorConfiguration="DebugJSonBehavior" name="IBVWebService.InstantBankVerificationPostBack">
<endpoint address="http://localhost:64337/InstantBankVerificationPostBack.svc"
binding="webHttpBinding"
contract="IBVWebService.IInstantBankVerificationPostBack"
behaviorConfiguration="webBehavior">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="webBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="DebugJSonBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
界面:
[OperationContract]
[WebInvoke(Method = "POST",
BodyStyle = WebMessageBodyStyle.WrappedRequest,
RequestFormat = WebMessageFormat.Json)]
void PostBack(string data);
【问题讨论】:
-
你能发布你的电话代码吗?