Gabriel,

I implemented a few with no problem. Fedex service requires a few http header 
settings for the request:

<cfscript>
 requestheader = structnew();
  requestheader["Referer"] = "your company name";
  requestheader["Host"] = "Fedex gateway Host";
  requestheader["Accept"] = "image/gif, image/jpeg,image/pjpeg, text/plain, 
text/html, */*";  
  requestheader["Content-Type"] = "image/gif";  
  requestheader["Content-Length"] = len(trim(tostring(requestXML)));
</cfscript>

<cfhttp method="post" url="#gatewayURL#" resolveurl="false" timeout="20">

  <cfloop collection="#requestheader#" item="key" >
    <cfhttpparam type="header" name="#key#" value="#requestheader[key]#" />
  </cfloop> 
  
 <cfhttpparam type="xml" name="Urlxml" value="#tostring(requestXML)#" />

</cfhttp>


Hua
-----Original Message-----
From: [EMAIL PROTECTED] [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 27, 2005 9:50 AM
To: CF-Talk
Subject: Fedex Shipping in realtime ( XML over https)

I am having trouble using fedex xml over http to connect to their API.
Anybody had any luck?

The code I am using is the following:

<?xml version="1.0" encoding="UTF-8" ?>
<cfxml variable="outputXML">
<cfoutput>
<FDXSubscriptionRequest xmlns:api="http://www.fedex.com/fsmapi";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="FDXSubscriptionRequest.xsd">
<RequestHeader>
<CustomerTransactionIdentifier>String</CustomerTransactionIdentifier>
<AccountNumber>55555555555</AccountNumber>
</RequestHeader>
<Contact>
<PersonName>Gabriel</PersonName>
<CompanyName>transex</CompanyName>
<Department>Shipping</Department>
<PhoneNumber>55555555555</PhoneNumber>
<E-MailAddress>[EMAIL PROTECTED]</E-MailAddress>
</Contact>
<Address>
<Line1>123 candle</Line1>
<City>Houston</City>
<StateOrProvinceCode>TX</StateOrProvinceCode>
<PostalCode>77754</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</FDXSubscriptionRequest>
</cfoutput>
</cfxml>

<cfset sendto="https://gatewaybeta.fedex.com:443/GatewayDC";> 

<cfhttp url="#sendto#" method="POST" resolveurl="true" redirect="yes"> 
<cfhttpparam type="xml" value="#outputXML#"> </cfhttp>

<cfoutput>#CFHTTP.FileContent#</cfoutput>

<cfxml variable="outputXML2">
<cfoutput>
<FDXSubscriptionReply xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="FDXSubscriptionReply.xsd">
<RequestHeader>
<CustomerTransactionIdentifier>String</CustomerTransactionIdentifier>
</RequestHeader>
<MeterNumber>1234567</MeterNumber>
<SubscribedService>FedEx Express Shipping</SubscribedService> 
</FDXSubscriptionReply> </cfoutput> </cfxml>

<cfset sendto="https://gatewaybeta.fedex.com:443/GatewayDC";> 

<cfhttp url="#sendto#" method="GET" resolveurl="true" redirect="yes"> 
<cfhttpparam type="xml" value="#outputXML2#"> </cfhttp>

<cfset returned_xml_struct = cfhttp.FileContent> <cfdump 
var=#returned_xml_struct#>

I am also having problems understanding how to get the XML response back from 
the fedex server.
Thanks
Gabriel
[EMAIL PROTECTED]



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219335
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to