如何修复SOAP-ERROR:编码:对象没有属性?

时间:2019-05-22 19:59:37

标签: php soap

我在使用SOAP时遇到问题,我读了很多文章以帮助自己,但我遇到了同样的错误。我需要将数据发送到ADempiere Webservice。

  

致命错误:SOAP错误:编码:对象中没有'ModelCRUD'属性

我不知道问题出在数组还是类似的东西

$url = "https://url/ADInterface/services/ModelADService?wsdl";
        $infoSoap = array(
            'ModelCRUDRequest' => array(
                'ModelCRUD' => array(
                    'serviceType' => 'WSExists',
                    'TableName' => 'TableName'
                    'DataRow' => array(
                        'field' => array(
                            'column' => 'Name',
                            'val' => 'Test Val',
                        )
                    )
                ),
                'ADLoginRequest' => array(
                    'user' => '',
                    'pass' => '',
                    'lang' => '',
                    'ClientID' => '1000000',
                    'RoleID' => '',
                    'OrgID' => '0',
                    'WarehouseID' => '0',
                    'stage' => '0',
                )
            ),
        );


try {

            $client = new SoapClient($url, array(
                "uri" => "http://3e.pl/ADInterface",
                'use' => SOAP_LITERAL,
                "encoding" => "UTF-8",
                "trace" => 1,
                "exceptions" => 0,
                "cache_wsdl" => 0));
            $result = $client->readData($infoSoap);
            $xmlResultObj = simplexml_load_string($result);

            echo $xmlResultObj;

            return true;
        } catch (SoapFault $exc) {
            echo $exc->getMessage();
        }

我不知道为什么会出现此错误,我在互联网上寻找任何解决方案,但他们没有。

我添加了此XML。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:adin="http://3e.pl/ADInterface">
   <soapenv:Header/>
   <soapenv:Body>
      <adin:readData>
         <adin:ModelCRUDRequest>
            <adin:ModelCRUD>
               <adin:serviceType>?</adin:serviceType>
               <adin:TableName>?</adin:TableName>
               <adin:RecordID>?</adin:RecordID>
               <adin:Filter>?</adin:Filter>
               <adin:Action>?</adin:Action>
               <adin:PageNo>?</adin:PageNo>

               <adin:DataRow>

                  <adin:field type="?" column="?" lval="?" disp="?" edit="?" error="?" errorVal="?">
                     <adin:val>?</adin:val>

                  </adin:field>
               </adin:DataRow>
            </adin:ModelCRUD>
            <adin:ADLoginRequest>
               <adin:user>?</adin:user>
               <adin:pass>?</adin:pass>
               <adin:lang>?</adin:lang>
               <adin:ClientID>?</adin:ClientID>
               <adin:RoleID>?</adin:RoleID>
               <adin:OrgID>?</adin:OrgID>
               <adin:WarehouseID>?</adin:WarehouseID>
               <adin:stage>?</adin:stage>
            </adin:ADLoginRequest>
         </adin:ModelCRUDRequest>
      </adin:readData>
   </soapenv:Body>
</soapenv:Envelope>

0 个答案:

没有答案