C# 无法使用windows phone询问我的Web服务WCF
我刚刚完成了wcf Web服务的实现,并将其添加到我的“Windows phone应用程序”中。但是现在,当我想使用我的应用程序并询问web服务时,我直接得到了以下错误:C# 无法使用windows phone询问我的Web服务WCF,c#,.net,wcf,web-services,windows-phone-7,C#,.net,Wcf,Web Services,Windows Phone 7,我刚刚完成了wcf Web服务的实现,并将其添加到我的“Windows phone应用程序”中。但是现在,当我想使用我的应用程序并询问web服务时,我直接得到了以下错误: Security processor was unable to find a security header in the message. This might be because the message is an unsecured fault or because there is a binding mismat
Security processor was unable to find a security header in the message. This might be because the message is an unsecured fault or because there is a binding mismatch between the communicating parties. This can occur if the service is configured for security and the client is not using security .
我已激活跟踪日志,并得到以下结果:
拜托,如果有人能帮我,这是我在瑞士的TPI考试。
谢谢,非常感谢
这是我的客户机和服务器web.config
**
客户端WEB.CONFIG(Windows phone应用程序)
**
**
服务器WEB.CONFIG(WCF)
**
我找到了!只需在我的设备上安装SSL证书,然后再打开我的应用程序。这样做很好
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinding_IService1">
<security authenticationMode="UserNameOverTransport" includeTimestamp="true" />
<binaryMessageEncoding />
<httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://sc-pm0037.swisscaution.local/Service1.svc"
binding="customBinding" bindingConfiguration="CustomBinding_IService1"
contract="ArmsWebService.IService1" name="CustomBinding_IService1" />
</client>
</system.serviceModel>
<?xml version="1.0"?>
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true" >
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "Sumit.svclog"/>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="xml"/>
</listeners>
</source>
<source name="myUserTraceSource"
switchValue="Information, ActivityTracing">
<listeners>
<add name="xml"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="Error.svclog" />
</sharedListeners>
</system.diagnostics>
<system.web>
<authentication mode="Forms"></authentication>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
<roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
<providers>
<clear/>
<remove name="AspNetSqlRoleProvider"/>
<add name="AspNetSqlRoleProvider" connectionStringName="ARMSConnectionString" applicationName="ARMS" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</roleManager>
<membership defaultProvider="SqlProvider" >
<providers>
<clear/>
<add
name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="ARMSConnectionString"
applicationName="ARMS"
minRequiredPasswordLength="4"
minRequiredNonalphanumericCharacters="0"
enablePasswordReset="true"
requiresUniqueEmail="true"
requiresQuestionAndAnswer="false"
passwordFormat="Hashed"/>
</providers>
</membership>
</system.web>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<connectionStrings>
<add name="ARMSConnectionString" connectionString="Data Source=.;Initial Catalog=Arms;User Id=ArmsUser;Password=w7rz8w374_3q4oqr;"/>
</connectionStrings>
<system.serviceModel >
<bindings >
<customBinding >
<binding name ="SimpleService.Simple.customBinding0" >
<transactionFlow />
<security authenticationMode="UserNameOverTransport" enableUnsecuredResponse="true" >
</security>
<binaryMessageEncoding></binaryMessageEncoding>
<!-- Configure https-->
<httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<services>
<service name="WebServiceArms.Service1">
<endpoint address="https://sc-pm0037.swisscaution.local/Service1.svc" binding="customBinding" bindingConfiguration="SimpleService.Simple.customBinding0"
contract="WebServiceArms.IService1" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true "/>
<!-- specify how the credentials are verified -->
<serviceCredentials>
<!-- Use the aspnet membership provider-->
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="WebServiceArms.CustomUserNameValidator,WebServiceArms" />
</serviceCredentials>
<serviceAuthorization roleProviderName="AspNetSqlRoleProvider" principalPermissionMode="UseAspNetRoles" >
</serviceAuthorization>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true "/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<validation validateIntegratedModeConfiguration="false"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>