C# 如何从远程php服务器访问WCF自托管服务
我用C#应用程序创建了自托管WCF服务。我想从远程php服务器向C#应用程序发送消息。如何执行此功能C# 如何从远程php服务器访问WCF自托管服务,c#,php,wcf,remote-server,C#,Php,Wcf,Remote Server,我用C#应用程序创建了自托管WCF服务。我想从远程php服务器向C#应用程序发送消息。如何执行此功能 <?xml versio="1.0"?> <configuration><system.serviceModel> <services> <service name="MyMathServiceLib.MyMathService" behaviorConfiguration="myMathSe
<?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>
)
我的目标是将消息从php服务器发送到c#应用程序遵循以下简单步骤:
在VisualStudio文件夹中,应该可以看到WCF客户端
将您的WCF URL添加到此客户端(http://localhost:9001/MyMathService
在您的情况下)。在请求中填写示例数据并单击“XML”
复制XML并将其放入PHP中的变量中。不要在上一步中输入伪值,而是输入正确的PHP变量
启用PHP CURL。将此变量发布到WCF服务
无法获取@Jaymy php服务器位于联机远程服务器上。如何使用localhost@Rakesh然后用服务器的ip暴露WCF替换localhost
。确切地告诉我你不能理解的是什么?我想从在线php向本地c#应用程序发送消息。我想在哪里实现wcf服务?如何实现wcf服务?如何使用php中的wcf服务访问c#应用程序。我对这个概念一无所知。请帮帮我。