有创建过Web service的哥们请教几个问题

countstars 2007-12-03 01:29:11
使用SOAP扩展,如何创建WSDL文档?无WSDL文档,其他语言能调用么?SOAP扩展提供了无WSDL调用方式,
另外SOAP扩展中函数参数都表示什么含义?location, uri,等等,只有example,都没有注释,烦恼中。
还有最好能解释一下SOAPVar等相关的调用有什么用途,谢谢
...全文
124 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzkd 2007-12-04
  • 打赏
  • 举报
回复
久不见深空出现了..呵.
shagoo 2007-12-03
  • 打赏
  • 举报
回复
NuSoap http://sourceforge.net/projects/nusoap/

<?php
// Pull in the NuSOAP code
require_once('lib/nusoap.php');

// Define the method as a PHP function
function hello($name) {
return 'Hello, '.$name;
}

//echo '<pre>';print_r($_SERVER);echo '</pre>';
$_SERVER['HTTPS'] = isset($_SERVER['HTTPS']) ? "on" : "off";
// Create the server instance
$server = new soap_server();
// Initialize WSDL support
$server->configureWSDL('hellowsdl', 'urn:hellowsdl');
// Put the WSDL schema types in the namespace with the tns prefix
$server->wsdl->schemaTargetNamespace = 'urn:hellowsdl';
$soap_defencoding = 'ISO-8859-1';
$server->soap_defencoding='ISO-8859-1';
// Register the method to expose
$server->register('hello', // method name
array('name' => 'xsd:string'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:hellowsdl', // namespace
'urn:hellowsdl#hello', // soapaction
'rpc', // style
'encoded', // use
'Says hello to the caller' // documentation
);

// Use the request to (try to) invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
kakapowu 2007-12-03
  • 打赏
  • 举报
回复
用ZDE 的工具吧,自动将函数或者类生成wsdl。
TR@SOE 2007-12-03
  • 打赏
  • 举报
回复
我一般会用VS来创建WS的服务器。
Meteorlet 2007-12-03
  • 打赏
  • 举报
回复
WSDL文档有工具可以生成的,.net里就有,WSDL就是web service的接口描述,也就是说有了wsdl才能知道怎么跟web service打交道,
如果没有wsdl,但是你知道web service的接口的话,也同样可以进行通信。通信无非就是xml文本,只要格式符合web service的要求即可。
uri一般作为命名空间使用。
zilong32 2007-12-03
  • 打赏
  • 举报
回复
关注中,现在状态和楼主一样,郁闷中...
Aylazhang 2007-12-03
  • 打赏
  • 举报
回复
soap只用过 NuSOAP http://sourceforge.net/projects/nusoap/
先用用现成的也许有助于理解。呵呵

SysTem128 2007-12-03
  • 打赏
  • 举报
回复
我们的深空也来提问了……看来这问题不简单.

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧