BasicHttpBinding 和 WsHttpBinding 之间的代理

发布于 2024-08-20 18:45:30 字数 366 浏览 3 评论 0原文

对于一个重要的客户,我必须在 PHP 中实现 SoapClient 以连接到 WsHttpBinding 中的 .Net Web 服务设置。

我知道 PHP SoapClient 不支持它。所以我的目标是开发一个用 C# 编写的代理软件,它将成为 BasicHttpBinding 和 WsHttpBinding 之间的“桥梁”。 因此,PHP 将仅与代理的 BasicHttpBinding 端进行通信,代理将使用 WsHttpBinding 将请求转换为真实的 WS,并将答案返回给 PHP 以 BasicHttpBinding 格式。

这是我的目标,但我刚刚开始使用 C# ...所以我需要帮助才能做到这一点。

有人可以帮助我或给我建议吗?

谢谢,

For an important customer, I've to implement a SoapClient in PHP to connect to a .Net webservice setup in WsHttpBinding.

I know PHP SoapClient doesn't support it. So my goal is to develop a proxy software written in C# which will be a 'bridge' between BasicHttpBinding and WsHttpBinding.
So PHP will communicate only with BasicHttpBinding side of the proxy, the proxy will translate the request to the real WS with WsHttpBinding and return to PHP an answer into BasicHttpBinding format.

That's my goal, but I'm just starting in C# ... so I need help to do this.

Is someone can help me or give me advice ?

Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岛歌少女 2024-08-27 18:45:30

您可以在 WCF 服务中公开两个端点:

<service name="MyCompany.MyService">
    <endpoint
      address="/advanced"
      binding="wsHttpBinding"
      contract="MyCompany.IMyContract" />
    <endpoint
      address="/simple"
      binding="basicHttpBinding"
      contract="MyCompany.IMyContract" />
    <endpoint
      address="mex"
      binding="mexHttpBinding"
      contract="IMetadataExchange"/>
  </service>

您的 PHP 客户端将指向 http://mycompany.com/myservice.svc/simple ,其他客户端将指向 http://mycompany.com /myservice.svc/advanced

You could expose two endpoints in your WCF service:

<service name="MyCompany.MyService">
    <endpoint
      address="/advanced"
      binding="wsHttpBinding"
      contract="MyCompany.IMyContract" />
    <endpoint
      address="/simple"
      binding="basicHttpBinding"
      contract="MyCompany.IMyContract" />
    <endpoint
      address="mex"
      binding="mexHttpBinding"
      contract="IMetadataExchange"/>
  </service>

Your PHP client will point to http://mycompany.com/myservice.svc/simple and other client to http://mycompany.com/myservice.svc/advanced.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文