肥皂错误:请求时出现XML验证错误:cvc-complex-type.4:属性'Id'必须出现在元素上

时间:2012-11-05 12:31:29

标签: java php web-services soap soap-client

我从php程序请求java soap web服务。我的代码就像关注

<?php
 $options = array('features' => 
    SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS);
try{
     $sClient = new SoapClient('http://192.168.1.101:8080/person/Person.wsdl');
    //  $sClient = new SoapClient('http://192.168.1.11:8080/DNAHMS/webservice/onlineBooking/Hotel.wsdl',$options);
        //$params = array('Id'=> '1');
        echo "<pre>";
        print_r($sClient->__getFunctions());
        echo "</pre>";

        $parms  = array("Id"=>1);
        $response = $sClient->__call('getPerson',$parms);
        echo "<pre>";
        print_r($response);
        echo "</pre>";





    } catch(SoapFault $e){
        echo "<pre>";
            var_dump($e);
        echo "<pre>";
    }
    ?>

这里我是Person.wsdl,当我直接调用浏览器它没有错误,并且这是有效的xml文件。 当我运行这个时,我会得到如下的肥皂故障:

cvc-complex-type.4:属性'Id'必须出现在元素'ns1:GetPersonRequest'上 任何帮助都会感激不尽

1 个答案:

答案 0 :(得分:0)