首页  >  文章  >  后端开发  >  nusoap生成WSDL文件报错

nusoap生成WSDL文件报错

WBOY
WBOY原创
2016-06-06 20:36:401212浏览

这个错误,感觉很莫名其妙的,哪位大哥给看看?谢谢!
补充一下:这个使用了NuSoap的库
nusoap生成WSDL文件报错

<code><?php require_once 'lib\nusoap.php';
function getProd($category)
{
    if ($category == "books") {
        return join(",", array(
            "The WordPress Anthology",
            "PHP Master: Write Cutting Edge Code",
            "Build Your Own Website the Right Way"
        ));
    } else {
        return "No products listed under that category";
    }
}
$server = new soap_server();
$server->configureWSDL("productlist", "urn:productlist");
$server->register("getProd",
    array("category"=>"xsd:string"),
    array("return"=>"xsd:string"),
    "urn:productlist",
    "urn:productlist#getProd",
    "rpc",
    "encoded",
    "Get a listing of products by category");
$server->service($HTTP_RAW_POST_DATA);
</code>

回复内容:

这个错误,感觉很莫名其妙的,哪位大哥给看看?谢谢!
补充一下:这个使用了NuSoap的库
nusoap生成WSDL文件报错

<code><?php require_once 'lib\nusoap.php';
function getProd($category)
{
    if ($category == "books") {
        return join(",", array(
            "The WordPress Anthology",
            "PHP Master: Write Cutting Edge Code",
            "Build Your Own Website the Right Way"
        ));
    } else {
        return "No products listed under that category";
    }
}
$server = new soap_server();
$server->configureWSDL("productlist", "urn:productlist");
$server->register("getProd",
    array("category"=>"xsd:string"),
    array("return"=>"xsd:string"),
    "urn:productlist",
    "urn:productlist#getProd",
    "rpc",
    "encoded",
    "Get a listing of products by category");
$server->service($HTTP_RAW_POST_DATA);
</code>

你没有设置变量$HTTP_RAW_POST_DATA.你可以试着设置一下:

<code>php</code><code>$HTTP_RAW_POST_DATA = isset ( $HTTP_RAW_POST_DATA ) ? $HTTP_RAW_POST_DATA : '';
</code>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn