【问题标题】:FedEx web Integration ERROR CODE 9004FedEx 网络集成错误代码 9004
【发布时间】:2016-01-14 08:48:26
【问题描述】:

我正在尝试将 FedEx 的跟踪服务集成到我的 web 应用程序中,但我不断收到此错误..

严重性:失败
来源:prxy
代码:9004
消息: 远程 EJB 方法:未调用跟踪。无法创建远程 bean。 异常:javax.naming.NamingException:无法找到主要 代表【根异常为 javax.naming.NamingException: 无法 寻找主要代表]。原因:javax.naming.NamingException: 无法找到主要代表 [根例外是 javax.naming.NamingException: 找不到主要代表]

请求

<?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>

回应

<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>

我正在使用 Laravel 框架,此 Fedex 集成使用了三个文件,即包含 XML 数据的 TrackService_v10.wsdl,包含发送请求的 php 函数的 TrackWebServiceClient.php5 和 fedex-common.php5其中还包含包含要发布的输入的 php 函数。

我尝试在 Internet 和 FedEx 上的开发人员和资源中心上到处寻找,但我真的无法让它工作。我也不明白这个 SOAP 请求。此外,联邦快递说他们没有程序员来帮助我。有人可以帮忙吗?提前致谢。

【问题讨论】:

    标签: php soap fedex


    【解决方案1】:

    我遇到了完全相同的问题。在桌子上敲了几个小时后,我发现了这篇文章 - https://stackoverflow.com/a/10941234/5632365。它属于 WSDL 文件的 v5(当前为 10),但基本上您需要从第 2296 行的 URL 中删除“beta”。

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

    应该是

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

    神奇地一切都会(应该)开始工作。希望这对您和我一样有帮助!

    【讨论】:

    • 是的! Ît 工作:) .. 非常感谢。已经尝试了 36 个小时来让这个东西正常工作。最后!!谢谢
    • 注意,就目前而言,保持 wsbeta 应该可以工作。我现在删除它时遇到问题。
    【解决方案2】:

    删除beta 似乎不再是一个好的解决方案。

    我已与 Fedex 支持人员联系,当您设置无效的“ParentCredentials”时,问题实际上就出现了。

    在我的情况下,我只需要使用“UserCredential”,如果在 Fedex 提供的 (Java) 示例中为空,则“ParentCredentials”设置为“XXX”。

    【讨论】:

      猜你喜欢
      • 2013-10-29
      • 1970-01-01
      • 1970-01-01
      • 2017-04-02
      • 2014-08-11
      • 2023-01-10
      • 2011-05-15
      • 1970-01-01
      • 2017-09-06
      相关资源
      最近更新 更多