2016-09-15 159 views
2

對不起,英語不好。 嗨,我正在使用magento中的SOAP API。但是當我通過SOAP發送數據時,我遇到了異常。我有兩個 magentos。 magento1magento2。它的工作很好,當我這陣直接從magento1發送到SOAP我我沒有任何問題,但在我的情況,我必須通過青煙magento1發送這個數據magento2。比在magento2經過一些處理後,我使用soap將這些數據發送給第三方。但我收到異常我發送相同的數組使用相同的代碼,但在magento2我得到這個錯誤。Magento SOAP API錯誤

[Message] => The string '1473935705' is not a valid AllXsd value. 

這是有效的值'1473935705'我使用time()函數來得到這個。 這裏是數組,我公司通過SOAP

Array 
(
    [Shipments] => Array 
     (
      [0] => Array 
       (
        [Shipper] => Array 
         (
          [Reference1] => 100000076 
          [Reference2] => 
          [AccountNumber] => 5185 
          [PartyAddress] => Array 
           (
            [Line1] => Area 223, Block 12 
            [Line2] => 
            [Line3] => 
            [City] => Manama 
            [StateOrProvinceCode] => Manama 
            [PostCode] => 00973 
            [CountryCode] => BH 
           ) 

          [Contact] => Array 
           (
            [Department] => 
            [PersonName] => Ahmed Nagi 
            [Title] => 
            [CompanyName] => Ahmed Nagi 
            [PhoneNumber1] => 33161479 
            [PhoneNumber1Ext] => 
            [PhoneNumber2] => 
            [PhoneNumber2Ext] => 
            [FaxNumber] => 
            [CellPhone] => 33161479 
            [EmailAddress] => [email protected] 
            [Type] => 
           ) 

         ) 

        [Consignee] => Array 
         (
          [Reference1] => 100000076 
          [Reference2] => 
          [AccountNumber] => 5185 
          [PartyAddress] => Array 
           (
            [Line1] => Road: 123, Block:801 
            [Line2] => 
            [Line3] => 
            [City] => Manama 
            [StateOrProvinceCode] => Manama 
            [PostCode] => 00973 
            [CountryCode] => BH 
           ) 

          [Contact] => Array 
           (
            [Department] => 
            [PersonName] => Samsung Inc 
            [Title] => 
            [CompanyName] => Samsung Inc 
            [PhoneNumber1] => 1122334 
            [PhoneNumber1Ext] => 
            [PhoneNumber2] => 
            [PhoneNumber2Ext] => 
            [FaxNumber] => 
            [CellPhone] => 1122334 
            [EmailAddress] => [email protected] 
            [Type] => 
           ) 

         ) 

        [Reference1] => 100000076 
        [Reference2] => 
        [Reference3] => 
        [ForeignHAWB] => 
        [TransportType] => 0 
        [ShippingDateTime] => 1473935705 
        [DueDate] => 1474540505 
        [PickupLocation] => Reception 
        [PickupGUID] => 
        [Comments] => 
        [AccountingInstrcutions] => 
        [OperationsInstructions] => 
        [Details] => Array 
         (
          [Dimensions] => Array 
           (
            [Length] => 0 
            [Width] => 0 
            [Height] => 0 
            [Unit] => cm 
           ) 

          [ActualWeight] => Array 
           (
            [Value] => 0.6 
            [Unit] => KG 
           ) 

          [ProductGroup] => DOM 
          [ProductType] => BLK 
          [PaymentType] => P 
          [PaymentOptions] => 
          [Services] => 
          [NumberOfPieces] => 2 
          [DescriptionOfGoods] => iPhone 6S 128GB Gold - 1.0000, iPad Air 2 Wi-Fi Cell 64GB Gold - 1.0000 
          [GoodsOriginCountry] => BH 
          [Items] => Array 
           (
            [0] => Array 
             (
              [PackageType] => Box 
              [Quantity] => 1 
              [Weight] => Array 
               (
                [Value] => 0.100 
                [Unit] => Kg 
               ) 

              [Comments] => iPhone 6S 128GB Gold 
              [Reference] => 
             ) 

            [1] => Array 
             (
              [PackageType] => Box 
              [Quantity] => 1 
              [Weight] => Array 
               (
                [Value] => 0.500 
                [Unit] => Kg 
               ) 

              [Comments] => iPad Air 2 Wi-Fi Cell 64GB Gold 
              [Reference] => 
             ) 

           ) 

          [CashOnDeliveryAmount] => Array 
           (
            [Value] => 
            [CurrencyCode] => BHD 
           ) 

          [CustomsValueAmount] => Array 
           (
            [Value] => 
            [CurrencyCode] => BHD 
           ) 

         ) 

       ) 

     ) 

    [ClientInfo] => Array 
     (
      [AccountCountryCode] => BH 
      [AccountEntity] => BAH 
      [AccountNumber] => 5185 
      [AccountPin] => 432432 
      [UserName] => [email protected] 
      [Password] => R123456789$r 
      [Version] => v1.0 
      [Source] => 31 
     ) 

    [LabelInfo] => Array 
     (
      [ReportID] => 9729 
      [ReportType] => URL 
     ) 

) 

回答

1

送我發現我使用時間()是問題。但是當我使用 日期(「c」,time());其工作正常。
在日期函數中使用參數'c',它將返回一個ISO 8601日期,這是Web服務所期望的。