dongpou7275 2009-11-01 09:25
浏览 58
已采纳

如何生成PHP soap客户端代码?

Is there a way to generate a PHP Soap Client from a WSDL file?

I mean something like wsdl.exe or svcutil.exe in .net, that generates code for a class that can be the client of a service, not something like:

$WSDL     = new SOAP_WSDL($wsdl_url); 
$client   = $WSDL->getProxy(); 

My problem is that I want the PHP client to be able the work with a service, even when that service doesn't expose its WSDL.

  • 写回答

6条回答 默认 最新

  • duanmao2650 2009-11-01 09:50
    关注

    You can use the method [generateProxyCode] provided in the package SOAP_WSDL (http://pear.php.net/reference/SOAP-0.9.4/SOAP/SOAP_WSDL.html#methodgenerateProxyCode) method instead and save it to a file:

    $WSDL     = new SOAP_WSDL($wsdl_url); 
    $php      = $WSDL->generateProxyCode();
    file_put_contents('wsdl_proxy.php', '<?php ' . $php . ' ?>');
    
    require 'wsdl_proxy.php';
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改