I figured out a way and will try to explain below so others can try to
benefit from it.

I needed to call a .NET web service passing it a complex structure of data.
It would then in turn return a complex object that had the search results
for room availability. I then had to do alot of CFDUMPS of my returned
object until I found how to parse through the XML.

======================================================
<cfscript>
// create credentials object
CheckAvailabilityR.Credentials = StructNew();
CheckAvailabilityR.Credentials.LogonID = "IRMTest";
CheckAvailabilityR.Credentials.Password = "******";
CheckAvailabilityR.Credentials.DataPath = "******";
CheckAvailabilityR.Credentials.DatabaseID = "#attributes.databaseID#";

// create availability obnject
CheckAvailabilityR.AvailabilityRequest = StructNew();
CheckAvailabilityR.AvailabilityRequest.ArrivalDate =
"#dateFormat(attributes.arrivalDate, "yyyy-mm-dd")#";
CheckAvailabilityR.AvailabilityRequest.DepartureDate =
"#dateFormat(attributes.departureDate, "yyyy-mm-dd")#";
CheckAvailabilityR.AvailabilityRequest.RoomType = "#attributes.roomType#";
CheckAvailabilityR.AvailabilityRequest.People1 = #attributes.numAdults#;
CheckAvailabilityR.AvailabilityRequest.People2 = 0;
CheckAvailabilityR.AvailabilityRequest.People3 = 0;
CheckAvailabilityR.AvailabilityRequest.People4 = 0;

// create the web service
irm = CreateObject("webservice",
"http://irm.resortdata.com/LutsenInterface/IRMPublic.asmx?wsdl";);

// pass the checkAvailability object to the services CheckAvailability
method
CheckAvailabilityRQ = irm.checkAvailability(CheckAvailabilityR);

// get the status of the result
status = CheckAvailabilityRQ.getStatus();
statusText = status.getValue();

// call the get inventory method
inv = CheckAvailabilityRQ.getInventory();

// get the raw data from the result
invData = inv.get_any();

// create new structure to hold raw data
dataset = StructNew();

// load resulting data into new structure
dataset = invData;

// parse raw data from MS diffgram and parse the XML
rawRoomData = xmlParse(dataset[2]);

// grab array of room records
roomResults = rawRoomData["diffgr:diffgram"]["inventory"].XmlChildren;
</cfscript>

<cfdump var="#roomResults#">

=================================================
That's all the ColdFusion code I need to call the web service pass it the
structure of data then receive and parse the results. The only thing left
for me to do is to encapsulate it in a CFC that will return me a CF
recordset or a "no inventory available" status.


Thanks everyone for your help



-----Original Message-----
From: Jason Neidert [mailto:ja...@steelfusion.com] 
Sent: Thursday, July 23, 2009 1:54 PM
To: cf-talk
Subject: RE: Calling .ASPX.VB from .CFM


I DID IT!! ---- now what?
I need to extract the resulting recordset. 

If I called the method 'getInventory() ' as such:
<cfscript>
inv = CheckAvailabilityRQ.getInventory();
</cfscript>

I know it has a recordset somewhere in there that contains records for each
day that room is available and the inventory available on that date. The
third cfdump on that page shows the info on the object created stored in the
variable 'inv'.

I'm thinking now I need to use Coldfusion again to create the proper object
to receive a recordset extracted from the 'inv' object.

The good news is this, I was able to use ColdFusion to create complex
structures and very simply open a web service and return results. No where
this clean and nice with the aspx.vb file that came with it. 


View the dumps of the object with methods I am getting back. 
http://lutsen.steelfusion.com/winter/rates_packages/packages/rdp/rdp/act_cal
lDotNet.cfm


<cfset CheckAvailabilityRQ.Credentials = StructNew() />
<cfset CheckAvailabilityRQ.Credentials.LogonID = "IRMTest" />
<cfset CheckAvailabilityRQ.Credentials.Password = "1qasw2" />
<cfset CheckAvailabilityRQ.Credentials.DataPath = "c:\rdp1202\rdp85" />
<cfset CheckAvailabilityRQ.Credentials.DatabaseID = "29005" />


<cfset CheckAvailabilityRQ.AvailabilityRequest = StructNew() />
<cfset CheckAvailabilityRQ.AvailabilityRequest.ArrivalDate = "1998-03-18" />
<cfset CheckAvailabilityRQ.AvailabilityRequest.DepartureDate = "1998-03-20"
/>
<cfset CheckAvailabilityRQ.AvailabilityRequest.RoomType = "k" />
<cfset CheckAvailabilityRQ.AvailabilityRequest.People1 = 1 />
<cfset CheckAvailabilityRQ.AvailabilityRequest.People2 = 0 />
<cfset CheckAvailabilityRQ.AvailabilityRequest.People3 = 0 />
<cfset CheckAvailabilityRQ.AvailabilityRequest.People4 = 0 />


<cfscript>
irm = CreateObject("webservice",
"http://irm.resortdata.com/LutsenInterface/IRMPublic.asmx?wsdl";);
CheckAvailabilityRQ = irm.checkAvailability(CheckAvailabilityRQ);
</cfscript>
<cfdump var="#CheckAvailabilityRQ#">

View the dump here:
http://lutsen.steelfusion.com/winter/rates_packages/packages/rdp/rdp/act_cal
lDotNet.cfm


Now how do I get the data out?


-----Original Message-----
From: Dave Watts [mailto:dwa...@figleaf.com] 
Sent: Wednesday, July 22, 2009 1:11 PM
To: cf-talk
Subject: Re: Calling .ASPX.VB from .CFM


> SO... if I use CFINVOKE I am not quite sure what to pass in the
> CFINVOKEARGUMENT
>
> Do I attempt to create a large structure and pass it in under
> 'CheckAvailability_irmRQ'?

I think you'll need a little more than that; you'll need CFCs to
represent the objects and you'll need to use CFPROPERTY to name the
properties of those objects in a way that the CF WSDL stub builder
will be able to map to the original WSDL. For example, a Credentials
object:

<!--- credentials.cfc --->
<cfcomponent>
    <cfproperty name="LogonID" type="string" required="yes">
   ... other properties go here ...
   ... code to populate those properties goes here ...
</cfcomponent>

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324948
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to