客户端调用webservice出现问题急!!!!!!!!!!!!!!!!!!!

binglingxiaolingling 2010-08-17 12:48:48
我用php调用一个接口可是却总掉不到方法,
它给的wsdl文档是这样的:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://aaa.ws.boss.huashu.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://aaa.ws.boss.huashu.com" xmlns:intf="http://aaa.ws.boss.huashu.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.2.1
Built on Aug 08, 2005 (11:49:10 PDT)-->

<wsdl:message name="authenticationRequest">

<wsdl:part name="in0" type="xsd:string"/>

</wsdl:message>

<wsdl:message name="authenticationResponse">

<wsdl:part name="authenticationReturn" type="xsd:string"/>

</wsdl:message>

<wsdl:portType name="AAAService">

<wsdl:operation name="authentication" parameterOrder="in0">

<wsdl:input message="impl:authenticationRequest" name="authenticationRequest"/>

<wsdl:output message="impl:authenticationResponse" name="authenticationResponse"/>

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="AAAServiceSoapBinding" type="impl:AAAService">

<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl:operation name="authentication">

<wsdlsoap:operation soapAction=""/>

<wsdl:input name="authenticationRequest">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://aaa.ws.boss.huashu.com" use="encoded"/>

</wsdl:input>

<wsdl:output name="authenticationResponse">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://aaa.ws.boss.huashu.com" use="encoded"/>

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name="AAAServiceService">

<wsdl:port binding="impl:AAAServiceSoapBinding" name="AAAService">

<wsdlsoap:address location="http://10.26.111.240:10001"/>

</wsdl:port>

</wsdl:service>

</wsdl:definitions>




我的php代码是这样的:
require_once($mosConfig_absolute_path."/includes/shinyv/nusoap.php");
$s=new soapclient($this->_serviceUrl);
//echo $this->_serviceUrl;exit;
$s->soap_defencoding = 'ISO-8859-1';
$s->decode_utf8 = false;
$s->xml_encoding = 'ISO-8859-1';
$result=$s->call('authentication', $this->getXml());



可是总掉不到authentication的方法,服务器地址也对,但是报错,


错误如下:
SOAP-ENV:Client: Method 'ns4951:authentication' not implemented: method name or namespace not recognized<xmp
...全文
174 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Luffy_龙 2010-08-17
  • 打赏
  • 举报
回复
Boolean authUser(String userName, String password)
功能:認證使用者帳號與密碼的函式。
說明:如果帳號密碼正確則傳回Boolean-True,否則傳回Boolean-False。
參數 :userName : 使用者帳號 password : 使用者密碼

String getAttr(String userName,String password,String attr)
功能:取得使用者所在單位名稱。
說明:如果帳號密碼正確則傳回所欲取得的屬性,否則傳回空字串。
參數 :userName : 使用者帳號 password : 使用者密碼
attr : 欲回傳的屬性
Luffy_龙 2010-08-17
  • 打赏
  • 举报
回复
<?php $client = new SoapClient("http://localhost/ldapService.do?wsdl");
$handle1 = $client->authUser(array("in0" => "userName","in1" =>"password"));
$handle2 = $client->getAttr(array("in0" => "userName","in1" =>"password","in2"=>"givenName"));
echo ((int)($handle1->out)); echo $handle2->out;
?>
Luffy_龙 2010-08-17
  • 打赏
  • 举报
回复
我写的webserver 貌似和你的不一样 - -
我的文档很简单。
<?php $client = new SoapClient("http://localhost/ldapService.do?wsdl");
$handle1 = $client->authUser(array("in0" => "userName","in1" =>"password"));
$handle2 = $client->getAttr(array("in0" => "userName","in1" =>"password","in2"=>"givenName"));
echo ((int)($handle1->out)); echo $handle2->out;
?>
纠结的木棉花 2010-08-17
  • 打赏
  • 举报
回复
好复杂
Dleno 2010-08-17
  • 打赏
  • 举报
回复
似乎你应该调用的方法是AAAService,传入参数是authenticationRequest(即:array('authenticationRequest'=>'值'))

20,359

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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