![](/img/trans.png)
[英]Error : Using Microsoft WebService.dll to canonicalize XML with Delphi7
[英]Xml syntax error 527 in delphi while using Tibxuspsship component
當我在Delphi中使用Tibxuspsship
組件生成運輸包裝標簽時,出現XML語法錯誤。 我已經嘗試過以PDF格式為usps生成shippinglabel的示例。 我已使用以下代碼生成運輸標簽。
procedure TfrmUspsAdd.BBPrintClick(Sender: TObject);
var nI,ntype : integer;
url,iUspsLabelFile : string;
Services : int64;
begin
url := 'http://testing.shippingapis.com/ShippingAPITest.dll';
// url := 'http://production.shippingapis.com/ShippingAPI.dll';
uspsship.Config('Certify=true');
uspsrates.USPSServer := url;
uspsrates.USPSUserId := 'ABCD';
uspsrates.USPSPassword := 'XYZ123';
USPSShip.SenderFirstName := 'John';
uspsship.SenderLastName := 'Smith';
uspsship.SenderAddress1 := '475 LEnfant Plaza, SW';
uspsship.SenderCity := 'Washington';
uspsship.SenderState := 'DC';
uspsship.SenderZipCode := '20260';
uspsship.RecipientFirstName := 'Jane';
uspsship.RecipientLastName := 'Smith';
uspsship.RecipientAddress1 := '8 Wildwood Drive';
uspsship.RecipientCity := 'Old Lyme';
uspsship.RecipientState := 'CT';
uspsship.RecipientZipCode := '06371';
uspsship.LabelImageType := TibxUspsshipLabelImageTypes(3); // for .Pdf format
uspsship.PackageCount := 1;
uspsship.PackageShippingLabelFile[0] := 'C:\DBS\Temp\test_label.pdf';
uspsship.LabelOption := '1';
uspsship.PackageHeight[0] := 2;
uspsship.PackageLength[0] := 2;
uspsship.PackageWeight[0] := '2 lbs 2 oz';
uspsship.PackageSignatureType[0] := stNoSignatureRequired;
ntype := 72;
uspsship.ServiceType := TibxUspsshipServiceTypes(nType);
try
uspsship.GetPackageLabel();
except
end;
label3.Caption := uspsship.PackageTrackingNumber[0];
end;
誰能幫我解決這個問題?
procedure TfrmUspsAdd.BBPrintClick(Sender: TObject);
var nI,ntype : integer;
url,iUspsLabelFile : string;
Services : int64;
begin
url := 'http://testing.shippingapis.com/ShippingAPITest.dll';
// url := 'http://production.shippingapis.com/ShippingAPI.dll';
uspsship.Config('Certify=true');
uspsship.USPSServer := url;
uspsship.USPSUserId := 'ABCD';
uspsship.USPSPassword := 'XYZ123';
USPSShip.SenderFirstName := 'John';
uspsship.SenderLastName := 'Smith';
uspsship.SenderAddress1 := '475 LEnfant Plaza, SW';
uspsship.SenderCity := 'Washington';
uspsship.SenderState := 'DC';
uspsship.SenderZipCode := '20260';
uspsship.RecipientFirstName := 'Jane';
uspsship.RecipientLastName := 'Smith';
uspsship.RecipientAddress1 := '8 Wildwood Drive';
uspsship.RecipientCity := 'Old Lyme';
uspsship.RecipientState := 'CT';
uspsship.RecipientZipCode := '06371';
uspsship.LabelImageType := TibxUspsshipLabelImageTypes(3); // for .Pdf format
uspsship.PackageCount := 1;
uspsship.PackageShippingLabelFile[0] := 'C:\DBS\Temp\test_label.pdf';
uspsship.LabelOption := '1';
uspsship.PackageHeight[0] := 2;
uspsship.PackageLength[0] := 2;
uspsship.PackageWeight[0] := '2 lbs 2 oz';
uspsship.PackageSignatureType[0] := stNoSignatureRequired;
ntype := 72;
uspsship.ServiceType := TibxUspsshipServiceTypes(nType);
try
uspsship.GetPackageLabel();
except
end;
label3.Caption := uspsship.PackageTrackingNumber[0];
end;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.