- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在我的网络服务上返回一个 mysql_query 但相同获取数据但返回空数组。
我正在尝试获取如下数据:
array(
0=>array('id'=>int,'nome'=>string,'voltagem'=>int, 'potencia'=>doube, 'standby'=>doube)
);
<?php
include("/lib/nusoap.php");
$servidor = new soap_server();
$servidor->configureWSDL("urn:Servidor");
$servidor->wsdl->schemaTargetNamespace = "urn:Servidor";
$servidor->wsdl->addComplexType(
'produto',
'complexType',
'struct',
'all',
'',
array(
'id' => array('name'=>'id', 'type'=>'xsd:int'),
'nome' => array('name'=>'nome', 'type'=>'xsd:string'),
'voltagem' => array('name'=>'voltagem','type'=>'xsd:int'),
'potencia' => array('name'=>'potencia','type'=>'xsd:int'),
'standby' => array('name'=>'standby', 'type'=>'xsd:int')
)
);
$servidor->register( 'buscar',
array('produtonome'=>'xsd:string'),
array('retorno'=>'tns:produto'),
'urn:Servidor.buscar',
'urn:Servidor.buscar',
'rpc',
'econded',
'apenas um exemplo usando o nuSuop PHP'
);
function buscar($produtonome){
$db = new mysqli('localhost', 'root', '', 'produto');
if($db->connect_errno > 0){
die('Unable to connect to database [' . $db->connect_error . ']');
}
$sql = <<<SQL SELECT * FROM `produto` LIMIT 1 SQL;
if(!$result = $db->query($sql)){
die('There was an error running the query [' . $db->error . ']');
}
while($row = $result->fetch_assoc()){
$dados['id'] = $row['id'];
$dados['nome'] = $row['nome'];
$dados['voltagem'] = $row['voltagem'];
$dados['potencia'] = $row['potencia'];
$dados['standby'] = $row['standby'];
}
}
$HTTP_RAW_POST_DATA = (isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : 'teste');
$servidor->service($HTTP_RAW_POST_DATA);
?>
最佳答案
经过几个小时的尝试,我决定返回带有 json 的搜索。其他人有同样的错误但没有成功。肥皂上的一些错误
关于php - nuSoap 网络服务服务器不返回 mysql 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30277114/
我在 stackoverflow 上的某处读到,使用 NuSoap 不是一个好主意,它已经死了。如果是,创建 WSDL 文件的最佳解决方案是什么。我只是 nusoap 只是为了创建 wsdl 文件,我
我在使用 NuSOAP 传输文件时遇到问题。我知道您可以读取文件并将其作为字符串传输,但它不起作用。这是一个例子: 客户: require('libraries/nusoap/nusoap.php')
require_once('soap/nusoap.php'); $soap = new soap_server(); $soap->configureWSDL('ClientSecurityServ
我是这方面的新手,也是编程新手。我正在尝试创建一个基于 nusoap 和 php 的 Web 服务,以便它从 mysql 数据库传递一些值。我浏览了许多网站(包括堆栈溢出答案),发现了一些我尝试过但尚
使用 .NET WCF 网络服务时,我收到以下响应(错误): Unsupported HTTP response status 415 Cannot process the message becau
无法弄清楚如何使 NuSOAP 使用 UTF-8 作为内容类型。它不断吐出“ISO-8859-1”。这是我尝试过的相关代码位: $soapclient=new soapclient($url1,'ws
我正在用 php 编写 soap 服务器和 soap 客户端。对于 soap 服务的身份验证,我想使用“usernametoken”来确保安全。任何人都可以将使用 nusoap 在服务器和客户端中应用
当尝试实例化我的 nuSoap 方法 authenticateUser 时,它说: Fatal error: Uncaught SoapFault exception: [Client] Functi
我有 NuSOAP 网络服务器:... $server->register('getMembersEvents', array('date' => 'xsd:str
您好,我正在为 nusoap 服务器使用此代码,但是当我在 Web 浏览器中调用服务器时,它显示消息“此服务不提供 Web 描述”这是代码 register('hello'); // create t
我正在使用 PHP 中的 NuSoap 库构建 Web 服务。我的网络服务将充当客户端和供应商已经存在的网络服务之间的中间层。因此,客户端不会直接连接到供应商,而是连接到我的 Web 服务,我的 We
我有一个 php 类,我想将它与 Nusoap 一起使用.我可以使用 register 命令注册 nusoap 中已经存在的类方法吗? 示例: 在这里我们注册了一个我们在这个脚本中定义的函数。但是如果
我想在我的网络服务中返回一个字符串数组 我试过: configureWSDL('NewsService', 'urn:NewsService'); $server->register('GetAllN
我在尝试发送重复标签时遇到了 NuSOAP 问题。这是我需要发送的代码: string1 string2 我正在使用以下代码进行通话: $pn[] = 'APPSP2101
我想在 Laravel 5.3 和 PHP7 上使用 nusoap。但是当我尝试使用那个包中的 composer 安装它时: https://github.com/codecasts/nusoap-p
我正在使用 nosoap 在 PHP 中开发 Web 服务。这是我的文件,webservice.php configureWSDL('myWS', $namespace); $server->wsdl
我正在使用 NuSOAP 尝试使用以 Java 构建的 Web 服务。到目前为止我有这段代码: 'John'); echo $client->call('Hey', $param); unset($c
我一直在使用 nuSOAP 在 PHP 中编写演示 Web 服务。 我想知道 nuSOAP 对 SOAP PHP5 类的优势是什么。 另外,这是一个用作模型的测试网络服务。 我想知道我应该测试哪些典型
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
目前我使用的是 PHP 版本 5.4.16 和 NuSoap 0.95,我试过这个例子: here 它显示了这样的服务器代码; $server->wsdl->addComplexType( '
我是一名优秀的程序员,十分优秀!