小编Jas*_*son的帖子

PHP/NuSOAP设置soap:地址位置

我正在使用WAMP和CakePHP,并试图在混合中添加一个NuSOAP服务器.我可以通过NuSOAP生成动态WSDL,但底部有一个由NuSOAP设置的参数,并且没有任何意义:

<soap:address location="http://localhost/cakephp/app/webroot/index.php"/>
Run Code Online (Sandbox Code Playgroud)

正确的是:

<soap:address location="http://localhost/cakephp/web_service/web_service"/>
Run Code Online (Sandbox Code Playgroud)

我无法弄清楚如何更改它,甚至根本不知道NuSOAP在哪个位置(我的代码中完全没有引用它).

这是我正在使用的代码:

    class WebServiceController extends AppController {
        var $components = array('RequestHandler');
        public function web_service()
        {
            $this->layout = FALSE;
            $this->autoRender = FALSE;
            Configure::write('debug', 0);
            $this->RequestHandler->respondAs('xml');
            App::import('Vendor', 'nusoap', array('file' => 'nusoap'.DS.'lib'.DS.'nusoap.php'));
            include 'local_functions.php';
            if ( !isset( $HTTP_RAW_POST_DATA ) ) $HTTP_RAW_POST_DATA =file_get_contents( 'php://input' );


            $server = new soap_server();
            $namespace = "http://localhost/web_service/web_service";
            $server->configureWSDL("web-service", $namespace);//, "urn:web-service");
            $server->wsdl->schemaTargetNamespace = $namespace;
            include 'wsdl_types.php';
            $server->register("Subscribe", array("accessKey" => "xsd:string","publisher" => "xsd:string","subscribeData" => "xsd:string"), array("return" => "xsd:string"), "urn:web-service", "urn:web-service#Subscribe", "rpc", "encoded", "Subscribe to mail …
Run Code Online (Sandbox Code Playgroud)

soap cakephp nusoap

0
推荐指数
1
解决办法
4828
查看次数

标签 统计

cakephp ×1

nusoap ×1

soap ×1