5 Replies Latest reply on Sep 20, 2007 2:22 PM by batmitra

    Error # 1009 Accessing .NET web Service

    mrcabrera
      I am trying to access a .NET Web service and I keep getting Error # 1009 Null. I tried everything and I can not figure this one out. It seems to happen on a DateTime field which I am passing back '0001-01-01T00:00:00'. Has anyone ran into this issue?
        • 1. Re: Error # 1009 Accessing .NET web Service
          batmitra Level 1
          hi
          there are a lot of issues using .net webservices and flex , how are you calling the ws?
          And how are you managing the returned data?

          These are 2 important questions, so please show some code and i'll try to help you.
          A hint, the best way to link ws with flex is to get objects from one place to the other and vice versa.
          • 2. Error # 1009 Accessing .NET web Service
            mrcabrera Level 1
            Here is the webservice call. I am getting the error # 1009 it seems on the dateTime fields. The response is an object I am binding it to a datagrid as so ArrayUtil.toArray(byFilter2.ListingsFiltered.lastResult.Listings). Please let me know what other code you would like to view.

            <mx:WebService id="byFilter2"
            wsdl=" http://localhost/FilterService.asmx?WSDL"
            showBusyCursor="true"
            concurrency="multiple" >
            <mx:operation name="ListingsFiltered" fault="faulting(event)">
            <mx:request>
            <FilterRequest>
            <Filter>
            <City>Naples</City>
            <ApplyDateFromFilter>false</ApplyDateFromFilter>
            <DateFrom>0001-01-01T00:00:00</DateFrom>
            <DefaultDateFrom>0001-01-01T00:00:00</DefaultDateFrom>
            <ApplyDateToFilter>false</ApplyDateToFilter>
            <DateTo>0001-01-01T00:00:00</DateTo>
            <DefaultDateTo>0001-01-01T00:00:00</DefaultDateTo>
            <GolfCourseID>0</GolfCourseID>
            <MinPrice>0</MinPrice>
            <MaxPrice>0</MaxPrice>
            <Bedrooms>0</Bedrooms>
            <Bathrooms>0</Bathrooms>
            <MinSqFt>0</MinSqFt>
            <MaxSqFt>0</MaxSqFt>
            <PropertyTypes>0</PropertyTypes>
            </Filter>
            <Paging>
            <StartRow>0</StartRow>
            <PageSize>10</PageSize>
            </Paging>
            <OrderBy>Price</OrderBy>
            </FilterRequest>
            </mx:request>
            </mx:operation>
            </mx:WebService>
            • 3. Re: Error # 1009 Accessing .NET web Service
              batmitra Level 1
              hi
              i see you are sending your datetime field as text wich means you will have to cast it to date before sending it, or on the .net side cast it to date upon receveing it .

              Another thing , the best thing i've discovered to work with .net webservices and flex is to tkae some data and turn it into an array of classes , create the same class on flex side and when data comes fill my class with data, creating an arraycollection that is an array of classes, that way the type of data i'm sending from one place to other is casted correctly.

              • 4. Re: Error # 1009 Accessing .NET web Service
                mrcabrera Level 1
                How do I go about casting from string to date? I created a var but I can not access it from within the webservice <tag>.
                • 5. Re: Error # 1009 Accessing .NET web Service
                  batmitra Level 1
                  hi
                  i think you are sending data to your webservice that has been entered within a form , right?

                  if this is the case , you can use databinding expressions and make like this:

                  instead of having that big request tag you have, you can pass parameters to your webservice for example when a user clicks a button and go like this:

                  on the click event of button you put:
                  yourwebservice.send(naples,false, yourdatetime, etc.) and on your webservice side on .net you use the request.querystring , to see if the parameters are coming)

                  using vars you must make them bindable and then use it like this :

                  yourwebservice({var1},{var2},...,{varn})