-1
我使用C#應用程序創建了自託管的WCF服務。我想從遠程php服務器發送消息給C#應用程序。我如何執行此功能?如何從遠程php服務器訪問WCF自託管服務
<?xml versio="1.0"?>
<configuration><system.serviceModel>
<services>
<service name="MyMathServiceLib.MyMathService" behaviorConfiguration="myMathServiceBehave">
<host>
<baseAddresses>
<add baseAddress="http://localhost:9001/MyMathService"/>
<add baseAddress="net.tcp://localhost:9002/MyMathService"/>
</baseAddresses>
</host>
<endpoint address="http://localhost:9001/MyMathService" binding="basicHttpBinding" contract="MyMathServiceLib.IMyMathService"/>
<endpoint address="net.tcp://localhost:9002/MyMathService" binding="netTcpBinding" contract="MyMathServiceLib.IMyMathService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="myMathServiceBehave">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
這是我的app.config文件(參考:http://www.codeproject.com/Articles/650869/Creating-a-Self-Hosted-WCF-Service)
我的目標是從PHP服務器發送消息到C#應用程序
無法讓你@Jay – Rakesh 2014-09-29 02:22:26
我的php服務器在在線遠程服務器上。如何使用localhost – Rakesh 2014-09-29 11:07:11
@Rakesh訪問,然後用服務器的ip暴露WCF來替換'localhost'。準確告訴我你無法理解的內容? – 2014-09-29 15:05:44