我正在使用wsHttpBindingWCF服务.
我添加了一个Web引用,我有了Web代理(它基于SoapHttpClientProtocol).
此外,我尝试使用wsdl.exewcf服务(http://zzzz/zz.svc?wsdl)生成的实际wsdl 构建代理.
当客户端调用该服务时,我收到以下错误:
The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://tempuri.org/Service1/Operation1'.
为什么客户端(Web代理)不能使用我的WCF服务?
我应该采取哪些措施才能使它们发挥作用?
我正在运行.NET FW 3.5和ASP.NET 2.0.
经过几天google -ing /尝试/失去头发后,我仍然无法找到解决方案,所以请帮忙:)
简短信息:
我需要使用PHP(SOAP客户端)的WCF服务.它使用wsHttpBinding(ws-security),无法设置basicHttpBinding.一切都在VPN背后,所以我无法为您提供webservice的链接.此外,数据被视为机密(来自客户的请求),因此我无法向您提供完整信息,只能提供一些"常见"信息.这是WS配置:
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IServices" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://topSecert.url/Service.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IServices"
contract="IServices" name="WSHttpBinding_IServices" />
</client>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)
我的尝试:
1)基本的PHP Soap客户端不起作用.它总是挂起,直到达到最大执行时间(没有生成错误).我后来发现PHP Soap客户端不支持wsHttpBinding(想哭)
2)一些SoapClient扩展类但没有成功,请求仍然挂起.
3)使用SOAPAction头尝试"自生成"CURL请求.最后我得到了一些错误(我用wse类生成了请求):
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action>
</s:Header>
<s:Body>
<s:Fault>
<s:Code> …Run Code Online (Sandbox Code Playgroud) 我正在寻找 dotnet core WCF wsHttpBinding 解决方法。
我知道 .net core WCF 实现目前不支持 wsHttpBinding (请参阅此处的支持矩阵https://github.com/dotnet/wcf/blob/master/release-notes/SupportedFeatures-v2.1.0.md)
我正在与似乎仅支持 wsHttpBinding 的遗留第三方服务集成。我们的技术堆栈是 .net core,因此我无法恢复到 .net 框架的完整版本或 mono 变体。
问题是是否可以通过自定义绑定使用该服务?我希望有一种解决方法,可能无法完全发挥作用,但至少允许我使用该服务。
var cBinding = new CustomBinding();
var textBindingElement = new TextMessageEncodingBindingElement()
{
MessageVersion = MessageVersion.Soap12WSAddressing10
};
cBinding.Elements.Add(textBindingElement);
var httpBindingElement =
new HttpsTransportBindingElement
{
AllowCookies = true, MaxBufferSize = int.MaxValue, MaxReceivedMessageSize = int.MaxValue,
};
cBinding.Elements.Add(httpBindingElement);
var myEndpoint = new EndpointAddress("https://..../Service.svc/wss");
using (var myChannelFactory = new ChannelFactory<ISearch>(cBinding, myEndpoint))
{
myChannelFactory.Credentials.UserName.UserName = "...";
myChannelFactory.Credentials.UserName.Password = "...";
ISearch client = …Run Code Online (Sandbox Code Playgroud) 在之前的一个帖子中,一位受访者表示使用wsHttpBinding使用了一个会话.由于我在群集IIS环境中工作,我应该禁用它吗?据我所知,会话在群集中不起作用.
如果我需要禁用此功能,我该如何解决?
我使用WCF来使用一个尊重WS表单的Web服务(然后我使用WSHttpBinding绑定).此表单涉及MessageID要在soap请求的标头中设置,并且RelatesTo字段中的响应标头中存在相同的id .我想记录我与此MessageId一起发出的请求,但无法找到检索WCF设置的messageId的方法,也可以手动设置它.我设法通过设置在球场上正确的属性,但是,要求这样做,让我将它,但是从响应得到它似乎WCF覆盖它,不要让我访问新值事件已经调用了.
任何的想法 ?
wcf ×4
c# ×2
soap ×2
.net ×1
.net-core ×1
iis ×1
php ×1
session ×1
soapheader ×1
wcf-binding ×1
ws-security ×1
wsdl ×1