Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
NetSuite NLAPIRestURL到UPS接收;“XML声明格式不正确”;错误_Xml_Soap_Netsuite_Ups - Fatal编程技术网

NetSuite NLAPIRestURL到UPS接收;“XML声明格式不正确”;错误

NetSuite NLAPIRestURL到UPS接收;“XML声明格式不正确”;错误,xml,soap,netsuite,ups,Xml,Soap,Netsuite,Ups,我正在尝试使用NetSuite Suitelet中的UPS评级API。当我使用nlapiRequestURL执行此操作时,我从UPS得到错误“XML声明格式不正确”。我一直盯着这个XML,找不到我做错了什么。有人有主意吗为什么我的XML格式不正确? <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xml

我正在尝试使用NetSuite Suitelet中的UPS评级API。当我使用nlapiRequestURL执行此操作时,我从UPS得到错误“XML声明格式不正确”。我一直盯着这个XML,找不到我做错了什么。有人有主意吗为什么我的XML格式不正确?

  <?xml version="1.0" encoding="utf-8"?>
  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Header>
          <UPSSecurity xmlns="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0">
              <UsernameToken>
                  <Username>xxxxxxxxx</Username>
                  <Password>xxxxxxxxx</Password>
              </UsernameToken>
              <ServiceAccessToken>
                  <AccessLicenseNumber>xxxxxxxxx</AccessLicenseNumber>
              </ServiceAccessToken>
          </UPSSecurity>
  </soap:Header>
  <soap:Body>
          <RateRequest xmlns="http://www.ups.com/XMLSchema/XOLTWS/Rate/v1.1">
              <Request xmlns="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0">
                  <RequestOption>rate</RequestOption>
              </Request>
              <CustomerClassification>
                  <Code>00</Code>
              </CustomerClassification>
              <Shipment>
                  <Shipper>
                      <ShipperNumber>xxxxxx</ShipperNumber>
                      <Address>
                          <StateProvinceCode>WA</StateProvinceCode>
                          <PostalCode>98134</PostalCode>
                          <CountryCode>US</CountryCode>
                      </Address>
                  </Shipper>
                  <ShipTo>
                      <Address>
                          <StateProvinceCode>CA</StateProvinceCode>
                          <PostalCode>90210</PostalCode>
                          <CountryCode>US</CountryCode>
                      </Address>
                  </ShipTo>
                  <ShipFrom>
                      <Address>
                          <StateProvinceCode>WA</StateProvinceCode>
                          <PostalCode>98134</PostalCode>
                          <CountryCode>US</CountryCode>
                      </Address>
                  </ShipFrom>
                      <Package>
                          <PackagingType><Code>00</Code></PackagingType> 
                          <Dimensions>
                              <UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement>
                              <Length>5</Length>
                              <Width>5</Width>
                              <Height>5</Height>
                          </Dimensions>
                          <PackageWeight>
                              <UnitOfMeasurement>
                                  <Code>lbs</Code>
                                  <Description>Pounds</Description>
                              </UnitOfMeasurement>
                              <Weight>5</Weight>
                          </PackageWeight>
                      </Package>               
                  <ShipmentRatingOptions>
                      <NegotiatedRatesIndicator>1</NegotiatedRatesIndicator>                    
                  </ShipmentRatingOptions>
                  <ShipmentServiceOptions>
                      <SaturdayDeliveryIndicator>1</SaturdayDeliveryIndicator>
                  </ShipmentServiceOptions>        
                  <Service>
                      <Code>14</Code><!-- code for the UPS Service associated with the shipment. see pg 47 of Rating XML pdf -->
                  </Service>        
              </Shipment>
          </RateRequest>
  </soap:Body>
  </soap:Envelope>

我复制并粘贴在这里,删除后“xmllint”通过了测试 XML声明之前的空格。你在那里有空间吗,或者那只是粘贴到其中的人工制品


-s

我复制并粘贴在这里,删除后,“xmllint”通过了测试 XML声明之前的空格。你在那里有空间吗,或者那只是粘贴到其中的人工制品


-哦,呸,就是这样!我甚至没有看到那个乱七八糟的地方。你太棒了,谢谢你!哦,大便,就是这样!我甚至没有看到那个乱七八糟的地方。你太棒了,谢谢你!