dtsnx44260 2012-11-05 12:31
浏览 460
已采纳

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

i am requesting the java soap web services from the php program. My code is like follow

<?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>";
    }
    ?>

here i am Person.wsdl when i call directly to browser it has no error and aslo this is valid xml file. when i run this i will get soap fault like below :

cvc-complex-type.4: Attribute 'Id' must appear on element 'ns1:GetPersonRequest' Any help will appreciate by hearty

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 如何使用simulink建立一个永磁同步直线电机模型?
  • ¥30 天体光谱图的的绘制并得到星表
  • ¥15 PointNet++的onnx模型只能使用一次
  • ¥20 西南科技大学数字信号处理
  • ¥15 有两个非常“自以为是”烦人的问题急期待大家解决!
  • ¥30 STM32 INMP441无法读取数据
  • ¥15 R语言绘制密度图,一个密度曲线内fill不同颜色如何实现
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗