devain Posted March 6, 2008 Share Posted March 6, 2008 Hello Everyone I am having issues with fexex's new soap and WSDL web services. I am trying to get tracking results with their new service was wondering if I can get some help on this. I am attaching the code, and the wsdl What am I doing wrong?? Here are two of the links that fedex gave me two are in the wsdl file and one I dont know what to do with and fedex was no help they did provide the following code which I am posting below it consists of three files the wsdl, a functions file for error and tracking and the track.php code which is suppose to be loaded via http Track.php file require_once('library/fedex-common.php5'); $newline = "<br />"; $path_to_wsdl = "wsdl/TrackService_v2.wsdl"; ini_set("soap.wsdl_cache_enabled", "0"); $client = new SoapClient($path_to_wsdl, array('trace' => 'all')); // Refer to http://us3.php.net/manual/en/ref.soap.php for more information $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => 'Nu7mKVoi6CruG3BH', 'Password' => '2WTI0OChPx1U7yprVqjosFpM7')); // Replace 'XXX' and 'YYY' with FedEx provided credentials $request['ClientDetail'] = array('AccountNumber' => '510087542', 'MeterNumber' => '1220784');// Replace 'XXX' with your account and meter number $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Track Request v2 using PHP ***'); $request['Version'] = array('ServiceId' => 'trck', 'Major' => '2', 'Intermediate' => '0', 'Minor' => '0'); $request['PackageIdentifier'] = array('Value' => '963051995450', 'Type' => 'TRACKING_NUMBER_OR_DOORTAG'); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Track Request v2 using PHP ***'); $request['IncludeDetailedScans'] = 1; try{ $response = $client ->track($request); if ($response -> HighestSeverity != 'FAILURE' && $response -> HighestSeverity != 'ERROR') { print $response; foreach ($response -> TrackDetails -> Events as $event) { if(is_array($response -> TrackDetails -> Events)) { echo $event -> Timestamp . ': '; echo $event -> EventDescription . ' - '; echo $event -> Address -> City . ' '; echo $event -> Address -> StateOrProvinceCode . $newline; } else { echo $location . $newline; } } printRequestResponse($client); } else { echo 'Error in processing transaction.'. $newline. $newline; foreach ($response -> Notifications as $notification) { if(is_array($response -> Notifications)) { echo $notification -> Severity; echo ': '; echo $notification -> Message . $newline; } else { echo $notification . $newline; } } } writeToLog($client); // Write to log file } catch (SoapFault $exception) { printFault($exception, $client); } library/fedex-common.php5 define('TRANSACTIONS_LOG_FILE', 'fedextransactions.log'); // Transactions log file /** * Print SOAP request and response */ function printRequestResponse($client) { echo "test $trackingnumber"; echo '<h2>Transaction processed successfully.</h2>'. "\n"; echo '<h2>Request</h2>' . "\n"; echo '<pre>' . htmlspecialchars($client->__getLastRequest()). '</pre>'; echo "\n"; echo '<h2>Response</h2>'. "\n"; echo '<pre>' . htmlspecialchars($client->__getLastResponse()). '</pre>'; echo "\n"; } /** * Print SOAP Fault */ function printFault($exception, $client) { echo '<h2>Fault</h2>' . "\n"; echo "<b>Code:</b>{$exception->faultcode}<br>\n"; echo "<b>String:</b>{$exception->faultstring}<br>\n"; writeToLog($client); } /** * SOAP request/response logging to a file */ function writeToLog($client){ if (!$logfile = fopen(TRANSACTIONS_LOG_FILE, "a")) { error_func("Cannot open " . TRANSACTIONS_LOG_FILE . " file.\n", 0); exit(1); } fwrite($logfile, sprintf("\r%s:- %s",date("D M j G:i:s T Y"), $client->__getLastRequest(). "\n\n" . $client->__getLastResponse())); } Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/ Share on other sites More sharing options...
devain Posted March 6, 2008 Author Share Posted March 6, 2008 I cannot attach the wsdl file its to big I get the following error when executing the script CODE:HTTP String:Could not connect to host Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-485136 Share on other sites More sharing options...
rofl90 Posted March 6, 2008 Share Posted March 6, 2008 host it in .txt and give us a link pls. Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-485163 Share on other sites More sharing options...
devain Posted March 6, 2008 Author Share Posted March 6, 2008 I fixed the code:http error now I am getting the following error Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '/home/eye123/public_html/track/wsdl/TrackService_v2.wsdl' in /home/eye123/public_html/track/Track.php:15 Stack trace: #0 /home/eye123/public_html/track/Track.php(15): SoapClient->SoapClient('wsdl/TrackServi...', Array) #1 {main} thrown in /home/eye123/public_html/track/Track.php on line 15 link is eyeglasses123.com Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-485198 Share on other sites More sharing options...
devain Posted March 6, 2008 Author Share Posted March 6, 2008 sorry eyeglasses123.com/track/Track.php Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-485199 Share on other sites More sharing options...
devain Posted March 6, 2008 Author Share Posted March 6, 2008 nope still getting http code error Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-485205 Share on other sites More sharing options...
devain Posted March 6, 2008 Author Share Posted March 6, 2008 Has anyone gotton this to work? Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-485231 Share on other sites More sharing options...
devain Posted March 6, 2008 Author Share Posted March 6, 2008 wsdl file is located here eyeglasses123.com/track/wsdl/TrackService_v2.wsdl Has anyone tried to use this method to connect to fedex for tracking information Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-485426 Share on other sites More sharing options...
devain Posted March 7, 2008 Author Share Posted March 7, 2008 Anyone ? Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-485729 Share on other sites More sharing options...
rofl90 Posted March 7, 2008 Share Posted March 7, 2008 Sorry mate, out of my depth, hope your getting payed well! Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-485770 Share on other sites More sharing options...
hsingh Posted October 29, 2012 Share Posted October 29, 2012 Hello Everyone I am having issues with fexex's new soap and WSDL web services. I am trying to get tracking results with their new service was wondering if I can get some help on this. I am attaching the code, and the wsdl What am I doing wrong?? Here are two of the links that fedex gave me two are in the wsdl file and one I dont know what to do with and fedex was no help they did provide the following code which I am posting below it consists of three files the wsdl, a functions file for error and tracking and the track.php code which is suppose to be loaded via http Track.php file require_once('library/fedex-common.php5'); $newline = "<br />"; $path_to_wsdl = "wsdl/TrackService_v2.wsdl"; ini_set("soap.wsdl_cache_enabled", "0"); $client = new SoapClient($path_to_wsdl, array('trace' => 'all')); // Refer to http://us3.php.net/manual/en/ref.soap.php for more information $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => 'Nu7mKVoi6CruG3BH', 'Password' => '2WTI0OChPx1U7yprVqjosFpM7')); // Replace 'XXX' and 'YYY' with FedEx provided credentials $request['ClientDetail'] = array('AccountNumber' => '510087542', 'MeterNumber' => '1220784');// Replace 'XXX' with your account and meter number $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Track Request v2 using PHP ***'); $request['Version'] = array('ServiceId' => 'trck', 'Major' => '2', 'Intermediate' => '0', 'Minor' => '0'); $request['PackageIdentifier'] = array('Value' => '963051995450', 'Type' => 'TRACKING_NUMBER_OR_DOORTAG'); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Track Request v2 using PHP ***'); $request['IncludeDetailedScans'] = 1; try{ $response = $client ->track($request); if ($response -> HighestSeverity != 'FAILURE' && $response -> HighestSeverity != 'ERROR') { print $response; foreach ($response -> TrackDetails -> Events as $event) { if(is_array($response -> TrackDetails -> Events)) { echo $event -> Timestamp . ': '; echo $event -> EventDescription . ' - '; echo $event -> Address -> City . ' '; echo $event -> Address -> StateOrProvinceCode . $newline; } else { echo $location . $newline; } } printRequestResponse($client); } else { echo 'Error in processing transaction.'. $newline. $newline; foreach ($response -> Notifications as $notification) { if(is_array($response -> Notifications)) { echo $notification -> Severity; echo ': '; echo $notification -> Message . $newline; } else { echo $notification . $newline; } } } writeToLog($client); // Write to log file } catch (SoapFault $exception) { printFault($exception, $client); } library/fedex-common.php5 define('TRANSACTIONS_LOG_FILE', 'fedextransactions.log'); // Transactions log file /** * Print SOAP request and response */ function printRequestResponse($client) { echo "test $trackingnumber"; echo '<h2>Transaction processed successfully.</h2>'. "\n"; echo '<h2>Request</h2>' . "\n"; echo '<pre>' . htmlspecialchars($client->__getLastRequest()). '</pre>'; echo "\n"; echo '<h2>Response</h2>'. "\n"; echo '<pre>' . htmlspecialchars($client->__getLastResponse()). '</pre>'; echo "\n"; } /** * Print SOAP Fault */ function printFault($exception, $client) { echo '<h2>Fault</h2>' . "\n"; echo "<b>Code:</b>{$exception->faultcode}<br>\n"; echo "<b>String:</b>{$exception->faultstring}<br>\n"; writeToLog($client); } /** * SOAP request/response logging to a file */ function writeToLog($client){ if (!$logfile = fopen(TRANSACTIONS_LOG_FILE, "a")) { error_func("Cannot open " . TRANSACTIONS_LOG_FILE . " file.\n", 0); exit(1); } fwrite($logfile, sprintf("\r%s:- %s",date("D M j G:i:s T Y"), $client->__getLastRequest(). "\n\n" . $client->__getLastResponse())); } Hi devain, Have you solved out this problem? Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-1388399 Share on other sites More sharing options...
Philip Posted October 29, 2012 Share Posted October 29, 2012 I don't think so, considering its been 4 years Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-1388475 Share on other sites More sharing options...
Beeeeney Posted October 29, 2012 Share Posted October 29, 2012 I don't think so, considering its been 4 years Wouldn't that make you assume that the problem has been solved? Quote Link to comment https://forums.phpfreaks.com/topic/94750-fedex-new-web-services-wsdl-and-soap/#findComment-1388477 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.