Link to home
Start Free TrialLog in
Avatar of codeoxygen
codeoxygen

asked on

fedex using php

i have written a code to get shipping rates from fedex, it is giving error
==============================================================
==============================================================
<?xml version="1.0" encoding="UTF-8"?>
<FDXRateReply xsi:noNamespaceSchemaLocation="FDXRateReply.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://com/fedex/ws/transform">
   <ReplyHeader>
      <CustomerTransactionIdentifier>Express Rate</CustomerTransactionIdentifier>
   </ReplyHeader>
   <Error>
      <Code>101232</Code>
      <Message>Shipment only fields are not allowed for this request.</Message>
   </Error>
</FDXRateReply>



have attached xml code i am sending to fedex thru CURL.

pls help asap
fedex.txt
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

For others looking at this question, here is the contents of the attached file "fedex.txt."

 $str = '<?xml version="1.0" encoding="UTF-8" ?>';
        $str .= '    <FDXRateRequest xmlns:api="http://www.fedex.com/fsmapi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FDXRateRequest.xsd">';
        $str .= '        <RequestHeader>';
        $str .= '            <CustomerTransactionIdentifier>Express Rate</CustomerTransactionIdentifier>';
        $str .= '            <AccountNumber>'.$this->accountNumber.'</AccountNumber>';
        $str .= '            <MeterNumber>'.$this->meterNumber.'</MeterNumber>';
        $str .= '            <CarrierCode>'.$this->carrierCode.'</CarrierCode>';
        $str .= '        </RequestHeader>';
        $str .= '        <DropoffType>'.$this->dropoffType.'</DropoffType>';
        $str .= '        <Service>'.$this->service.'</Service>';
        $str .= '        <Packaging>'.$this->packaging.'</Packaging>';
        $str .= '        <WeightUnits>'.$this->weightUnits.'</WeightUnits>';
        $str .= '        <Weight>'.number_format($this->weight, 1, '.', '').'</Weight>';
        $str .= '        <OriginAddress>';
        $str .= '            <StateOrProvinceCode>'.$this->originStateOrProvinceCode.'</StateOrProvinceCode>';
        $str .= '            <PostalCode>'.$this->originPostalCode.'</PostalCode>';
        $str .= '            <CountryCode>'.$this->originCountryCode.'</CountryCode>';
        $str .= '        </OriginAddress>';
        $str .= '        <DestinationAddress>';
        $str .= '            <StateOrProvinceCode>'.$this->destStateOrProvinceCode.'</StateOrProvinceCode>';
        $str .= '            <PostalCode>'.$this->destPostalCode.'</PostalCode>';
        $str .= '            <CountryCode>'.$this->destCountryCode.'</CountryCode>';
        $str .= '        </DestinationAddress>';
        $str .= '        <Payment>';
        $str .= '            <PayorType>'.$this->payorType.'</PayorType>';
        $str .= '        </Payment>';
        $str .= '        <PackageCount>'.ceil(bcdiv(number_format($this->weight, 1, '.', ''), '150', 3)).'</PackageCount>';
        $str .= '    </FDXRateRequest>';

Open in new window

The error code does not even seem to be documented.  What did Fedex customer support tell you about it?
http://www.fedex.com/us/developer/product/WebServices/MyWebHelp_August2010/Content/Proprietary_Developer_Guide/Error_Codes_conditionalized.htm
ASKER CERTIFIED SOLUTION
Avatar of ltlbearand3
ltlbearand3
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial