您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

soap 协议服务端配置 wsdl 一直出错,求大牛指点

2024/4/14 11:50:03发布13次查看
soap 协议服务端配置 wsdl 一直报错,求大牛指点
本帖最后由 i_bruce 于 2014-06-24 10:16:24 编辑 错误提示如下,
fatal error: soap-error: parsing wsdl: couldn't find in 'http://test.soaptest.com/soap/service.php?wsdl' in /data/app/www/soaptest/client.php on line 4 call stack: 0.0003 324360 1. {main}() /data/app/www/soaptest/client.php:0 0.0003 324796 2. soapclient->soapclient() /data/app/www/soaptest/client.php:4
客户端调用代码client
date_default_timezone_set(prc);
ini_set('soap.wsdl_cache_enabled', 0); //关闭wsdl缓存
$soap = new soapclient('http://test.soaptest.com/soap/service.php?wsdl'); 
//echo $soap->add(28, 2);
//echo $soap->__soapcall('add',array(28,2));//或这样调用
服务器端代码service.php
soap_1_2));
$server->setclass(service); //注册service类的所有方法
$server->handle(); //处理请求
?>

生成wsdl文件 create_wsdl.php
date_default_timezone_set(prc);
include(service.php);
include(soapdiscovery.class.php);
$disco = new soapdiscovery('service', 'soap'); //第一个参数是类名(生成的wsdl文件就是以它来命名的),即service类,第二个参数是服务的名字(这个可以随便写)。
$disco->getwsdl();
~
生成wsdl文件类
/**
* copyright (c) 2005, braulio jos?solano rojas
* all rights reserved.
*
* redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* redistributions in binary form must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* neither the name of the solsoft de costa rica s.a. nor the names of its contributors may
* be used to endorse or promote products derived from this software without specific
* prior written permission.
*
* this software is provided by the copyright holders and
* contributors as is and any express or implied warranties,
* including, but not limited to, the implied warranties of
* merchantability and fitness for a particular purpose are
* disclaimed. in no event shall the copyright owner or
* contributors be liable for any direct, indirect, incidental,
* special, exemplary, or consequential damages (including, but
* not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption)
* however caused and on any theory of liability, whether in
* contract, strict liability, or tort (including negligence or
* otherwise) arising in any way out of the use of this software,
* even if advised of the possibility of such damage.
*
*
* @version $id: soapdiscovery.class.php 66 2013-04-10 07:12:21z ideaa $
* @copyright 2005
*/
/**
* soapdiscovery class that provides web service definition language (wsdl).
*
* @package soapdiscovery
* @author braulio jos?solano rojas
* @copyright copyright (c) 2005 braulio jos?solano rojas
* @version $id: soapdiscovery.class.php 66 2013-04-10 07:12:21z ideaa $
* @access public
* */
class soapdiscovery {
private $class_name = '';
private $service_name = '';
/**
* soapdiscovery::__construct() soapdiscovery class constructor.
*
* @param string $class_name

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product