我将此代码作为wcf服务:
namespace ImeiTrackingService
{
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
[ServiceContract]
public interface IImeiTrackingSrv
{
[OperationContract]
DataTable GetSocsListFromCsv();
[OperationContract]
void Send_device_change_Notification(string sMdn, string sImei, string sImsi);
}
这就是我在app.config中的内容:
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="ImeiTrackingService.ImeiTrackingSrv">
<endpoint address="" binding="basicHttpBinding" contract="ImeiTrackingService.IImeiTrackingSrv">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://imeitrk1.ram.eng.pel.internal/Send_device_change_Notification" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
当我尝试在我的网络服务器上运行它时: http://imeitrk1.ram.eng.pel.internal/Send_device_change_Notification
它不起作用,但如果我在本地尝试(改为使用本地主机)它会起作用,我做错了什么?