Here is an example that seems to work for me. Inside an .asmx file:

using System;
using System.Web;
using System.Collections;
using System.Collections.Generic;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://domain.com/";)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class service : System.Web.Services.WebService {

   public service () {
       //Uncomment the following line if using designed components
       //InitializeComponent();
   }

   /// <summary>
   /// Some web method
   /// </summary>
   /// <param name="param1">The first parameter</param>
   /// <param name="param2">The second parameter</param>
   /// <returns></returns>
   [WebMethod]
public List<YourTypeOrBuiltInTypeLikeString> GetProductsByCategoryAndType (int paramOne, string paramTwo)
   {
       return Your.Internal.MethodToCall(paramOne, paramTwo);
   }
}


In config.xml all I see is this:

       <webServices>
           <protocols>
               <add name="HttpGet"/>
               <add name="HttpPost"/>
           </protocols>
       </webServices>

Hopefully something in that example will be useful to you..

We are running ASP.NET 2.0 and have no problem with complex objects with Lists (Arrays) - if I remember correctly, some .NET data objects will not be serialized into standard SOAP objects, but into MS extensions (embrace and extend) - so you have to make sure you are not using those Types on property nodes in your complex object (I think the one we found that out with was a DataGrid).

Kevin N.



Brake, Stephen wrote:
I read the following post and have the same exact problem.  How did you
construct the .net web service to allow the web  service to grab the
value of the complex array from Flash:

This is an old thread I started back in May which I am following up on
with a question.  Muzak had replied to me with this:
If you'll be using webservices that you can control (which it sounds
like is the
case), don't send XML back and forth.
When using webservices, you can send Array of Objects back and forth,
which is
alot easier to work with.
There should be a list of data type conversions in the docs somewhere.
I am using the Web service classes to load in a wsdl from a .NET
developer using C#.  We have the basics working, I can receive a simple
string from him no problem by calling the SOAP method.  However, since
Muzak (in the quote above) and the docs say the Web service classes
supports complex object types, we are now trying to read in a complex
object in Flash. The C# developer created a method for me, called GetProject() that
returns a complex object he created (the complex object is simple - it
just has a property that contains a simple string - i.e. objProj.Title).
However, when I trace the result on the method, it returns "null".
Neither the C# developer or myself can figure out where we are going
wrong.  Any ideas?   One of us has something wrong with this "object"
and we're not sure who.
Also, for a second related question, once I can read the object in Flash
(it would contain arrays and properties, etc.) - we want to just send
that object back to the webservice to update the object in C#.  Any
issues with that?  The Help docs only say this about objects:
Web Service classes > Supported Types > Object Types
Object Types:  Complex Type - ActionScript object composed of properties
of any supported type
Jason Merrill Bank of America Learning & Organization Effectiveness - Technology Solutions


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to