对于其他人想知道这件事,我只是创建了一个自托管的WCF服务。在搜索引擎上做了一个好点,甚至在这里。
这里就是我虽然谈论的一个样本:从在VS2010网上画廊自托管服务样本
<system.serviceModel>
<bindings>
<customBinding>
<binding name="BinaryHTTP">
<binaryMessageEncoding/>
<httpTransport/>
</binding>
</customBinding>
</bindings>
<services>
<service name="MyServiceClassName" behaviorConfiguration="ServiceBehaviour">
<endpoint binding="customBinding" bindingConfiguration="BinaryHTTP"
name="MainService" contract="BaseNamespace.IMyService"
address="MyService"/>
<endpoint address="" behaviorConfiguration="webHttpEnablingBehavior"
binding="webHttpBinding" contract="BaseNamespace.IClientAccessPolicy" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:80/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<!-- Enables public metadata, good for Add Service Reference in SL -->
<serviceMetadata httpGetEnabled="True"/>
<!-- Turn this off at the production level. -->
<serviceDebug includeExceptionDetailInFaults="True"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webHttpEnablingBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
这个例子是半复制。
的IClientAccessPolicy接口:
Imports System.ServiceModel
Imports System.ServiceModel.web
<ServiceContract()> _
Public Interface IClientAccessPolicy
<OperationContract(), WebGet(UriTemplate:="/clientaccesspolicy.xml")> _
Function GetPolicy() As IO.Stream
End Interface
希望你应该能够遵循。只要确保您的核心服务继承IClientAccessPolicy并返回一个有效的。
为什么你会“随机猜测变化”?当然,阅读手册并做出明智的选择会更好吗? – AnthonyWJones 2011-06-09 07:34:21
@AnthonyWJones我无法准确获得关于他们使用的网络或机器配置的大量细节。这就是为什么。 – 2011-06-09 07:38:04