Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use VBA to build an XML request/response

Status
Not open for further replies.

AccessGuruCarl

Programmer
Jul 3, 2004
471
US
Hello All,

I posted this one awhile back, and played around with it but I'm having no luck.

I've included the sample data they gave me to work with.
Please someone help get pointed in the right direction. They have no VB or VBA samples to go by!

Sample Data...
When sending the XML request, the Web Tool name must be specified. The Web Tool name is RateV2. The format of the XML transaction is:
USERID="username" PASSWORD="password">…….</RateV2Request>

'Test Request
<RateV2Request USERID="xxxxxx" PASSWORD="xxxxxxx">
<Package ID="0">
<Service>All</Service>
<ZipOrigination>10022</ZipOrigination>
<ZipDestination>20008</ZipDestination>
<Pounds>10</Pounds>
<Ounces>5</Ounces>
<Size>LARGE</Size>
<Machinable>TRUE</Machinable>
</Package>
</RateV2Request>


'Response to Test Request
<?xml version="1.0" ?>
<RateV2Response>
<Package ID="0">
<ZipOrigination>10022</ZipOrigination>
<ZipDestination>20008</ZipDestination>
<Pounds>10</Pounds>
<Ounces>5</Ounces>
<Size>LARGE</Size>
<Machinable>TRUE</Machinable>
<Zone>3</Zone>
<Postage>
<MailService>Express Mail PO to Addressee</MailService>
<Rate>39.20</Rate>
</Postage>
<Postage>
<MailService>Priority Mail</MailService>
<Rate>11.05</Rate>
</Postage>
<Postage>
<MailService>Parcel Post</MailService>
<Rate>8.61</Rate>
</Postage>
<Postage>
<MailService>Bound Printed Matter</MailService>
<Rate>3.53</Rate>
</Postage>
<Postage>
<MailService>Media Mail</MailService>
<Rate>5.14</Rate>
</Postage>
<Postage>
<MailService>Library Mail</MailService>
<Rate>4.91</Rate>
</Postage>
</Package>
</RateV2Response>

Scripted Test Error Responses
If any values were changed in your request, the following is an example of an error that can occur. The following error shows an example of using the Test with an invalid container value.
<?xml version="1.0" ?>
<Error>
<Number>-2147219488</Number>
<Source>Rate_Respond;SolServerRatesTest.RateV2_Respond
</Source>
<Description>Invalid value for container.</Description>
<HelpFile />
<HelpContext>1000440</HelpContext>
</Error>
Although the input may be valid, the response will still raise this error, because those particular values have not been included in this test server.

MANY THANKS...
Carl


AccessGuruCarl
Programmers helping programmers
you can't find a better site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top