Pankaj Lohia
Pankaj Lohia

Reputation: 121

FedEx web Integration ERROR CODE 9004

I am trying to integrate the tracking services of FedEx on to my webapp and I keep getting this error..

Severity: FAILURE
Source: prxy
Code: 9004
Message: Remote EJB method: track not called. Unable to create the remote bean. Exception: javax.naming.NamingException: unable to find primary representative [Root exception is javax.naming.NamingException: unable to find primary representative]. Cause: javax.naming.NamingException: unable to find primary representative [Root exception is javax.naming.NamingException: unable to find primary representative]

Request

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-      ENV="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:ns1="http://fedex.com/ws/track/v10"><SOAP-ENV:Body><ns1:TrackRequest> <ns1:WebAuthenticationDetail><ns1:ParentCredential><ns1:Key>#########</ns1:Key><ns1:Password>###########</ns1:Password></ns1:ParentCredential><ns1:UserCredential><ns1:Key>#############</ns1:Key><ns1:Password>###########</ns1:Password></ns1:UserCredential></ns1:WebAuthenticationDetail><ns1:ClientDetail><ns1:AccountNumber>#########</ns1:AccountNumber><ns1:MeterNumber>###########</ns1:MeterNumber></ns1:ClientDetail><ns1:TransactionDetail><ns1:CustomerTransactionId>*** Track  using PHP ***</ns1:CustomerTransactionId></ns1:TransactionDetail><ns1:Version><ns1:ServiceId>trck</ns1:ServiceId><ns1:Major>10</ns1:Major><ns1:Intermediate>0</ns1:Intermediate><ns1:Minor>0</ns1:Minor></ns1:Version><ns1:SelectionDetails><ns1:PackageIdentifier> <ns1:Type>TRACKING_NUMBER_OR_DOORTAG</ns1:Type><ns1:Value>449044304137821</ns1:Value></ns1:PackageIdentifier><ns1:ShipmentAccountNumber>########</ns1:ShipmentAccountNumber> </ns1:SelectionDetails></ns1:TrackRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>

Response

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><TrackReply xmlns="http://fedex.com/ws/track/v10"><HighestSeverity>FAILURE</HighestSeverity><Notifications><Severity>FAILURE</Severity><Source>prxy</Source><Code>9004</Code><Message>Remote EJB method: track not called. Unable to create the remote bean. Exception: javax.naming.NamingException: unable to find primary representative [Root exception is javax.naming.NamingException: unable to find primary representative]. Cause: javax.naming.NamingException: unable to find primary representative [Root exception is javax.naming.NamingException: unable to find primary representative]</Message></Notifications></TrackReply></SOAP-ENV:Body></SOAP-ENV:Envelope>

I am using the Laravel framework and there are three files used for this Fedex integration, i.e., TrackService_v10.wsdl which contains the XML data, TrackWebServiceClient.php5 which contains the php functions to send a request and the fedex-common.php5 which also contains the php functions containing the input to post.

I have tried looking everywhere on the internet and the Developer and resource center on FedEx but I really cant get it working. I also dont understand this SOAP requests. Also, FedEx says they dont have programmers to help me with this. Can anyone please help? Thanks in advance.

Upvotes: 3

Views: 1989

Answers (2)

alain.janinm
alain.janinm

Reputation: 20065

Removing beta doesn't seem to be the good solution anymore.

I've been in contact with Fedex support and the issue actually comes when you set invalid "ParentCredentials".

In my case I only have to use "UserCredential", "ParentCredentials" was set to "XXX" if empty in the (Java) example provided by Fedex.

Upvotes: 0

John Hackett
John Hackett

Reputation: 40

I have been having the exact same issue. After banging my head on the desk for hours, I came across this post - https://stackoverflow.com/a/10941234/5632365. It pertains to v5 of the WSDL file (current is 10), but basically you need to remove "beta" from the URL on line 2296.

<service name="TrackService">
    <port name="TrackServicePort" binding="ns:TrackServiceSoapBinding">
      <s1:address location="https://wsbeta.fedex.com:443/web-services/track"/>
    </port>
</service>

Should be

<service name="TrackService">
    <port name="TrackServicePort" binding="ns:TrackServiceSoapBinding">
      <s1:address location="https://ws.fedex.com:443/web-services/track"/>
    </port>
</service>

And magically everything will (should) start to work. Hope this helps you as much as it did me!

Upvotes: 1

Related Questions