【发布时间】:2011-01-27 17:51:46
【问题描述】:
我一直在尝试关注this 关于从移动设备与 WCF 服务进行通信的文章(使用紧凑框架 3.5)。我的服务在桌面上运行,它告诉我它正在运行:
http://localhost:1414/MyService.svc
我可以在我的客户端中看到这个,但是当我尝试访问它时,我得到了这个错误:
There was no endpoint listening at http://localhost:1414/MyService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
所以我做到了:
InnerException: {"No connection could be made because the target machine actively refused it"}
我从模拟器中运行,文章指出该模拟器不起作用 - 因此我怀疑我遇到了同样的问题。所以我的问题是,有谁知道为什么会出现这个问题?
编辑:
澄清一下,这在部署到设备时可以正常工作。只是模拟器有问题。
编辑:
感谢@Shiraz Bhaiji,我现在在这方面取得了一些进展,但现在收到错误返回:
CFFaultException
这似乎是我能得到的唯一错误信息,它是由调用引起的:
MyServiceServiceClient client = new MyServiceServiceClient(binding, endpoint);
returnString = client.MyFunc1();
我已更改端点以引用我的 IP。直接地址如下(此时我的PC上正在运行WCF服务):
Binding binding = MyServiceServiceClient.CreateDefaultBinding();
string remoteAddress = MyServiceServiceClient.EndpointAddress.Uri.ToString();
EndpointAddress endpoint = new EndpointAddress("http://1.1.1.1/MyService/MyService.svc");
【问题讨论】:
标签: wcf compact-framework wcf-client