2016-09-15 116 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服务所期望的。