php curl soap 错误,<faultcode>soap:客户端</faultcode>无法在没有有效操作参数的情况下处理请求。请提供有效的肥皂操作。



我正在尝试通过 php 中的 curl 访问 soap 网络服务,但我收到错误消息,例如 soap:客户端无法在没有有效操作参数的情况下处理请求。请提供有效的肥皂操作。

我也尝试使用SOAPUI和Postman,但他们也出现了同样的错误。

SOAP XML:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Document-Invoice>
<Invoice-Header>
<InvoiceNumber>BIZ2020000000304</InvoiceNumber>
<InvoiceDate>2020-05-30</InvoiceDate>
<DocumentFunctionCode>O</DocumentFunctionCode>
<InvoiceProfile>BI</InvoiceProfile>
<MessageType>S</MessageType>
<Remarks>PO: P2320734</Remarks>
<Order>
<BuyerOrderNumber>P2320734</BuyerOrderNumber>
<BuyerOrderDate>2020-05-30</BuyerOrderDate>
</Order>
<Currency>
<InvoiceCurrency>TRL</InvoiceCurrency>
</Currency>
<Payment>
<PaymentMeans>42</PaymentMeans>
</Payment>
</Invoice-Header>
<Invoice-Parties>
<Buyer>
<ILN>9990000001049</ILN>
<TaxID>4840031463</TaxID>
<IDType>VKN</IDType>
<Name>Johnson and Johnson Sıhhi Malzeme San. Ve Tic. Ltd. Şti</Name>
<StreetName>Ertürk Sok  Kavacık</StreetName>
<BuildingNumber>No:13</BuildingNumber>
<BuildingName>Keçeli Pl.</BuildingName>
<District>Beykoz</District>
<CityName>İstanbul</CityName>
<CountryName>Türkiye</CountryName>
<Country>TR</Country>
<TaxOfficeName>Büyük Mükellefler</TaxOfficeName>
<PhoneNumber>0216 538 20 00</PhoneNumber>
<Fax>0216 538 22 99</Fax>
</Buyer>
<Seller>
<ILN>9996440256367</ILN>
<TaxID>6440256367</TaxID>
<IDType>VKN</IDType>
<Name>Bizofis Bilgi Teknolojileri ve Yönetim Danışmanlık Hizmetleri Ticaret Limited Şirketi</Name>
<Room>6</Room>
<StreetName>Matbuat Sok.</StreetName>
<BuildingNumber>17</BuildingNumber>
<BuildingName>Durukan İş Merkezi</BuildingName>
<District>ŞİŞLİ</District>
<CityName>İSTANBUL</CityName>
<PostalCode>34394</PostalCode>
<CountryName>TÜRKİYE</CountryName>
<Country>TR</Country>
<TaxOfficeName>Zincirlikuyu</TaxOfficeName>
<PhoneNumber>0212 212 18 98</PhoneNumber>
<Fax>0212 356 39 99</Fax>
<Website>www.bizofis.com</Website>
<AdditionalIdentification>
<Identification>
<Type>TICARETSICILNO</Type>
<Value>499957</Value>
</Identification>
<Identification>
<Type>MERSISNO</Type>
<Value>0-6440-2563-6700014</Value>
</Identification>
</AdditionalIdentification>
</Seller>
</Invoice-Parties>
<Invoice-Lines>
<Line>
<Line-Item>
<LineNumber>1</LineNumber>
<ManufacturerItemCode>9990000000008</ManufacturerItemCode>
<ItemName>Hizmet Bedeli </ItemName>
<InvoiceQuantity>1.000</InvoiceQuantity>
<UnitOfMeasure>NIU</UnitOfMeasure>
<InvoiceUnitNetPrice>1286.3500</InvoiceUnitNetPrice>
<NetAmount>1286.35</NetAmount>
<TaxAmount>231.54</TaxAmount>
</Line-Item>
<Line-Tax>
<Tax>
<TaxRate>18.00</TaxRate>
<TaxCategoryCode>0015</TaxCategoryCode>
<TaxCategory>KDV GERCEK</TaxCategory>
<TaxAmount>231.54</TaxAmount>
<TaxableAmount>1286.35</TaxableAmount>
</Tax>
</Line-Tax>
</Line>
</Invoice-Lines>
<Invoice-Summary>
<TotalLines>1</TotalLines>
<TotalNetAmount>1286.35</TotalNetAmount>
<TotalTaxableAmount>1286.35</TotalTaxableAmount>
<TotalTaxAmount>231.54</TotalTaxAmount>
<TotalGrossAmount>1517.89</TotalGrossAmount>
<TotalAllowanceAmount>0.00</TotalAllowanceAmount>
<TotalChargeAmount>0.00</TotalChargeAmount>
<TotalPayableAmount>1517.89</TotalPayableAmount>
<Tax-Summary>
<Tax-Summary-Line>
<TaxRate>18.00</TaxRate>
<TaxCategoryCode>0015</TaxCategoryCode>
<TaxCategory>KDV GERCEK</TaxCategory>
<TaxAmount>231.54</TaxAmount>
<TaxableAmount>1286.35</TaxableAmount>
</Tax-Summary-Line>
</Tax-Summary>
</Invoice-Summary>
</Document-Invoice>
</soap:Body>
</soap:Envelope>

卷曲代码

$url = 'https://www.ecod.pl/EcodWebService/EDIservice.asmx';
$CURL = curl_init();
curl_setopt($CURL, CURLOPT_URL, $url);
curl_setopt($CURL, CURLOPT_POST,true); 
curl_setopt($CURL, CURLOPT_POSTFIELDS, $xml_string); 
curl_setopt($CURL, CURLOPT_HEADER, 1); 
curl_setopt($CURL, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($CURL, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($CURL, CURLOPT_RETURNTRANSFER, true);
curl_setopt($CURL, curlOPT_VERBOSE, 1);
$headers = array(
"Content-type: text/xml; charset=utf-8",
"Accept: text/xml", 
'Content-Length: '.strlen($xml_string) 
); 
curl_setopt($CURL, CURLOPT_HTTPHEADER, $headers);
curl_setopt($CURL, CURLOPT_USERPWD, $username . ":" . $password);
$xmlResponse = curl_exec($CURL); 
$curlInfo = curl_getinfo($CURL, CURLINFO_HTTP_CODE);
// $curlInfo= curl_getinfo($CURL);
$errors = curl_error($CURL);
print_r($xmlResponse);
echo 'info=';print_r($curlInfo);
echo 'error=';print_r($errors);exit;

谁能帮我。谢谢

使用 SoapClient 只需要几行代码...但是,有几种方法可以配置某些内容,例如HTTPS,代理使用,缓存,超时...

// ToDo: Put in URL to WSDL
$live_wsdl = "..."; 
$params = [
'soap_version' => SOAP_1_2, 
'encoding' => 'UTF-8',
]; 
$soap = new SoapClient($live_wsdl, $params); 
try {
echo '<pre>';
var_dump($soap);
$funcs = $soap->__getFunctions();
$types = $soap->__getTypes();
print_r($funcs);
}
catch(Exception $e) {
var_dump($e);
}

基本上,您可以直接调用公开的 API 函数:$soap->DoSomeAction($param1, $param2, ...);

希望它有所帮助...

高频

相关内容

  • 没有找到相关文章

最新更新