login about faq

Hi all.

I'm sort of new at this and a bit lost. What I am trying to do is to get shipping rate information from FedEx. Here is the code I have so far. Can someone help please? Line numbers are added for reference. I have download and installed the activex control.

<% 1. strXML=alltrim(FILETOSTR("fedex.xml")) && Load in XML file. 2. loHTTP = CreateObject('Chilkat.XML') 3. loReq = CreateObject('Chilkat.HttpRequest') &&ERROR - Class definition CHILKAT.HTTPREQUEST is not found. 4. loResp = loHttp.PostUrlEncoded("https://gateway.fedex.com:443/xml",strXML) 5. IF (loResp = NULL ) THEN 6. ? loHttp.LastErrorText 7. QUIT 8. ENDIF 9. loXml2 = loXml.GetChildWithTag("RequestHeader") 10. loXml3 = loXml2.GetChildWithTag("AccountNumber") 11. response.write(loXml3.Content) %>

When I run this I get the following error: Error #: 1733 Message: Class definition CHILKAT.HTTPREQUEST is not found. Program: c:inetpubx-laserfedex.fxp Line #: 3 Line: loReq = CreateObject('Chilkat.HttpRequest')

Along with this I also need to get the response from FedEx. Can anyone help please?

Joe

asked Feb 09 '13 at 17:25

XLaser's gravatar image

XLaser
1111


Sorry, I posted again because I saw that my original post above was concatenated. I hope this is more helpful.

<%
1. strXML=alltrim(FILETOSTR("fedex.xml")) && Load in XML file.
2. loHTTP = CreateObject('Chilkat.XML')
3. loReq = CreateObject('Chilkat.HttpRequest') &&ERROR - Class definition CHILKAT.HTTPREQUEST is not found.
4. loResp = loHttp.PostUrlEncoded("https://gateway.fedex.com:443/xml",strXML)
5. IF (loResp = NULL ) THEN
6.    ? loHttp.LastErrorText
7.    QUIT
8. ENDIF
9. loXml2 = loXml.GetChildWithTag("RequestHeader")
10. loXml3 = loXml2.GetChildWithTag("AccountNumber")
11. response.write(loXml3.Content) %>

When I run this I get the following error:

Error #: 1733 Message: Class definition CHILKAT.HTTPREQUEST is not found. Program: fedex.fxp Line #: 3 Line: loReq = CreateObject('Chilkat.HttpRequest')

Along with this I also need to get the response from FedEx. Can anyone help please?

link

answered Feb 10 '13 at 01:49

XLaser's gravatar image

XLaser
1111

You have the wrong CLSIDs for the Chilkat objects.

HTTP Request should be: CreateObject('ChilkatHttp.ChilkatHttpRequest')
XML Should be: CreateObject('ChilkatXml.ChilkatXml')

In fact, I'm surprised you didn't get an error on line 2.

Also, it seems that you are setting your loHTTP variable to a ChilkatXML object, but then calling methods as if it were a ChilkatHttp object. Are you sure line #2 shouldn't have been:

loHTTP = CreateObject('ChilkatHttp.ChilkatHttp')

?

Lastly, you can get the response content by using loResp.Body after you've tested for NULL in your example code.

link

answered Feb 10 '13 at 10:02

jpbro's gravatar image

jpbro ♦
1.1k2618

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×59
×18
×11
×9
×1

Asked: Feb 09 '13 at 17:25

Seen: 1,897 times

Last updated: Feb 10 '13 at 10:02

powered by OSQA