Это HTML-форма, когда я отправляю форму, она дает следующую ошибку
Неустранимая ошибка: необработанное исключение SoapFault: [WSDL] SOAP-ERROR: синтаксический анализ WSDL: невозможно загрузить из
‘../../../wsdl/ShipService_v17.wsdl’: не удалось загрузить внешнюю сущность
«../../../wsdl/ShipService_v17.wsdl» в
D: \ хостинг \ 10722104 \ HTML \ FedEx \ PHP \ ShipWebServiceClient \ Экспресс \ Domestic \ ShipWebServiceClient.php5: 17
Трассировка стека: # 0
D: \ хостинг \ 10722104 \ HTML \ FedEx \ PHP \ ShipWebServiceClient \ Экспресс \ Domestic \ ShipWebServiceClient.php5 (17):
SoapClient-> SoapClient (‘../../../ wsdl / S …’, Array) # 1 {main}
в
D: \ хостинг \ 10722104 \ HTML \ FedEx \ PHP \ ShipWebServiceClient \ Экспресс \ Domestic \ ShipWebServiceClient.php5
на линии 17
` <form id="form1" method="post" action="php/ShipWebServiceClient/Express /Domestic/ShipWebServiceClient.php5">
<div class="from_box">
<div class="top_from_hed">Fill out this Form to Get<br />FREE <img src="https://web-answers.ru/wp-content/uploads/2019/02/fed-ex-butoon.png" />Shiping! </div>
<div class="all_felds">1. What are you sending?<br />
<input name="" type="checkbox" value=""onclick="showfirstbox(); " name="sending" /> Diamond <input name="" type="checkbox" value="" /> Gold <input name="" type="checkbox" value="" /> Silver <br />
<br /><br />
<input type="radio" name="printll" id="secondbox" />Print label
<table width="259" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="91" height="29">First Name:</td>
<td width="10"> </td>
<td width="162">
<label>
<input type="text" name="fname" id="textfield" />
</label>
</form> </td>
</tr>
<tr>
<td width="91" height="28">Last Name:</td>
<td width="10"> </td>
<td width="162">
<label>
<input type="text" name="lname" id="textfield" />
</label>
</td>
</tr>
<tr>
<td width="91" height="27">Street Address:</td>
<td width="10"> </td>
<td width="162">
<label>
<input type="text" name="street" id="textfield" />
</label>
</td>
</tr>
<tr>
<td width="91" height="27">Email Address:</td>
<td width="10"> </td>
<td width="162">
<label>
<input type="text" name="eeemail" id="textfield" />
</label>
</td>
</tr><tr>
<td width="91" height="28">Apt/Suite:</td>
<td width="10"> </td>
<td width="162">
<label>
<input type="text" name="textfield" id="textfield" />
</label>
</td>
</tr><tr>
<td width="91" height="27">City:</td>
<td width="10"> </td>
<td width="162">
<label>
<input type="text" name="city" id="textfield" />
</label>
</td>
</tr><tr>
<td width="91" height="27">Country:</td>
<td width="10"> </td>
<td width="162">
<label>
<input type="text" name="country" id="textfield" />
</label>
</td>
</tr><tr>
<td width="91" height="27">State:</td>
<td width="10"> </td>
<td width="162">
<label>
<input type="text" name="state_hid" id="textfield" />
</label>
</td>
</tr><tr>
<td width="91" height="28">Zip Code:</td>
<td width="10"> </td>
<td width="162">
<label>
<input type="text" name="postalcode" id="textfield" />
</label>
</td>
</tr>
<tr>
<td width="91" height="26">Phone no:</td>
<td width="10"> </td>
<td width="162">
<label>
<input type="text" name="phone" id="textfield" />
</label>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><table width="157" height="19" border="0" cellpadding="0" ce llspacing="0">
<tr>
<td width="30"> </td>
<td width="74"><div class="submit_from_hed">
<a href="#"><font color="#333333">
<input type="submit"name="fdesubmit" value="submit" /></font></a>
</div></td>
<td width="53"> </td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><table width="156" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="28"> </td>
<td width="128"> </td>
</tr>
</table></td>
</tr>
</table>`
Это код, который я использую для интеграции формы fedex
`<?php
// Copyright 2009, FedEx Corporation. All rights reserved.
// Version 12.0.0
require_once('../../../library/fedex-common.php5');
//The WSDL is not included with the sample code.
//Please include and reference in $path_to_wsdl variable.
$path_to_wsdl = "../../../wsdl/ShipService_v17.wsdl";
define('SHIP_LABEL', time() . '.png'); // PNG label file. Change to file-extension .pdf for creating a PDF label (e.g. shiplabel.pdf)
ini_set("soap.wsdl_cache_enabled", "0");
ini_set("soap.wsdl_cache", "0");
ini_set("display_errors","On");
ini_set("track_errors","On");
$client = new SoapClient($path_to_wsdl, array('trace' => 1));
$name='';
$invoice_num='INV' . time() * 3;
$option=$_REQUEST['option'];
$request['WebAuthenticationDetail'] = array(
'UserCredential' =>array(
'Key' => getProperty('key'),
'Password' => getProperty('password')
)
);
$request['ClientDetail'] = array(
'AccountNumber' => getProperty('shipaccount'),
'MeterNumber' => getProperty('meter')
);
$request['TransactionDetail'] = array('CustomerTransactionId' => '*** Express Domestic Shipping Request using PHP ***');
$request['Version'] = array(
'ServiceId' => 'ship',
'Major' => '10',
'Intermediate' => '0',
'Minor' => '0'
);
$request['RequestedShipment'] = array(
'ShipTimestamp' => date('c'),
'DropoffType' => 'REGULAR_PICKUP',
'ServiceType' => 'FEDEX_EXPRESS_SAVER',
'PackagingType' => 'YOUR_PACKAGING',
'Shipper' => addShipper(),
'Recipient' => addRecipient(),
'ShippingChargesPayment' => addShippingChargesPayment(),
'SpecialServicesRequested' => addSpecialServices(),
'LabelSpecification' => addLabelSpecification(),
'PackageCount' => 1,
'RequestedPackageLineItems' => array(
'0' => addPackageLineItem1()
)
);
try {
if(setEndpoint('changeEndpoint')){
$newLocation = $client->__setLocation(setEndpoint('endpoint'));
}
$response = $client->processShipment($request); // FedEx web service invocation
if ($response->HighestSeverity != 'FAILURE' && $response->HighestSeverity != 'ERROR'){
printSuccess($client, $response);
$fp = fopen('../label/' . SHIP_LABEL, 'wb');
fwrite($fp, $response->CompletedShipmentDetail->AssociatedShipments->Label->Parts->Image); //Create COD Return PNG or PDF file
fclose($fp);
$message1="Transaction Successful<br>";
if($option==$_POST['printll'])
{
$link=SHIP_LABEL;
$message='<div id="label1" style="margin-bottom:-10px;">
<div id="number"></div>
<div id="message"><a href="'.'../print_label.php?id='. $link .'"> <h3 style="color:#666;">Click here to print your label</h3></a>
</div>
</div>';
$message.='<div id="label1">
<a href="http://www.fedex.com/Dropoff/start"><div id="second"> </div></a>
</div>';
$message.='<div id="label1">
<div id="third"></div>
</div>';
}
}else{
writeToLog($client); } // Write to log file
}
catch (SoapFault $exception) {
printFault($exception, $client);
}
function addShipper(){
$name=$_POST['fname'] . " " . $_POST['lname'];
$shipper = array(
'Contact' => array(
'PersonName' => $name,
'CompanyName' => '',
'PhoneNumber' => $_POST['phone'],
'Email' => $_POST['eeemail'],
),
'Address' => array(
'StreetLines' => array($_POST['street']),
'City' => $_POST['city'],
'StateOrProvinceCode' => $_REQUEST['state_hid'],
'PostalCode' => $_REQUEST['postalcode'],
'CountryCode' => $_REQUEST['country'])
);
return $shipper;
}
function addRecipient(){
$recipient = array(
'Contact' => array(
'Contact' => array(
'PersonName' => 'CRJ Inc',
'CompanyName' => 'CRJ Inc c/o NDB',
'PhoneNumber' => '800-574-8820'),
'Address' => array(
'StreetLines' => array('4010 Oak Circle'),
'City' => 'Boca Raton',
'StateOrProvinceCode' => 'FL',
'PostalCode' => '33431',
'CountryCode' => 'US',
'Residential' => false)
)
) ;
return $recipient ;
}
function addShippingChargesPayment(){
$shippingChargesPayment = array('PaymentType' => 'SENDER',
'Payor' => array(
'ResponsibleParty' => array(
'AccountNumber' => getProperty('billaccount'),
'Contact' => null,
'Address' => array(
'CountryCode' => 'US')
)
)
);
return $shippingChargesPayment;
}
function addLabelSpecification(){
$labelSpecification = array(
'LabelFormatType' => 'COMMON2D', // valid values COMMON2D, LABEL_DATA_ONLY
'ImageType' => 'PNG', // valid values DPL, EPL2, PDF, ZPLII and PNG
'LabelStockType' => 'PAPER_7X4.75'
);
return $labelSpecification;
}
function addSpecialServices1(){
$specialServices = array(
'SpecialServiceTypes' => array('COD'),
'CodDetail' => array(
'CodCollectionAmount' => array(
'Currency' => 'USD',
'Amount' => 150
),
'CollectionType' => 'ANY' // ANY, GUARANTEED_FUNDS
)
);
return $specialServices;
}
function addCustomClearanceDetail(){
$customerClearanceDetail = array(
'DutiesPayment' => array(
'PaymentType' => 'SENDER', // valid values RECIPIENT, SENDER and THIRD_PARTY
'Payor' => array(
'AccountNumber' => getProperty('dutyaccount'),
'CountryCode' => 'CA'
)
),
'DocumentContent' => 'NON_DOCUMENTS',
'CustomsValue' => array(
'Currency' => 'USD',
'Amount' => 20.0
),
'Commodities' => array(
'0' => array(
'NumberOfPieces' => 1,
'Description' => 'Books',
'CountryOfManufacture' => 'US',
'Weight' => array(
'Units' => 'LB',
'Value' => 1.0
),
'CustomsValue' => array(
'Currency' => 'USD',
'Amount' => 20.000000
)
)
),
'ExportDetail' => array(
'B13AFilingOption' => 'NOT_REQUIRED'
)
);
return $customerClearanceDetail;
}
function addPackageLineItem1(){
$packageLineItem = array(
'SequenceNumber'=>1,
'GroupPackageCount'=>1,
'InsuredValue' => array(
'Amount' => 20.00,
'Currency' => 'USD'
),
'Weight' => array(
'Value' => 1.0,
'Units' => 'LB'
),
'Dimensions' => array(
'Length' => 20,
'Width' => 10,
'Height' => 10,
'Units' => 'IN'
),
'CustomerReferences' => array(
'0' => array(
'CustomerReferenceType' => 'CUSTOMER_REFERENCE',
'Value' => 'GR' . time() * 7
), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY
'1' => array(
'CustomerReferenceType' => 'INVOICE_NUMBER',
'Value' => $invoice_num
),
'2' => array(
'CustomerReferenceType' => 'P_O_NUMBER',
'Value' => 'PO' .time() * 5
)
)
);
return $packageLineItem;
}
?>
`
Пожалуйста, найдите мне какое-то решение для этого, чтобы я мог создавать ярлыки с веб-сайта
Задача ещё не решена.
Других решений пока нет …