Hi,
 
i have a problem where i need to create an Array of Structs and pass it from CFMX to .Net Web Service.
 
firstly can CF pass complex datatypes to non-CFMX web services ??
 
 
if it can then......
 
i have created a Array of Structs.. .eg
 
<cfset stForm.rtReqArray = ArrayNew(1)>
<cfset stForm.rtReqStruct = StructNew()>
 
<cfset stForm.rtReqStruct["rtCode"] = JavaCast("string", "1S")>  <!--- room type code --->
<cfset stForm.rtReqStruct["rtReq"] = JavaCast("int", "1")> <!--- no of beds or room required --->
<cfset stForm.rtReqStruct["rtAdultCount"] = JavaCast("int", "1")> <!--- no of Adults --->
<cfset stForm.rtReqStruct["rtChildCount"] = JavaCast("int", "0")> <!--- no of Youths --->
<cfset stForm.rtReqStruct["rtRoomCost"] = JavaCast("double", "20.00")> <!--- Total Cost per Room Type --->

<cfset stForm.rtReqArray[1] = stForm.rtReqStruct>
....etc
 
 
but i seem to be getting an error as shown below .. (Book is the function i call on the Web Service)
you do not get to see the "Array of Structs" in the error mesg since it gets truncated.
 
<cfset stSendBooking.rtReqArray = stForm.rtReqArray>
<cfset stSendBooking.email = stForm.email>
etc.....
 
<cfset stLocal.returnBookStatus = stLocal.ws.Book(Application.chartWebServiceRevisionNo, stLocal.Code, Application.CallerID, stSendBooking, "stLocal.returnBookingChartsBRN", "stLocal.returnBookingTotalCost", "stLocal.returnErrorMessage")>
 
"Web service operation "Book"  with parameters {1,BLUEMTNS,SCOTTY,[EMAIL PROTECTED],CARDAUTH={123},USERATETABLE={Y},ORIGBKGNO={e4b1c0e5},RTREQARRAY={[Ljava.lang.Object;@1d143d1},COMM={},PMCODE={XVCD},ARRDATE={06 Aug 04},RTMAX={1},FIRSTNAME={Joel},DEPTIME={},CARDNO={5123456789012346},LASTNAME={Nath},TOTALCOST={70.0},COUNTRY={Australia},ARRTIME={},ADDRESS={302/182-190 hampden Road},STATE={NSW},PGCODE={},AGNCOD={},POSC={2064},DEPDATE={10 Aug 04},FAX={},PHONE={61 02 94112746},CARDEXP={0405},},stLocal.returnBookingChartsBRN,stLocal.returnBookingTotalCost,stLocal.returnErrorMessage} could not be found.
"
 
i have checked the array name and struct keys etc... to be correct..
i have also used the toArray() function to convert the CF Array to Java Array.. but i have a feeling that the struct is having problems...
 
if i take the "Array of Structs" out of the call then it seems fine..
 
 
 
 
any suggestion would be most helpful....
 
Cheers
Joel
 
.ps
 
the args for the function call..
 
 '-------------------------------------------------------------------------
  '                    Structure SendBook_Struct
  '-------------------------------------------------------------------------
  Public Structure RtReqStruct                      ' Send Structure
    Public RtCode As String                         ' Room Type Code
    Public RtReq As Integer                         ' Beds/Rooms required
    Public RtAdultCount As Integer                  ' Num of Adult per room
    Public RtChildCount As Integer                  ' Num of Child per room
    Public RtRoomCost As Double                     ' Cost for room   
  End Structure
 
  Public Structure SendBook_Struct                  ' Send Structure
    Public OrigBkgNo As String                      ' Originating booking number (20 Char)
    Public ArrDate As String                        ' Arrival date (DD MMM YY)
    Public ArrTime As String                        ' Arrival time (HH:MM)
    Public DepDate As String                        ' Departure date (DD MMM YY)
    Public DepTime As String                        ' Departure time (HH:MM)
    Public LastName As String                       ' Last Name (20 Char)
    Public FirstName As String                      ' First Name (20 Char)
    Public Address As String                        ' Address line (25 Char)
    Public State As String                          ' State (3 Char)
    Public Posc As String                           ' PostCode/Zip (12 Char)
    Public Country As String                        ' Country (20 Char)
    Public Phone As String                          ' Phone (16 Char)
    Public Fax As String                            ' FAX Number (16 Char)
    Public Email As String                          ' Email (40 Char)
    Public AgnCod As String                         ' Agent code (4 Char)
    Public PgCode As String                         ' Package Code (10 Char)
    Public PmCode As String                         ' Payment Method Code (4 Char)
    Public CardNo As String                         ' Card Number (21 Char)
    Public CardExp As String                        ' Card Expiry (5 Char)
    Public CardAuth As String                       ' Card Authorisation (20 Char)
    Public Comm As String                           ' Comments (100 Char)
    Public RtMax As Integer                         ' Number of Room Types booked
    Public RtReqArray As RtReqStruct()              ' One for each Room Type
    Public UseRateTable As String                   ' "Y" Use Charts Rate Table; "N" no rate table
    Public TotalCost As Double                      ' Total Cost (room1Total + room2Total = etc)
  End Structure
 
  <SoapDocumentMethod(Use:=SoapBindingUse.Literal), _
   WebMethod(Description:="This will create a booking with the Charts PMS.")> _
  Public Function Book(ByVal Revn As Integer, _
                       ByVal TargID As String, ByVal CallID As String, _
                       ByVal SendStrct As SendBook_Struct, _
                       ByRef BkgNo As String, _
                       ByRef TotalCost As String, _
                       ByRef Errstr As String) As Integer
 

Joel Nath
Senior Developer
Redsquare
[EMAIL PROTECTED]
Work: +61 2 8596 4067

Mobile: 0414 303965
49 Greek Street
Glebe, 2037
NSW, Australia
Visit us at www.redsquare.com.au for more information.
 
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to