C# 在Windows Phone 8中使用Windows身份验证调用Web服务
我正在尝试在Windows Phone 8中使用Windows身份验证调用Web服务Exchange EWS。 在手动配置ServiceReferences.ClientConfig后,添加服务引用成功:C# 在Windows Phone 8中使用Windows身份验证调用Web服务,c#,web-services,windows-phone-8,windows-authentication,C#,Web Services,Windows Phone 8,Windows Authentication,我正在尝试在Windows Phone 8中使用Windows身份验证调用Web服务Exchange EWS。 在手动配置ServiceReferences.ClientConfig后,添加服务引用成功: <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IEWS" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="Transport">
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://servername/EWS/Exchange.asmx"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IEWS"
contract="ServiceReference1.ExchangeServicePortType"
name="BasicHttpBinding_IEWS" />
</client>
</system.serviceModel>
</configuration>
我明白了
The remote server returned an unexpected response: (401) Unauthorized.
In Silverlight, a 404 response code may be reported even when the service sends a different error code.
错误。
我尝试了各种配置更改。
最明显的一个
<transport clientCredentialType="Windows" />
现在我开始相信,我无法通过谷歌搜索结果来确认在WindowsPhone8中使用windows身份验证和Web服务是不可能的
到目前为止,我找到的唯一解决方案是使用和构建/解析我自己的soap内容
WebClient c = new WebClient();
c.BaseAddress = "https://servername/EWS/Exchange.asmx";
c.Credentials = new NetworkCredential("username", "password", "domain");
有什么想法吗?
有什么帮助吗?
是否有任何链接验证了我的假设
是否有任何源代码示例可以在不使用代理类的情况下在c中处理soap请求?WP8似乎使用了silverlight的一个版本。在过去,我已经能够让Silverlight 4与WCF一起工作-遵循与的类似说明。然而,这是基于浏览器中承载的Silverlight客户端和Silverlight使用浏览器身份验证机制在服务器上验证客户端。是的,也找到了该链接,但无法想出在windows phone中使用该链接的方法。有什么想法吗?
Unrecognized element 'security' in service reference configuration. Note that only a subset of the Windows Communication Foundation configuration functionality is available in Silverlight.
WebClient c = new WebClient();
c.BaseAddress = "https://servername/EWS/Exchange.asmx";
c.Credentials = new NetworkCredential("username", "password", "domain");