背景:
我有一个WCF,它对我的开发人员,他和他的客户都非常有效。我将其部署在测试服务器上。
该测试由3层内容,发布和Web构建。content是我将所有内容都放入Sharepoint的地方,并且只能从VPN和它的http进行访问,这意味着如果我想从我的开发机转到我放入资源管理器中的测试内容的网站http://testing
。
发布是中间的东西,我从没碰过,数据从内容移到其他2。
网络是向公众开放的网站,它是https并具有负载均衡器,您可以使用以下URL测试我的WCF :https://testnew.mizrahi-tefahot.co.il/_vti_bin/skywcf/skyservice.svc
问题:
在我的开发人员中,我完美地使用了我的开发人员WCF。MEX在test-content和testing-web上都表现出色,就像您在上面的链接中所见,wsdl一样。
尝试创建客户端以使用测试Web服务时,我收到此错误消息(尝试执行“添加服务引用”时):
下载' https://testnew.mizrahi-tefahot.co.il/_vti_bin/skywcf/skyservice.svc/_vti_bin/ListData.svc/ $ metadata'时出错。该请求失败,HTTP状态为400:错误的请求。元数据包含无法解析的引用:' https : //testnew.mizrahi-tefahot.co.il/_vti_bin/skywcf/skyservice.svc '。内容类型application / soap + xml; 服务https://testnew.mizrahi-tefahot.co.il/_vti_bin/skywcf/skyservice.svc不支持charset = utf-8。客户端和服务绑定可能不匹配。远程服务器返回错误:(415)由于内容类型为'application / soap + xml,因此无法处理该消息;charset = utf-8'不是预期的类型'text / xml;charset = utf-8'。如果服务在当前解决方案中定义,请尝试构建解决方案并再次添加服务引用。
尝试在我的开发机中使用测试内容服务时,它会创建服务引用,但是当尝试调用方法时,我会获得尝试通过浏览器访问服务时所获得的网页HTML。看着提琴手,我看到他给了我“对象移到这里”消息,向URL添加了某种令牌(这是HTML):
<html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="%2f_vti_bin%2fSkyWCF%2f(X(1)S(5hwwif450myurs45h5ihnn55))%2fSkyService.svc%3fAspxAutoDetectCookieSupport%3d1">here</a>.</h2> </body></html>
有什么帮助吗?
编辑:Web配置
服务器
<?xml version="1.0"?>
<configuration>
<system.web>
<customErrors mode="RemoteOnly"/>
</system.web>
<system.serviceModel>
<services>
<service behaviorConfiguration="Sharepoint.BankMizrahi.Sky.WCF.ServiceBehavior" name="Sharepoint.BankMizrahi.Sky.WCF.SkyService">
<endpoint address="" binding="basicHttpBinding" contract="Sharepoint.BankMizrahi.Sky.WCF.ISkyService">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Sharepoint.BankMizrahi.Sky.WCF.ServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://mizrahi"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
</system.serviceModel>
<appSettings>
<add key="siteUrl" value="http://mizrahiadmin/sky" />
<add key="LogName" value="SkyService" />
</appSettings>
</configuration>
客户
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISkyService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="CustomBinding_ISkyService" 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="None">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://mizrahidev/_vti_bin/SkyWCF/SkyService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISkyService"
contract="ServiceReference1.ISkyService" name="BasicHttpBinding_ISkyService" />
<endpoint address="http://mizrahi/_vti_bin/SkyWCF/SkyService.svc"
binding="wsHttpBinding" bindingConfiguration="CustomBinding_ISkyService"
contract="ServiceReferenceForTesting.ISkyService" name="CustomBinding_ISkyService" />
</client>
</system.serviceModel>
</configuration>
好吧,似乎答案是服务器是sessionStateEnabled,因此尝试使用cookie,解决方案只是禁用cookie
<system.web>
<sessionState mode="Off"/>
多数民众赞成在测试内容,关于测试网站,似乎我需要找到一种方法来传递负载均衡,这剥离了https
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句