Jan 30, 2016
0
Level 1
NuSoap with Lumen
I have a webservice up and running using Nusoap. I want to migrate the code to Lumen. I have created a lumen project and installed Nusoap using composer. I have created a controller and added the routing path in routes.php. But i am facing a problem in generating the WSDL file . Please help me in figuring out the problem. The same piece of code is working fine without Lumen.
Controller Code:
<?php
namespace App\Http\Controllers;
use vendor\nusphere\nusoap\lib\soap_server;
use App\Enquiry;
use DB;
use Log;
class EnquiryController extends Controller
{
$namespace = "http://localhost:7070/enquiryWebService";
$server = new soap_server();
$server->configureWSDL("Enquiry");
$server->wsdl->schemaTargetNamespace = $namespace;
$server->register(
'get_enquiry',
array('enquiry_no'=>'xsd:string'),
array('return'=>'xsd:string'),
$namespace,
false,
'rpc',
'literal',
'retrive get_enquiry');
function get_enquiry($enquiry_no)
{
return 'enquriy is fojnd ';
}
$POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';
$server->service($POST_DATA);
exit();
}
}
?>
WSDL File:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<html>
<head>
<meta name="robots" content="noindex,nofollow"/>
<style>
/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html */ html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;} html { background: #eee; padding: 10px } img { border: 0; } #sf-resetcontent { width:970px; margin:0 auto; } .sf-reset { font: 11px Verdana, Arial, sans-serif; color: #333 } .sf-reset .clear { clear:both; height:0; font-size:0; line-height:0; } .sf-reset .clear_fix:after { display:block; height:0; clear:both; visibility:hidden; } .sf-reset .clear_fix { display:inline-block; } .sf-reset * html .clear_fix { height:1%; } .sf-reset .clear_fix { display:block; } .sf-reset, .sf-reset .block { margin: auto } .sf-reset abbr { border-bottom: 1px dotted #000; cursor: help; } .sf-reset p { font-size:14px; line-height:20px; color:#868686; padding-bottom:20px } .sf-reset strong { font-weight:bold; } .sf-reset a { color:#6c6159; cursor: default; } .sf-reset a img { border:none; } .sf-reset a:hover { text-decoration:underline; } .sf-reset em { font-style:italic; } .sf-reset h1, .sf-reset h2 { font: 20px Georgia, "Times New Roman", Times, serif } .sf-reset .exception_counter { background-color: #fff; color: #333; padding: 6px; float: left; margin-right: 10px; float: left; display: block; } .sf-reset .exception_title { margin-left: 3em; margin-bottom: 0.7em; display: block; } .sf-reset .exception_message { margin-left: 3em; display: block; } .sf-reset .traces li { font-size:12px; padding: 2px 4px; list-style-type:decimal; margin-left:20px; } .sf-reset .block { background-color:#FFFFFF; padding:10px 28px; margin-bottom:20px; -webkit-border-bottom-right-radius: 16px; -webkit-border-bottom-left-radius: 16px; -moz-border-radius-bottomright: 16px; -moz-border-radius-bottomleft: 16px; border-bottom-right-radius: 16px; border-bottom-left-radius: 16px; border-bottom:1px solid #ccc; border-right:1px solid #ccc; border-left:1px solid #ccc; } .sf-reset .block_exception { background-color:#ddd; color: #333; padding:20px; -webkit-border-top-left-radius: 16px; -webkit-border-top-right-radius: 16px; -moz-border-radius-topleft: 16px; -moz-border-radius-topright: 16px; border-top-left-radius: 16px; border-top-right-radius: 16px; border-top:1px solid #ccc; border-right:1px solid #ccc; border-left:1px solid #ccc; overflow: hidden; word-wrap: break-word; } .sf-reset a { background:none; color:#868686; text-decoration:none; } .sf-reset a:hover { background:none; color:#313131; text-decoration:underline; } .sf-reset ol { padding: 10px 0; } .sf-reset h1 { background-color:#FFFFFF; padding: 15px 28px; margin-bottom: 20px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; border: 1px solid #ccc; }
</style>
</head>
<body>
<div id="sf-resetcontent" class="sf-reset">
<h1>Whoops, looks like something went wrong.</h1>
<h2 class="block_exception clear_fix">
<span class="exception_counter">1/1</span>
<span class="exception_title">
<abbr title="ErrorException">ErrorException</abbr>
in
<a title="/var/www/testWebService/vendor/nusphere/nusoap/lib/class.xmlschema.php line 657" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">class.xmlschema.php line 657</a>
:
</span>
<span class="exception_message">array_diff(): Argument #2 is not an array</span>
</h2>
<div class="block">
<ol class="traces list_exception">
<li>
in
<a title="/var/www/testWebService/vendor/nusphere/nusoap/lib/class.xmlschema.php line 657" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">class.xmlschema.php line 657</a>
</li>
<li>
at
<abbr title="Laravel\Lumen\Application">Application</abbr>
->Laravel\Lumen\Concerns\{closure}('2', 'array_diff(): Argument #2 is not an array', '/var/www/testWebService/vendor/nusphere/nusoap/lib/class.xmlschema.php', '657',
<em>array</em>
('schemaPrefix' => 'xsd', 'xml' => ' <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" /> ', 'ns' => 'http://schemas.xmlsoap.org/wsdl/', 'list' =>
<em>array</em>
(
<em>array</em>
('location' => '', 'loaded' =>
<em>true</em>
)), 'ii' =>
<em>array</em>
('location' => '', 'loaded' =>
<em>true</em>
), 'attr' => '', 'el' => '<xsd:schema targetNamespace="http://localhost/soap/Enquiry" '))
</li>
<li>
at
<abbr title=""/>
array_diff(
<em>array</em>
('xsd' => 'http://www.w3.org/2001/XMLSchema'),
<em>null</em>
) in
<a title="/var/www/testWebService/vendor/nusphere/nusoap/lib/class.xmlschema.php line 657" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">class.xmlschema.php line 657</a>
</li>
<li>
at
<abbr title="vendor\nusphere\nusoap\lib\nusoap_xmlschema">nusoap_xmlschema</abbr>
->serializeSchema() in
<a title="/var/www/testWebService/vendor/nusphere/nusoap/lib/class.wsdl.php line 922" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">class.wsdl.php line 922</a>
</li>
<li>
at
<abbr title="vendor\nusphere\nusoap\lib\wsdl">wsdl</abbr>
->serialize(
<em>false</em>
) in
<a title="/var/www/testWebService/vendor/nusphere/nusoap/lib/soap_server.php line 287" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">soap_server.php line 287</a>
</li>
<li>
at
<abbr title="vendor\nusphere\nusoap\lib\nusoap_server">nusoap_server</abbr>
->service('') in
<a title="/var/www/testWebService/app/Http/Controllers/EnquiryController.php line 120" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">EnquiryController.php line 120</a>
</li>
<li>
at
<abbr title="App\Http\Controllers\EnquiryController">EnquiryController</abbr>
->Enquiry_check()
</li>
<li>
at
<abbr title=""/>
call_user_func_array(
<em>array</em>
(
<em>object</em>
(
<abbr title="App\Http\Controllers\EnquiryController">EnquiryController</abbr>
), 'Enquiry_check'),
<em>array</em>
()) in
<a title="/var/www/testWebService/vendor/illuminate/container/Container.php line 507" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Container.php line 507</a>
</li>
<li>
at
<abbr title="Illuminate\Container\Container">Container</abbr>
->call(
<em>array</em>
(
<em>object</em>
(
<abbr title="App\Http\Controllers\EnquiryController">EnquiryController</abbr>
), 'Enquiry_check'),
<em>array</em>
()) in
<a title="/var/www/testWebService/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 577" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">RoutesRequests.php line 577</a>
</li>
<li>
at
<abbr title="Laravel\Lumen\Application">Application</abbr>
->callControllerCallable(
<em>array</em>
(
<em>object</em>
(
<abbr title="App\Http\Controllers\EnquiryController">EnquiryController</abbr>
), 'Enquiry_check'),
<em>array</em>
()) in
<a title="/var/www/testWebService/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 544" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">RoutesRequests.php line 544</a>
</li>
<li>
at
<abbr title="Laravel\Lumen\Application">Application</abbr>
->callLumenController(
<em>object</em>
(
<abbr title="App\Http\Controllers\EnquiryController">EnquiryController</abbr>
), 'Enquiry_check',
<em>array</em>
(
<em>true</em>
,
<em>array</em>
('uses' => 'App\Http\Controllers\EnquiryController@Enquiry_check'),
<em>array</em>
())) in
<a title="/var/www/testWebService/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 517" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">RoutesRequests.php line 517</a>
</li>
<li>
at
<abbr title="Laravel\Lumen\Application">Application</abbr>
->callControllerAction(
<em>array</em>
(
<em>true</em>
,
<em>array</em>
('uses' => 'App\Http\Controllers\EnquiryController@Enquiry_check'),
<em>array</em>
())) in
<a title="/var/www/testWebService/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 485" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">RoutesRequests.php line 485</a>
</li>
<li>
at
<abbr title="Laravel\Lumen\Application">Application</abbr>
->callActionOnArrayBasedRoute(
<em>array</em>
(
<em>true</em>
,
<em>array</em>
('uses' => 'App\Http\Controllers\EnquiryController@Enquiry_check'),
<em>array</em>
())) in
<a title="/var/www/testWebService/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 470" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">RoutesRequests.php line 470</a>
</li>
<li>
at
<abbr title="Laravel\Lumen\Application">Application</abbr>
->handleFoundRoute(
<em>array</em>
(
<em>true</em>
,
<em>array</em>
('uses' => 'App\Http\Controllers\EnquiryController@Enquiry_check'),
<em>array</em>
())) in
<a title="/var/www/testWebService/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 372" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">RoutesRequests.php line 372</a>
</li>
<li>
at
<abbr title="Laravel\Lumen\Application">Application</abbr>
->Laravel\Lumen\Concerns\{closure}() in
<a title="/var/www/testWebService/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 620" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">RoutesRequests.php line 620</a>
</li>
<li>
at
<abbr title="Laravel\Lumen\Application">Application</abbr>
->sendThroughPipeline(
<em>array</em>
(),
<em>object</em>
(
<abbr title="Closure">Closure</abbr>
)) in
<a title="/var/www/testWebService/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 378" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">RoutesRequests.php line 378</a>
</li>
<li>
at
<abbr title="Laravel\Lumen\Application">Application</abbr>
->dispatch(
<em>object</em>
(
<abbr title="Illuminate\Http\Request">Request</abbr>
)) in
<a title="/var/www/testWebService/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 323" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">RoutesRequests.php line 323</a>
</li>
<li>
at
<abbr title="Laravel\Lumen\Application">Application</abbr>
->run(
<em>object</em>
(
<abbr title="Illuminate\Http\Request">Request</abbr>
)) in
<a title="/var/www/testWebService/public/index.php line 28" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">index.php line 28</a>
</li>
</ol>
</div>
</div>
</body>
</html>
Please or to participate in this conversation.