手持设备(Windows Mobile 5.x)连接到WCF服务 [英] Hand held device (Windows Mobile 5.x) connecting to a WCF service
问题描述
嗨!
我已经在IIS上托管了WCF服务(.NET 3.5),当我尝试使用普通"连接时,客户端,它工作正常.
我想使用Windows Mobile 5.x客户端连接到该服务,并使用远程工具框架附带的NetCFSvcUtil工具生成CF客户端.当我尝试在VS 2008中的仿真器上使用客户端时,收到错误消息
"
+ $ exception {"没有端点在+ $ exception {没有可以在 http://localhost/ProducerService/Service.svc 上接受该消息的终结点.这通常是由不正确的地址或SOAP操作引起的.有关更多详细信息,请参见InnerException(如果存在).}.System.Exception {System.ServiceModel.EndpointNotFoundException}
可以接受该消息.这通常是由不正确的地址或SOAP操作引起的.有关更多详细信息,请参见InnerException(如果存在).}.System.Exception {System.ServiceModel.EndpointNotFoundException}
"
该服务运行正常,正在侦听给定地址.
此处是配置文件:
在服务器上(web.config)
Hi!
I have made a WCF service (.NET 3.5) hosted on IIS, and when I try to connect using a "ordinary" client, it's working fine.
I want to connect to the service using a Windows Mobile 5.x client, and generated the CF client with the tool NetCFSvcUtil delivered with Remote Tools Framework. When I try to use the client on the emulator in VS 2008, I get the error message
"
+ $exception {"There was no endpoint listening at + $exception {"There was no endpoint listening at http://localhost/ProducerService/Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."} System.Exception {System.ServiceModel.EndpointNotFoundException}
that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."} System.Exception {System.ServiceModel.EndpointNotFoundException}
"
The service is running ok and listening to the given address.
Here are the configuration files:
On the server (web.config)
<? xml 版本 = " 1.0" ?> |
<!- |
注意:作为手动编辑此文件的替代方法,您可以使用 |
Web管理工具可为您的应用程序配置设置.使用 |
Website- > Visual Studio中的Asp.Net配置选项. |
可在 |
machine.config.comments通常位于 |
\\ Windows \ Microsoft.Net \ Framework \ v2.x \ Config |
- > |
< 配置 > |
< configSections > |
< sectionGroup 名称 = " system.web.extensions" 类型 = "System.Web.Configuration.SystemWebExtensionsSectionGroup,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35" > |
< sectionGroup 名称 = "脚本" 类型 " System.Web.Configuration.ScriptingSectionGroup,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35". > |
< section 名称 = " scriptResourceHandler" 类型 = "System.Web.Configuration.ScriptingScriptResourceHandlerSection,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35" requirePermission allowDefinition = " MachineToApplication" /> |
< sectionGroup 名称 = " webServices" 类型 " System.Web.Configuration.ScriptingWebServicesSectionGroup,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35". > |
< section 名称 = " jsonSerialization" 类型 = "System.Web.Configuration.ScriptingJsonSerializationSection,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35" requirePermission allowDefinition = "无处不在" /> |
< section 名称 = " profileService" 类型 " System.Web.Configuration.ScriptingProfileServiceSection,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35" requirePermission = " false" allowDefinition = " MachineToApplication" /> |
< section 名称 = " authenticationService" 类型 = "System.Web.Configuration.ScriptingAuthenticationServiceSection,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35" requirePermission allowDefinition = " MachineToApplication" /> |
< section 名称 = " roleService" 类型 " System.Web.Configuration.ScriptingRoleServiceSection,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 style ="color:red"> requirePermission = " false" allowDefinition = " MachineToApplication" /> |
</ sectionGroup > |
</ sectionGroup > |
</ sectionGroup > |
</ configSections > |
< appSettings /> |
< connectionStrings /> |
< system.web |
<!- |
设置编译 调试 = "true" 插入调试 |
进入已编译页面的符号.因为这 |
会影响性能,请将此值设置为true |
在开发过程中. |
> |
< 编译 调试 = " false" > |
< 装配体 > |
< 添加 Assembly = " System.Core,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = B77A5C561934E089"; /> |
< 添加 装配 = " System.Xml.Linq,版本= 3.5.0.0,文化=中性,PublicKeyToken = B77A5C561934E089"; /> |
< 添加 程序集 = " System.Web.Extensions,Version = 3.5.0.0,Culture = neutral, PublicKeyToken = 31BF3856AD364E35"; /> |
< 添加 装配 = " System.Data.DataSetExtensions,版本= 3.5.0.0,文化=中性,PublicKeyToken = B77A5C561934E089"; /> |
</ 装配体 > |
</ 编译 > |
<!- |
< 身份验证 > 部分启用配置 |
ASP.NET以识别传入的用户. |
- > > |
< 身份验证 模式 = " Windows; /> <!- |
< customErrors > 部分启用配置 |
如果发生未处理的错误,该怎么办 |
在执行请求期间.具体来说, |
使开发人员能够配置html错误页面 |
将显示在错误堆栈跟踪的位置. |
< customErrors 模式 = " RemoteOnly" 默认重定向 " GenericErrorPage.htm". > |
< 错误 状态代码 = " 403" 重定向 = " NoAccess.htm" /> > |
< 错误 statusCode = " 404" 重定向 " FileNotFound.htm". /> </ customErrors > |
> |
< 页面 > |
< 控件 > |
< 添加 tagPrefix = " asp" 命名空间 = " System.Web.UI" 程序集 = " System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35" /> |
</ 控件 > |
</ 页面 > > |
< httpHandlers > |
< 删除 动词 = " *" 路径 " ; *.asmx" /> |
< 添加 动词 = " *" 路径 = <字体样式="color:blue">" *.asmx" 验证 = " false" > 类型 = " System.Web.Script .Services.ScriptHandlerFactory,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35". /> |
< 添加 动词 = " *" 路径 " ; * _ AppService.axd" 验证 " false" 类型 " System.Web.Script.Services.ScriptHandlerFactory,System.Web.扩展程序,版本= 3.5.0.0,文化=中性,PublicKeyToken = 31BF3856AD364E35". /> |
< 添加 动词 = " GET,HEAD" 路径 = " ScriptResource.axd" type = " System.Web.Handlers.ScriptResourceHandler,System.Web.Extensions,Version = 3.5.0.0, Culture = neutral,PublicKeyToken = 31BF3856AD364E35" 验证 " false" </ httpHandlers > |
< httpModules > |
< 添加 名称 = " ScriptModule" 类型 " System.Web.Handlers.ScriptModule,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35". /> |
</ httpModules > |
</ system.web |
< system.codedom |
< 编译器 > |
< 编译器 语言 = " c#; cs; csharp" 扩展名 .cs" warningLevel " 4"; |
type = "Microsoft.CSharp.CSharpCodeProvider,系统,版本= 2.0.0.0,Culture =中性,PublicKeyToken = b77a5c561934e089" > ; |
< providerOption 名称 = " CompilerVersion" 值 " v3.5"" /> |
< providerOption 名称 = " WarnAsError" 值 = " false" /> |
</ 编译器 > |
< 编译器 语言 = " vb; vbs; visualbasic; vbscript" 扩展名 = " .vb" warningLevel = " 4" |
type = ""; Microsoft.VisualBasic.VBCodeProvider,System,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089" > |
< providerOption 名称 = " CompilerVersion" 值 = " v3.5" /> |
< providerOption 名称 = " OptionInfer" 值 " true" /> |
< providerOption 名称 = " WarnAsError" 值 = " false" /> |
</ 编译器 > |
</ 编译器 > |
</ system.codedom |
要在Internet下运行ASP.NET AJAX,需要使用system.webServer部分. |
信息服务7.0.对于以前的IIS版本,它不是必需的. |
- > > |
< system.webServer |
< 验证 validateIntegratedModeConfiguration = " false" /> |
< 模块 > |
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
</modules> |
<handlers> |
<remove name="WebServiceHandlerFactory-Integrated"/> |
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" |
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" |
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> |
</handlers> |
</system.webServer> |
<system.serviceModel> |
<services> |
<service behaviorConfiguration="ServiceBehavior" name="TestWCFService.ProducerService"> |
<endpoint address="http://localhost/ProducerService/Service.svc" |
binding="basicHttpBinding" name="ProducerService" contract="TestWCFService.IProducerService" /> |
</service> |
</services> |
<behaviors> |
<serviceBehaviors> |
<behavior name="ServiceBehavior"> |
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> |
<serviceMetadata httpGetEnabled="true"/> |
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> |
<serviceDebug includeExceptionDetailInFaults="false"/> |
</behavior> |
</serviceBehaviors> |
</behaviors> |
</system.serviceModel> |
</configuration> |
<?xml version="1.0"?> |
<!-- |
Note: As an alternative to hand editing this file you can use the |
web admin tool to configure settings for your application. Use |
the Website->Asp.Net Configuration option in Visual Studio. |
A full list of settings and comments can be found in |
machine.config.comments usually located in |
\Windows\Microsoft.Net\Framework\v2.x\Config |
--> |
<configuration> |
<configSections> |
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> |
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> |
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> |
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> |
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" /> |
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> |
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> |
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> |
</sectionGroup> |
</sectionGroup> |
</sectionGroup> |
</configSections> |
<appSettings/> |
<connectionStrings/> |
<system.web> |
<!-- |
Set compilation debug="true" to insert debugging |
symbols into the compiled page. Because this |
affects performance, set this value to true only |
during development. |
--> |
<compilation debug="false"> |
<assemblies> |
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> |
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> |
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> |
</assemblies> |
</compilation> |
<!-- |
The <authentication> section enables configuration |
of the security authentication mode used by |
ASP.NET to identify an incoming user. |
--> |
<authentication mode="Windows" /> |
<!-- |
The <customErrors> section enables configuration |
of what to do if/when an unhandled error occurs |
during the execution of a request. Specifically, |
it enables developers to configure html error pages |
to be displayed in place of a error stack trace. |
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> |
<error statusCode="403" redirect="NoAccess.htm" /> |
<error statusCode="404" redirect="FileNotFound.htm" /> |
</customErrors> |
--> |
<pages> |
<controls> |
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
</controls> |
</pages> |
<httpHandlers> |
<remove verb="*" path="*.asmx"/> |
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> |
</httpHandlers> |
<httpModules> |
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
</httpModules> |
</system.web> |
<system.codedom> |
<compilers> |
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" |
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
<providerOption name="CompilerVersion" value="v3.5"/> |
<providerOption name="WarnAsError" value="false"/> |
</compiler> |
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" |
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
<providerOption name="CompilerVersion" value="v3.5"/> |
<providerOption name="OptionInfer" value="true"/> |
<providerOption name="WarnAsError" value="false"/> |
</compiler> |
</compilers> |
</system.codedom> |
<!-- |
The system.webServer section is required for running ASP.NET AJAX under Internet |
Information Services 7.0. It is not necessary for previous version of IIS. |
--> |
<system.webServer> |
<validation validateIntegratedModeConfiguration="false"/> |
<modules> |
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
</modules> |
<handlers> |
<remove name="WebServiceHandlerFactory-Integrated"/> |
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" |
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" |
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> |
</handlers> |
</system.webServer> |
<system.serviceModel> |
<services> |
<service behaviorConfiguration="ServiceBehavior" name="TestWCFService.ProducerService"> |
<endpoint address="http://localhost/ProducerService/Service.svc" |
binding="basicHttpBinding" name="ProducerService" contract="TestWCFService.IProducerService" /> |
</service> |
</services> |
<behaviors> |
<serviceBehaviors> |
<behavior name="ServiceBehavior"> |
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> |
<serviceMetadata httpGetEnabled="true"/> |
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> |
<serviceDebug includeExceptionDetailInFaults="false"/> |
</behavior> |
</serviceBehaviors> |
</behaviors> |
</system.serviceModel> |
</configuration> |
推荐答案
Hello Idar,
感谢您的发帖! I would suggest posting your question in one of the MS Forums,
<身体>
MSDN Forums » Smart Device Development » Smart Devices VB and C# Projects
located here: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=36&SiteID=1.
Thank you for your post! I would suggest posting your question in one of the MS Forums,
MSDN Forums » Smart Device Development » Smart Devices VB and C# Projects
located here: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=36&SiteID=1.
祝您度过愉快的一天!
这篇关于手持设备(Windows Mobile 5.x)连接到WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!