Ok, Great wether its on his side or the other side as you say the xmlreader reads the xml document weather its the UPS's reader or his xmlreader. The things that he should of got from what i was telling him to ask UPS company for a copy of a XML file giving
the elements that he needs to use. So the general idea atleast should be explained that he is using probably wrong xml elements the reader is not reading his xml because their xmlreader is probably trying to parse different named elements. So the whole focus
is This Exactly what I was explaining from the begining. re-read what I wrote it all there wether it his parsing error or theirs make no difference because it going to work the same way.
And another thing if he is tracking UPS shipments why in the world would he need to send and xml file to them.? The reason why I ask this question is they are supplying data through a webservice all he would really need to do is satisfy the web methods
(Requests) with a shipment number the data from the webservice thats in the UPS xml file that being service by UPS will return the valued information So you really do not need to be sending any xml document.
Looking at the documentation you linked for us (thank you by the way) your XML looks fine. However in thier examples for sending the payload to them they are using the MSXML object for sending/receiving. Which is different than what we are working with
in .NET
There is another thread where someone was needing to communicate with UPS and sending a similar payload to them. Take alook at this thread and see if this gets you any closer.
hey, thats very good, the link you sent that is using xpaths seems more usuable but one thing
you need to put your xpath code in brackets like so:
Dim crmyxmlnodelist As XmlNodeList = myxmldoc.SelectNodes("RatingServiceSelectionResponse/Response")
Dim crmyxmlnodelist As XmlNodeList = myxmldoc.SelectNodes([RatingServiceSelectionResponse/Response])
im not exactly sure though if you use quotes but you may also need them but I know for a fact it will need brackets play around with it and you should get it with that
i have to check the code i did to remember but i know it needs brackets
The function below will generate the correct UPS traking xml. I am using it and it works. Fill out the fileds and check if this works for you. Just pass
"" in refNo. Let me know incase of problems.
Public Shared Function CreateUpsTrackingXML(ByVal trackingNo As String, ByVal refNo As String) As String
Dim strBuild As New StringBuilder()
Dim accessLicenseNumber As String = "XXXXXX"
Dim upsUserId As String = "XXXXX"
Dim upsUserPass As String = "XXXX"
Dim xpciVersion As String = "1.0001"
Dim requestOption As String = "1"
Srheal
Member
159 Points
38 Posts
Re: UPS Tracking - WebRequest Using XML
Aug 21, 2007 04:34 PM|LINK
Ok, Great wether its on his side or the other side as you say the xmlreader reads the xml document weather its the UPS's reader or his xmlreader. The things that he should of got from what i was telling him to ask UPS company for a copy of a XML file giving the elements that he needs to use. So the general idea atleast should be explained that he is using probably wrong xml elements the reader is not reading his xml because their xmlreader is probably trying to parse different named elements. So the whole focus is This Exactly what I was explaining from the begining. re-read what I wrote it all there wether it his parsing error or theirs make no difference because it going to work the same way.
And another thing if he is tracking UPS shipments why in the world would he need to send and xml file to them.? The reason why I ask this question is they are supplying data through a webservice all he would really need to do is satisfy the web methods (Requests) with a shipment number the data from the webservice thats in the UPS xml file that being service by UPS will return the valued information So you really do not need to be sending any xml document.
Diamsorn
Contributor
2119 Points
384 Posts
Re: UPS Tracking - WebRequest Using XML
Aug 21, 2007 04:53 PM|LINK
Looking at the documentation you linked for us (thank you by the way) your XML looks fine. However in thier examples for sending the payload to them they are using the MSXML object for sending/receiving. Which is different than what we are working with in .NET
There is another thread where someone was needing to communicate with UPS and sending a similar payload to them. Take alook at this thread and see if this gets you any closer.
http://forums.asp.net/t/1148953.aspx
My Blog
Srheal
Member
159 Points
38 Posts
Re: UPS Tracking - WebRequest Using XML
Aug 21, 2007 05:03 PM|LINK
hey, thats very good, the link you sent that is using xpaths seems more usuable but one thing
you need to put your xpath code in brackets like so:
Dim crmyxmlnodelist As XmlNodeList = myxmldoc.SelectNodes("RatingServiceSelectionResponse/Response")
Dim crmyxmlnodelist As XmlNodeList = myxmldoc.SelectNodes([RatingServiceSelectionResponse/Response])
im not exactly sure though if you use quotes but you may also need them but I know for a fact it will need brackets play around with it and you should get it with that
i have to check the code i did to remember but i know it needs brackets
everydaypano...
Member
2 Points
1 Post
Re: UPS Tracking - WebRequest Using XML
Aug 29, 2007 09:47 AM|LINK
I think I got it!
sara55
Member
10 Points
5 Posts
Re: UPS Tracking - WebRequest Using XML
Jul 14, 2008 03:12 PM|LINK
I have few question. Please help answer these.
What is the Internalkey here?
why does the url read 'https://wwwcie.ups.com/ups.app/xml/Track
' instead of "https://www.ups.com/ups.app/xml/Track
"?I have been getting the following error 'The XML document is well formed but the document is not valid'.
Any help appreciated. Please reply.
FarhanK
Contributor
2603 Points
349 Posts
Re: UPS Tracking - WebRequest Using XML
Jul 15, 2008 12:10 AM|LINK
Hi,
The function below will generate the correct UPS traking xml. I am using it and it works. Fill out the fileds and check if this works for you. Just pass "" in refNo. Let me know incase of problems.
I am posting this to the following URL (https://www.ups.com/ups.app/xml/Track)
Public Shared Function CreateUpsTrackingXML(ByVal trackingNo As String, ByVal refNo As String) As String
Dim strBuild As New StringBuilder()
Dim accessLicenseNumber As String = "XXXXXX"
Dim upsUserId As String = "XXXXX"
Dim upsUserPass As String = "XXXX"
Dim xpciVersion As String = "1.0001"
Dim requestOption As String = "1"
strBuild.Append("<?xml version=""1.0""?>")
strBuild.Append("<AccessRequest xml:lang=""en-US"">")
strBuild.Append("<AccessLicenseNumber>" + accessLicenseNumber + "</AccessLicenseNumber>")
strBuild.Append("<UserId>" + upsUserId + "</UserId>")
strBuild.Append("<Password>" + upsUserPass + "</Password>")
strBuild.Append("</AccessRequest>")
strBuild.Append("<?xml version=""1.0""?>")
strBuild.Append("<TrackRequest xml:lang=""en-US"">")
strBuild.Append("<Request>")
strBuild.Append("<TransactionReference>")
strBuild.Append("<CustomerContext>Nyk Ups Tracking</CustomerContext>")
strBuild.Append("<XpciVersion>" + xpciVersion + "</XpciVersion>")
strBuild.Append("</TransactionReference>")
strBuild.Append("<RequestAction>Track</RequestAction>")
strBuild.Append("<RequestOption>" + requestOption + "</RequestOption>")
strBuild.Append("</Request>")
If trackingNo <> String.Empty Then
strBuild.Append("<TrackingNumber>" + trackingNo + "</TrackingNumber>")
Else
strBuild.Append("<ReferenceNumber><Value>" + refNo + "</Value></ReferenceNumber>")
End If
strBuild.Append("</TrackRequest>")
Return strBuild.ToString()
End Function
Regards,
Farhan Uddin Khan
Breeze Technologies
sara55
Member
10 Points
5 Posts
Re: UPS Tracking - WebRequest Using XML
Jul 16, 2008 05:27 PM|LINK
yep..that works..Thanks..
B/w have u tried serialise the Request string?