Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用PHP在Acumatica ERP上通过web服务保存数据_Php_.net_Web Services_Soap_Acumatica - Fatal编程技术网

如何使用PHP在Acumatica ERP上通过web服务保存数据

如何使用PHP在Acumatica ERP上通过web服务保存数据,php,.net,web-services,soap,acumatica,Php,.net,Web Services,Soap,Acumatica,我试图通过acumatica上的web服务保存客户数据。但我得到了这个错误: SoapFault对象 ( [消息:受保护]=>System.Web.Services.Protocols.SoapException:服务器无法处理请求。-->System.NullReferenceException:对象引用未设置为对象的实例。 在PX.Api.SyImportContext.ParseCommand处(SyCommand cmd) 位于PX.Api.SyExportContext.a(SYMap

我试图通过acumatica上的web服务保存客户数据。但我得到了这个错误:

SoapFault对象 ( [消息:受保护]=>System.Web.Services.Protocols.SoapException:服务器无法处理请求。-->System.NullReferenceException:对象引用未设置为对象的实例。 在PX.Api.SyImportContext.ParseCommand处(SyCommand cmd) 位于PX.Api.SyExportContext.a(SYMappingField a_0) 在System.Linq.Enumerable.WhereSelectArrayInterator
2.MoveNext()中
位于System.Collections.Generic.List
1..ctor(IEnumerable
1集合)
at System.Linq.Enumerable.ToList[t源](IEnumerable
1源) 在PX.Api.SyExportContext..ctor(SYMapping映射、IEnumerable
1字段、String[]providerFields、Dictionary
2视图过滤器、布尔BreakError、Int32 start、Int32 count、LinkedSelectorView SelectorView、String rowFilterField) 在PX.Api.ScreenUtils.Submit(String screenId,Command[]commands,SchemaMode SchemaMode,PXGraph&graph,String&redirectContainerView,String&redirectScreen,Boolean mobile,Dictionary
2视图过滤器)
在PX.Api.Services.ScreenService.Submit(字符串id、IEnumerable
1命令、SchemaMode SchemaMode、Boolean mobile、PXGraph&forceGraph、String&redirectContainerView、String&redirectScreen、Dictionary
2视图过滤器)
在PX.Api.Services.ScreenService.Submit(字符串id,IEnumerable
1命令,SchemaMode SchemaMode) 在PX.Api.Soap.Screen.ScreenGate.Submit(Command[]commands)

下面是我的代码:

require_once('AcumaticaGate.php');

$client = new AcumaticaGate("username", "password",'AR303000','http://host/acumatica/Soap');

$schema         = $client->Schema->GetSchemaResult;

$customer           = $schema->CustomerSummary->CustomerID;
$customer_name      = $schema->CustomerSummary->CustomerName;
$customer_status    = $schema->CustomerSummary->Status;
$customer_class     = $schema->GeneralInfoFinancialSettings->CustomerClass;
$cycle_id           = $schema->GeneralInfoFinancialSettings->StatementCycleID;
$credit             = $schema->GeneralInfoCreditVerificationRules->RemainingCreditLimit;
$country            = $schema->GeneralInfoMainAddress->Country;
$sales_account      = $schema->GLAccounts->SalesAccount;
$cash_discount      = $schema->GLAccountsCashDiscountAccount->CashDiscountAccount;

$command = array();
array_push($command, $client->PrepareValue('101923', $schema->CustomerSummary->CustomerID));
array_push($command, $client->PrepareValue('Richard Chambula Test Acc', $customer_name));
array_push($command, $client->PrepareValue('On Hold', $customer_status));
array_push($command, $client->PrepareValue('DEFAULT', $customer_class));
array_push($command, $client->PrepareValue('EOM', $cycle_id));
array_push($command, $client->PrepareValue('Disabled', $credit));
array_push($command, $client->PrepareValue('NA', $country));
array_push($command, $client->PrepareValue('5011', $sales_account));
array_push($command, $client->PrepareValue('8302', $cash_discount));

array_push($command, $schema->Actions->Save);
$submit = new Submit();
$submit->commands = $command;

try
{
    $submit_result = $client->Client->Submit($submit);
}
catch(Exception $e)
{
    echo "<PRE>";
    print_r($e);
}
require_once('AcumaticaGate.php');
$client=new AcumaticaGate(“用户名”、“密码”、“AR303000”和“http://host/acumatica/Soap');
$schema=$client->schema->GetSchemaResult;
$customer=$schema->CustomerSummary->CustomerID;
$customer\u name=$schema->CustomerSummary->CustomerName;
$customer\u status=$schema->CustomerSummary->status;
$customer\u class=$schema->GeneralInfoFinancialSettings->CustomerClass;
$cycle\u id=$schema->GeneralInfoFinancialSettings->StatementCycleID;
$credit=$schema->GeneralInfoCreditVerificationRules->RemainingCreditLimit;
$country=$schema->GeneralInfoMainAddress->country;
$sales\u account=$schema->GLAccounts->salessaccount;
$cash\u折扣=$schema->GLAccountsCashDiscountAccount->CashDiscountAccount;
$command=array();
数组\u push($command,$client->PrepareValue('101923',$schema->CustomerSummary->CustomerID));
数组推送($command,$client->PrepareValue($Richard Chambula Test Acc',$customer_name));
数组_push($command,$client->PrepareValue($On Hold',$customer_status));
数组推送($command,$client->PrepareValue('DEFAULT',$customer_class));
数组推送($command,$client->PrepareValue($EOM',$cycle\u id));
数组推送($command,$client->PrepareValue($Disabled',$credit));
数组推送($command,$client->PrepareValue('NA',$country));
数组推送($command,$client->PrepareValue($5011',$sales\u account));
数组推送($command,$client->PrepareValue('8302',$cash\u折扣));
数组推送($command,$schema->Actions->Save);
$submit=新提交();
$submit->commands=$command;
尝试
{
$submit\u result=$client->client->submit($submit);
}
捕获(例外$e)
{
回声“;
印刷品(港币);;
}

您应该将您的状态设置为“H”以等待。这是一个单字符字段。Acumatica中的大多数下拉列表是值字段和描述符字段的组合。

您使用的是Acumatica 5.3还是6.0?我使用的是Acumatica 5.3