This is how I do it:
<mx:WebService id="ws" wsdl="http://myurl/service.asmx?WSDL"; 
   useProxy="false"  showBusyCursor="true">
    <mx:operation name="getMyFunction" result="projectsHandler(event)"/>

</mx:WebService>

Then in action script I go ws.getMyFunction(param1, param2, param3).

You don't have to define your parameters in MXML.  If you don't, Flex
will let you send as many or as little parameters as you want.  I only
get an error if the amount of parameters that I send don't match the
type and number on the server side.

Hope this helps,

Nate

--- In [email protected], "discipl4" <[EMAIL PROTECTED]> wrote:
>
> Hi friends - I have been wrestling with a problem that I was hoping
> you could help me out with :)
> 
> I understand the premise of defining a WebService in Flex, with
> parameters and data, and sending the data over the wire to my WSDL. 
> However, I have a unique situation where I want to assemble a dynamic
> XML file and send it over a WebService.  Unless you define a 1 to 1
> mapping of parameters in Flex to a WSDL, I cant find any way to make
> this work.
> 
> Example:  This works just fine as an operation on a webservice - 
> 
> <mx:operation name="SaveAction">
>  <mx:request>
>   <mx:myParameter>{someStringVariable}</mx:myParameter>
>  </mx:request>
> </mx:operation>
> 
> This is a 1 to 1 mapping of a parameter in Flex to my WSDL, which
> expects 1 value called myParameter.
> 
> However, if I pass in an XML object, SOAP will change all of my < and
> > to &lt; and &gt; to avoid breaking the SOAP envelope.  I understand
> the need to do this, but I just cant find a way around it.
> 
> Example:
> 
> var myXMLObject:XML = "<tag1><tag2></tag1></tag2>"
> 
> <mx:operation name="SaveAction">
>  <mx:request>
>   <mx:myParameter>{myXMLObject}</mx:myParameter>
>  </mx:request>
> </mx:operation>
> 
> The resulting packet across the wire will be one
> parameter(myparameter), with my XML as a string and all of the < and >
> encoded to &gt...etc.  I have tried every hack I can think of and I
> cant get this to work.  Has anyone else had experience using a
> dynamically sized XML as the model for a webservice?
> 
> Any help is MUCH appreciated :)
> 
> Best Regards,
> 
> - - Dan
> 
> p.s. - I have come up with ways around this.. such as sending as an
> HTTPService with contentType="application/xml".. or decoding the &gt,
> &lt on the webservice side.  Both of those work, but neither of those
> fit within the webservice standards we currently apply here.  Thanks
> again.
>


Reply via email to