我正在使用 SOAP PHP 创建客户端 Sage X3,但我的请求 SOAP 失败。这是我的代码:
$xml='<PARAM>
<GRP ID="BPC0_1" >
<FLD NAME="BCGCOD" TYPE="Char" >CUS</FLD>
<FLD MENULAB="Oui" MENULOCAL="1" NAME="BPCSTA" TYPE="Integer" >2</FLD>
<FLD NAME="BPCNAM" TYPE="Char" >'.$shorte_name.'</FLD>
</GRP>
<GRP ID="BPRC_1" >
<FLD NAME="CRY" TYPE="Char" >MA</FLD>
<FLD NAME="LAN" TYPE="Char" >FRA</FLD>
<FLD NAME="CRN" TYPE="Char" >tnrte</FLD>
<FLD NAME="CUR" TYPE="Char" >MAD</FLD>
</GRP>
<TAB DIM="30" ID="BPAC_1" SIZE="1" >
<LIN NUM="1" >
<FLD NAME="CODADR" TYPE="Char" >addr</FLD>
<FLD NAME="BPADES" TYPE="Char" >'.$ville.'</FLD>
<FLD NAME="BPACRY" TYPE="Char" >MA</FLD>
<FLD NAME="CRYNAM" TYPE="Char" >Maroc</FLD>
<FLD NAME="ADDLIG1" TYPE="Char" >'.$adresse.'</FLD>
<FLD NAME="ADDLIG2" TYPE="Char" ></FLD>
<FLD NAME="ADDLIG3" TYPE="Char" ></FLD>
<FLD NAME="POSCOD" TYPE="Char" >'.$code_postal.'</FLD>
<FLD NAME="CTY" TYPE="Char" >'.$ville.'</FLD>
<FLD NAME="SAT" TYPE="Char" ></FLD>
<FLD NAME="TEL1" TYPE="Char" >'.$phone_fixe.'</FLD>
<FLD NAME="WEB1" TYPE="Char" >'.$web_site.'</FLD>
<FLD NAME="WEB3" TYPE="Char" ></FLD>
<FLD MENULAB="Non" MENULOCAL="1" NAME="BPAADDFLG" TYPE="Integer" >1</FLD>
</LIN>
</TAB>
<GRP ID="BPC3_1" >
<FLD NAME="ZACCCOD" TYPE="Char" ></FLD>
</GRP>
<GRP ID="BPC3_2" >
<FLD NAME="VACBPR" TYPE="Char" >AF</FLD>
</GRP>
<GRP ID="BPC3_3" >
<FLD NAME="PTE" TYPE="Char" >CH30D60D_1020</FLD>
</GRP>
</PARAM>';
$soapclient=new SoapClient($WSDL);
$callContext = array('codeLang'=>$CODE_LANG, 'codeUser'=>$CODE_USER, 'password'=>$PASSWORD, 'poolAlias'=>$POOL_ALIAS, 'requestConfig'=>$REQUEST_CONFIG);
$response = $soapclient->__soapCall('save', array($callContext, "YWSBPC", $xml), array( 'uri' => 'http://www.adonix.com/WSS', 'soapaction' => ''));}
不幸的是我的请求失败了,它返回了这个错误:
stdClass Object (
[messages] => Array (
[0] => stdClass Object (
[message] => Niveau d'accés insuffisant
[type] => 3
)
)
[resultXml] => [status] => 0
[technicalInfos] => stdClass Object (
[busy] =>
[changeLanguage] =>
[changeUserId] =>
[flushAdx] =>
[loadWebsDuration] => 0.055482
[nbDistributionCycle] => 1
[poolDistribDuration] => 1.134829
[poolEntryIdx] => 0
[poolExecDuration] => 383.223727
[poolRequestDuration] => 385.851035
[poolWaitDuration] => 1.492052
[processReport] =>
[processReportSize] => 0
[reloadWebs] =>
[resumitAfterDBOpen] =>
[rowInDistribStack] => 1
[totalDuration] => 391.547802
[traceRequest] =>
[traceRequestSize] => 0
)
)
我确信 WSDL 和上下文是正确的,因为我使用相同的代码来读取客户端并且它可以工作。
我也尝试使用 SoapUI 5.2.1 - 我使用了有效的 XML 请求,但我得到了同样的错误。