There are no docs for this, however I do exactly the same thing. In the XMLdocument instance I cast it to string in flex before sending it.

 

Soap envelopes are a textual packet of information. In order for anything like that to work the objects need to have exactly the same structure. When you pass the XML object for example to a web service what your actually passing is a pointer to the object, not the object structure. So *I think* in order for .net to properly cast it you need a similar structure in .net. So in the case of XML pass the string is the way to go. In .net serializing that to an XMLDocument is trivial. I’ll try to help in vb.net not sure if you write c#.

 

Dim oxmlData As New XmlDocument

oxmlData.LoadXml(strXMLDataStringfromflex)

oxmlData.Save("c:\toto.xml")

 

 

Stuff I have tried with success

 

Passing a dataset to flex works. In the results you need to reference the (diffgram.Data.DataSet) in the soap.

 

Passing a class object to flex and back works.

 

Take this for example in vb.net

 

Public Class oParameter

Public name As String

      Public value As Long

End Class

 

<WebMethod(Description:="testing2")> _

    Public Function getParameters() As oParameter()

        Dim oParameters As oParameter() = New oParameter(2) {}

        oParameters(0) = New oParameter

        oParameters(0).name = "Bob"

        oParameters(0).value = 123

 

        oParameters(1) = New oParameter

        oParameters(1).name = "Mary"

        oParameters(1).value = 456

 

        oParameters(2) = New oParameter

        oParameters(2).name = "John"

        oParameters(2).value = 789

 

        Return oParameters

    End Function

 

<WebMethod(Description:="testing2")> _

    Public Sub SetParameters(ByVal SingleArray As oParameter())

       

 

    End Sub

 

If you pass call getParameters from flex it returns the correct object

You can pass that same object right back via SetParameters the SingleArray will contain the values.

 

You could probably do much more complicated stuff but the object structure in .net would need to be exactly the same as in flex. We can’t just pass any object as object then cast it in .net to it’s proper type. At least this is what I’ve learned. I did not spend a ton of time mind you but just enough to get an idea of the limits.

 

Hope this helps
 
 
Jason
 
 
 -----Message d'origine-----
De : [email protected] [mailto:[EMAIL PROTECTED]De la part de Matt Chotin
Envoyé : mardi 28 mars 2006 08:48
À : [email protected]
Objet : RE: [flexcoders] flex 2 integration with .net web service

I don't know .NET that well, can you take a HashMap or something similar
as the parameter into the web service?  You'd then just create the
object and pass it as the single param to the service.

Matt

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of nmsflex
Sent: Wednesday, March 22, 2006 8:24 AM
To: [email protected]
Subject: [flexcoders] flex 2 integration with .net web service

Hi there!

i'm playing around with flex 2 beta last two month, then i love it but
i have hard time to find details document about passing complex object
from flex to .net web service. There have very good couple articles
discuss about it but no one can explain deeply detail how this
integration part work.simple Example.

at client side i have 3 field data need to pass to web service.
1. first name.
2. last name.


after i get this information from user , then i create my own xml format

<register>
<userfirstname>first name</userfirstname>
<userlastname>last name</userlastname>
</register>

then i have to covert this to string xml then passing it that's the
way i work right now.

at back end i have function to receive string xml for input.


My question is:

is any way i can pass real xml object into web service tags in flex 2
and then at back - end i use XmlDocument parameter for input.

if it is possible? then how exactly it work. i know in flex 2 i can
write as3 function to call web service and passing object for
parameter input but after i pass that object then what happen?

i'm really looking for documents for this.

thanks for you help. 
 






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to