使用PHP使用此SOAP服务的正确方法

使用PHP使用此SOAP服务的正确方法,php,web-services,soap,adempiere,Php,Web Services,Soap,Adempiere,我正在尝试使用php使用此Web服务。 首先,我需要调用API方法进行登录。 这是我的密码: try { $opts = array( 'http' => array( 'user_agent' => 'PHPSoapClient' ) ); $context = stream_context_create($opts); $wsdlUrl = 'http://172.20.2.18:

我正在尝试使用php使用此Web服务。 首先,我需要调用API方法进行登录。 这是我的密码:

     try {
    $opts = array(
        'http' => array(
            'user_agent' => 'PHPSoapClient'
        )
    );
    $context = stream_context_create($opts);

    $wsdlUrl = 'http://172.20.2.18:1024/ADInterface/services/ModelADService?wsdl';

    $soapClientOptions = array(
        'stream_context' => $context,
        'cache_wsdl' => WSDL_CACHE_NONE);

    $checkVatParameters = array(
        'user'=>'WebService',
        'pass'=>'WebService',
        'lang'=>'es_CL',
        'ClientID'=>'1000000',
        'RoleID'=>'1000014',
        'OrgID'=>'1000000',
        'WarehouseID'=>'1000001',
        'stage'=>'0');

    $modelCrud = array(
        'serviceType' => 'WSBPartner',
        'TableName' => 'XX_WEB_WSBPartner',
        'RecordID' => 0,
        'Filter' => '',
        'Action' => 'Read',
        'DataRow' => array(
               'field' => array(
                   'type' => 'integer',
                   'column' => 'C_BPartner_ID',
                   'lval' => '',
                   'disp' => '',
                   'edit' => '',
                   'error' => '',
                   'errorVal' => '',
                   'val' => 1000643,
               )
           )
      );

    $client = new SoapClient($wsdlUrl, $soapClientOptions);

    $result = $client->queryData(
        'ModelCRUDRequest', array(
            'ModelCRUD' => $modelCrud,
            'ADLoginRequest' => $checkVatParameters,
        )
    );

    print_r($result);
}
catch(Exception $e) {
    echo $e->getMessage();
}
错误如下:参数ModelCrudeQuest不存在

我希望能够像queryData那样调用这些方法。我希望我解释得很好,这是我第一次使用Web服务。

有时候SoapClient只是一个坏工具。我将尝试使用curl或Guzzle作为HTTP客户端,并手动构建SOAP请求。我曾经根据以下命令生成一个示例SOAP请求

实例
你试过这个吗@谢谢你的工作!但是参数ModelCRUDRequest不存在!要更新我的问题,你必须传递SOAP方法所需的输入参数。@odan我只是用这个错误更新我的帖子,但同样的错误:你能帮我做一点示例吗?现在我仍然不知道您正在谈论的参数,如ADLoginRequest需要输入:userOne片刻,我将用一个示例更新我的答案。非常感谢您尝试echo'HTTP error:'。旋度误差$ch;要获得有关HTTP错误的更多详细信息,请参阅示例。是的,现在可以使用了,谢谢,我要请求参数allow。多谢各位