使用wsHttpBinding消耗WCF服务时出现问题 [英] Problem in consuming WCF Service using wsHttpBinding

查看:84
本文介绍了使用wsHttpBinding消耗WCF服务时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个wcf网络服务,当我尝试使用wcf服务时,我创建了服务对象并调用了函数,它给出了错误:

Hi,


i have a wcf web service,when i am trying to consume wcf service,i create object of service and call function then, its gives error:

The caller was not authenticated by the service.


当我使用BasicHttpSecurityMode模式时会出现错误:


when i use BasicHttpSecurityMode mode it gives error:

Content Type text/xml; charset=utf-8 was not supported by service.



在此先感谢
Prateek



thanks in advance
Prateek

推荐答案

尝试在端点中添加身份标记
try adding identity tag in the endpoint
<client>
            <endpoint address="net.tcp://localhost:5678/projects/Generic/">
                binding="netTcpBinding" bindingConfiguration="Generic" contract="XYZ.IOP"
                name="Generic" >
<identity>
                    <serviceprincipalname value="host/username.doaminame" />
                </identity>
</endpoint>
</client>


<endpoint address="http://173.192.138.18/SCVMMService/VirtualMachineManagementService.svc">
   binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IVirtualMachineManagementService"
   contract="ServiceReference1.IVirtualMachineManagementService"
   name="WSHttpBinding_IVirtualMachineManagementService">
   <identity>
    <serviceprincipalname value="host/win48.scvmmrc.ourcp.com" />
   </identity>
  </endpoint>




错误消息内容类型为text/xml;服务不支持charset = utf-8"的原因之一.服务器和客户端之间的绑定可能不匹配.因此,请检查绑定....

如果那不是问题,建议您启用服务跟踪并从此处复制跟踪中的确切错误,因此我们将尝试诊断问题...
可以在此处找到有关如何启用服务跟踪的信息 [此处 [服务跟踪查看器 [
Hi,

One of the reasons for your error message "Content Type text/xml; charset=utf-8 was not supported by service." can be mismatch in bindings between server and client. So check bindings....

If that is not a problem, I suggest you to enable service tracing and copy exact error from trace here, so we''ll try to diagnose problem...
Info about how to enable service trace can be found here[^] and here[^].
When trace is collected you can open it with Service Trace Viewer[^] tool.


这篇关于使用wsHttpBinding消耗WCF服务时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆