OK I've tried this and got a response, so it ~will work. The problem lies in 
the DOM object. UPS isn't getting the document content
and is sending back a "missing XML document" error. BTW, I'm on W2K and I 
didn't have to install the XML bundle. I have all the
latest SP's though as well as the .NET development kit. I'll try to find the 
ActiveX control that contains both of these objects and
post the filenames.

 Btw, if you want to kill Accuterm 2K2 regularly, just put a msgbox(xmldoc) 
right after the xmldoc is finished setting. I need to
post this over to Pete on the Asent forum.

PS: you will need an active UPS XML developer key and account in order to 
actually use this code. If you run it as-is you will get a
response, but it won't be tracking info. <g>

Sub Main()

Dim oXMLServer As Object
Dim oXMLDocument As Object
Dim xmldoc As String
Dim tracknum As String

Set oXMLServer = CreateObject("Msxml2.ServerXMLHTTP.3.0")
Set oXMLDocument = CreateObject("Msxml2.DOMDocument.3.0")

oXMLDocument.async = False
userid = "my-UPS-dev-userid"
passwd="my-UPS-dev-password"
licensenum="my-UPS-dev-license"
tracknum = "my-trackingnum"

xmldoc=""
xmldoc=xmldoc & "<?xml version=" & Chr(34) & "1.0" & Chr(34) & "?>" & Chr(13) & 
Chr(10)
xmldoc=xmldoc & "<AccessRequest xml:lang=" & Chr(34) & "en-US" & Chr(34) & ">" 
& Chr(13) & Chr(10)
xmldoc=xmldoc & "<AccessLicenseNumber>" & licensenum & "</AccessLicenseNumber>" 
& Chr(13) & Chr(10)
xmldoc=xmldoc & "<UserId>" & userid & "</UserId>" & Chr(13) & Chr(10)
xmldoc=xmldoc & "<Password>" & passwd & "</Password>" & Chr(13) & Chr(10)
xmldoc=xmldoc & "</AccessRequest>" & Chr(13) & Chr(10)
xmldoc=xmldoc & "<?xml version=" & Chr(34) & "1.0" & Chr(34) & "?>" & Chr(13) & 
Chr(10)
xmldoc=xmldoc & "<TrackRequest xml:lang=" & Chr(34) & "en-US" & Chr(34) & ">" & 
Chr(13) & Chr(10)
xmldoc=xmldoc & "<Request>" & Chr(13) & Chr(10)
xmldoc=xmldoc & "<TransactionReference>" & Chr(13) & Chr(10)
xmldoc=xmldoc & "<CustomerContext>Example 1</CustomerContext>" & Chr(13) & 
Chr(10)
xmldoc=xmldoc & "<XpciVersion>1.0001</XpciVersion>" & Chr(13) & Chr(10)
xmldoc=xmldoc & "</TransactionReference>" & Chr(13) & Chr(10)
xmldoc=xmldoc & "<RequestAction>Track</RequestAction>" & Chr(13) & Chr(10)
xmldoc=xmldoc & "<RequestOption>none</RequestOption>" & Chr(13) & Chr(10)
xmldoc=xmldoc & "</Request>" & Chr(13) & Chr(10)
xmldoc=xmldoc & "<TrackingNumber>" & tracknum & "</TrackingNumber>" & Chr(13) & 
Chr(10)
xmldoc=xmldoc & "</TrackRequest>" & Chr(13) & Chr(10)

oXMLDocument.loadXML(xmldoc)
oXMLServer.open ("POST","https://www.ups.com/ups.app/xml/Track",False)
oXMLServer.send (oXMLDocument)

MsgBox(oXMLServer.responseXML.xml)

End Sub

Glen

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> [EMAIL PROTECTED]
> Sent: Friday, August 26, 2005 11:30 AM
> To: [email protected]
> Subject: RE: [U2] XML and Accuterm
>
>
> I wrote on 25/08/2005 19:42:13:
>
> > In my original post, I admitted to not actually using Accuterm.  I was
> > basically saying that if Accuterm supported VBA then it should
> definitely
> > be possible to send and receive XML just as you could in VB.
> >
> > I've since been on the Accuterm site just to check what it can do.  It
> > does seem to have the capability to use VB object libraries and here's a
>
> > URL link to a page on their site which goes into a lot of detail:
> >
> > http://www.asent.com/email_white_paper.htm
> >
> > As for the actual code to send and receive XML, I will need to dig that
> > out of an application and I'll post it tomorrow hopefully.
>
> I promised some pointers to sending and receiving XML using a Windows
> application such as Accuterm that supports VBA.  Here is a link to a page
> on Microsoft's site that gives some ASP examples:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/e5c17f89-0197-496c-9164-ce0bbbd8490f.asp
>
> Where the code has:
>
> var objSrvHTTP;
> objSrvHTTP = Server.CreateObject ("Msxml2.ServerXMLHTTP.3.0");
>
> the VB equivalent that you would use would be something like:
>
> Dim oXMLServer As Object
> Set oXMLServer = CreateObject("Msxml2.ServerXMLHTTP.3.0")
>
> The last example on the page shows how to send and receive XML.
>
> The syntax is visual basic so it is identical to using the UniObject
> Libraries.
>
> You need to be aware that if you go down this route then every Accuterm
> client PC that requires the functionality would require the XML library
> installing locally (or the DLL registered).  This is one of the reasons
> why getting code to execute on the server is preferable.
>
> In order to get hold of the library, go onto Micro$oft's site and do a
> search for MSXML from the Download Centre.
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to