C# 配置WCF主机服务
我有一个关于Host app.config文件配置的基本问题 假设我在pc上托管WCF服务,其IP为:123.456.789.001:9999 这是我的app.config文件:C# 配置WCF主机服务,c#,wcf,web-services,host,C#,Wcf,Web Services,Host,我有一个关于Host app.config文件配置的基本问题 假设我在pc上托管WCF服务,其IP为:123.456.789.001:9999 这是我的app.config文件: <configuration> 我想知道应该在baseAddress和httpGetUrl中插入哪些正确的参数。我很困惑。我应该在那里放“localhost”还是ip(123.456.789.001)?我相信您会使用ip地址作为端点,使用WSDL作为httpGetUrl: <baseA
<configuration>
我想知道应该在baseAddress和httpGetUrl中插入哪些正确的参数。我很困惑。我应该在那里放“localhost”还是ip(123.456.789.001)?我相信您会使用ip地址作为端点,使用WSDL作为httpGetUrl:
<baseAddresses>
<add baseAddress="http://123.456.789.001:9999/MyWebexService"/>
</baseAddresses>
<behavior name="MyServiceTypeBehaviors" >
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://123.456.789.001:9999/MyWebexService?wsdl"/>
</behavior>
我不认为这样做是正确的:Q:在排队的应用程序上调用ServiceHost.Open()会引发以下异常:System.ArgumentException:基址不能包含URI查询字符串。为什么?答:检查配置文件和代码中的队列URI。虽然MSMQ队列支持使用“?”字符,但URI将此字符解释为字符串查询的开头。要避免此问题,请使用不包含“?”字符的队列名称。第一个问题-您是否使用MsmqBinding?如果是,为什么要使用http:作为地址的协议?那么我上面所说的应该是有效的-您发布的评论似乎是特定于NetMsmqBinding的。你试过我的答案吗?如果它不起作用,它会给你任何错误吗?
<baseAddresses>
<add baseAddress="http://123.456.789.001:9999/MyWebexService"/>
</baseAddresses>
<behavior name="MyServiceTypeBehaviors" >
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://123.456.789.001:9999/MyWebexService?wsdl"/>
</behavior>