How to get full tracking info (Fedex Webservices)? - web-services

If I use the Fedex Tracking tool from website (https://www.fedex.com) I can see every activity with its details (like location). But, when I use Fedex Webservice, I don't get the same info. I only get detailed info for the current status, but I also need to get the details of previous statuses.
In the documentation is not described a flag or something I need to add to my request to retrieve the full info as in the Fedex Website.
Here's the SOAP Envelope I send in my request.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v16="http://fedex.com/ws/track/v16">
<soapenv:Header/>
<soapenv:Body>
<v16:TrackRequest>
<v16:WebAuthenticationDetail>
<v16:UserCredential>
<v16:Key>XXXXXXXXXXX</v16:Key>
<v16:Password>XXXXXXXXX</v16:Password>
</v16:UserCredential>
</v16:WebAuthenticationDetail>
<v16:ClientDetail>
<v16:AccountNumber>XXXXXXXXX</v16:AccountNumber>
<v16:MeterNumber>XXXXXXXXXXX</v16:MeterNumber>
</v16:ClientDetail>
<v16:TransactionDetail>
<v16:CustomerTransactionId>Track By Number_v16</v16:CustomerTransactionId>
<v16:Localization>
<v16:LanguageCode>EN</v16:LanguageCode>
<v16:LocaleCode>US</v16:LocaleCode>
</v16:Localization>
</v16:TransactionDetail>
<v16:Version>
<v16:ServiceId>trck</v16:ServiceId>
<v16:Major>16</v16:Major>
<v16:Intermediate>0</v16:Intermediate>
<v16:Minor>0</v16:Minor>
</v16:Version>
<v16:SelectionDetails>
<v16:CarrierCode>FDXE</v16:CarrierCode>
<v16:PackageIdentifier>
<v16:Type>TRACKING_NUMBER_OR_DOORTAG</v16:Type>
<v16:Value>783202918813</v16:Value>
</v16:PackageIdentifier>
<v16:PagingDetail></v16:PagingDetail>
<v16:SecureSpodAccount/>
<v16:Destination>
</v16:Destination>
</v16:SelectionDetails>
</v16:TrackRequest>
</soapenv:Body>
</soapenv:Envelope>

According to this documentation I found (page 606), you need to include a ProcessingOptions object on your TrackRequest with the value of INCLUDE_DETAILED_SCANS set to TRUE.
If FALSE (the default), the reply will contain
summary/profile data including current status.
If TRUE, the reply will contain profile and detailed scan
activity (multiple TrackDetail objects) for each package.
That translates to
<v16:ProcessingOptions>INCLUDE_DETAILED_SCANS</v16:ProcessingOptions>
in your SOAP request.

Related

Update Status of an Order on Prestashop using Webservices

I just want to update the current_state of an order,
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<order>
<id>1</id>
<current_state>1</current_state>
</order>
</prestashop>
But the prestashop is asking me for all the mandatory fields of a Post when I use the put,
I tried using the exact same information than the put but it's loosing the total ammounts when I do the put,
Is there something wrong on prestashop architecture?
You must download all order information with get request. Then modify current_state field before make put request to update values. You can not just send only desired fields to update.
Check examples here: Prestashop Webservices Data Modification
Good luck
You can call the setWsCurrentState() on the order object. This function is defined in Order.php class file.
This function takes the ID of order state you want to set for the order.

Yodlee Call returning Error_Code 415 for addItemAndStartVerificationDataRequest?

I need to call addItemAndStartVerificationDataRequest to do Instant Account Verification using Yodlee IAV Rest APIs.
I am following this documentation and providing the data params that are given here:
addItemAndStartVerificationDataRequest
But calling this APIs following the given documentation, I am getting this response from Yodlee APIs.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Errors xmlns="http://namespace.yodlee.com/pfm/2009/Error">
<Error>
<errorCode>415</errorCode>
<errorDetail>system_error</errorDetail>
</Error>
</Errors>
I have also visited this solution here but this is not helpful:
Error 415 from IAV Rest API - Get verbose error message
Any idea, how to go through this issue?
Are you passing all the required parameter? please verify the parameters listed here.
This exception can come in many scenarios.
one such scenario where you can get this exception is when cobSessionToken parameter is not passed.
Also are you following the correct flow?
The exception 415(Problem Updating Account) is different than the error you have listed here.
I have also encountered a 415 error. In my case, it was a special chars inserted and invisible on the editor. Sometimes copy and paste from browser and into the editor introduce this special chars.
please view the details of my experience here.
Yodlee REST API /authenticate/login returns 415 error

Designing a webservice

I am trying to design a web-service which is used for vehicle parking ticket generation.
One of the APIs is
1. Input: Amount of money customer has deposited.
2. Output: Return the time till which his parking ticket is valid.
e.g. Consider the parking rate is £1 per hour and if the input is £3 and if the current time is 11.30am then the web-service should return 2.30pm. Hope that makes sense.
I was thinking about using RESTful service but I can not figure out what should be the resource. RESTful service does not sound like a good choice.
Any suggestions?
The resource could be just “parkingtickets”. The business action is to ‘create’ a parking ticket. It should be mapped to HTTP POST since the server is to create a resource (parking ticket).
POST /parkingtickets/
Body: {amount: <amount>, starttime: <date-time>}
Return: OK, and {ticketid: <id>, endtime: <data-time>}
You can read more on the usage of HTTP verbs in here
I had to do something similar before.
I built a php app/site where you call functions like this:
example.com/service/calculateparkingtime/?deposit=3.50
and it would print out a json like this(with json headers):
{state:true,parking_time:3.5}
state is used for all responses and if there is an error there is also an 'error' key with an error message like:
{state:false,
error:"Parking time exceeds the working hours of the car park.",
errorCode:"Park01",parking_time:2.5,exceeding_amount:1}
If your API consists of such couple of small functions you can do the same.
service was used with either CURL or file_get_contents in php.
You can build the same app using other languages like ASP.NET and such.
If I understand the problem correctly, you just want the answer to a question/calculation, i.e. you should use HTTP GET:
GET foobar.tld/ticketExpires/<amountInGBP> -> expiretime
I would probably return date+time, since £200 would return a time some days later....
your example would be:
GET foobar.tld/ticketExpires/3 -> "2:30pm" (or preferably "YYYY-MM-DD 14:30:00")
issues: different timezones between webservice and client? is amount of money always in GBP?
You also need to consider what the format for the response/answer should be: JSON, XML, plaintext, the client "should" to specify the desired format using headers. If you have a simple client just return smoe default format the client understands.

different Response objects from SOAP Webservice?

In JAX-WS usually the response object will be a string or an XML format.
Can we have 2 kinds of response objects.
I mean, based on flag, XML or JSON as response output?
Is there any Objectwrapper kind of solution?
Am new to JAX-WS ,So am totally clueless. Thanks
According to Wikipedia here, you don't need XML to represent the SOAP message. But it looks like you will need SOAP bindings that support JSON. Reading the description in that article makes it sound like you can't just set a flag and have the response format change based on that.
If you want something where you set a flag to generate a different response format, consider a REST architecture instead. In REST, you would send a different Accept header to specify the format of the response you want. There wouldn't need to be a flag in your application specific data to handle the data format since that's more of metadata concern anyways.

CAML query in getLIstItems method returns no rows of items

I am invoking Sharepoint's List Web services and using the getListItems() method. In particular, I am keen on specifying a CAML query because I really want it to just retrieve one item that I am specifically interested in. This I am doing by specifying a query in my XML string, in varying degrees of combinations, either by specifying the EncodedAbsUrl, the LinkFileName, the URL or the FileRef, with most results returning 0.
The XML query looks like this :
<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body><GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"><listName>{5cbc4407-3851-4e00-964a-bb7e9b430f9f}</listName> <viewName></viewName> <rowLimit>1000</rowLimit> <webID></webID>
**<query><Query><Where><Eq><FieldRef Name = "FileRef"/><Value Type = "Text">"/Shared%20Documents/Ashish/Word_feb27.doc"</Value></Eq></Where></Query></query>**
<viewFields><ViewFields><FieldRef Name="FSObjType"/><FieldRef Name="LinkFilename"/><FieldRef Name="UniqueId"/><FieldRef Name="FileRef"/><FieldRef Name="FileRef"/><FieldRef Name="EncodedAbsUrl"/><FieldRef Name="FileSizeDisplay"/><FieldRef Name="_UIVersionString"/><FieldRef Name="_owshiddenversion"/></ViewFields></viewFields></GetListItems> </S:Body></S:Envelope>
Without the tags this Soap request does infact work, and it retrieves all the items that area available in the List. The frustration begins when i specify the query tag. In particular the Following combinations have been attempted by me
FieldRef.name = {LinkFileName, EncodedAbsUrl, URL,FileRef} and Value.type = {Text, URL}
Either they yield results with no 0 fields in it or they return internal errors. I figure, this is a syntactical issue and would rather shoot this question to you guys who have probably dunnit in the past to see where I am possibly messing it up.
Thanks
I would recommend using CAML Query Builder and Fiddler. Query builder can connect SP using Web services and you can build the query with that. After you got your expected results, capture the Web service request with Fiddler and use it :)
BTW: Have you considered using Sharepoint Client Object model? You do not have to worry about SOAP messages.
Remove the <query><Query> tags.