1 Reply Latest reply on Jan 7, 2008 7:37 AM by enzo1020vienna

    sending xml to webservice

    kittuokkade Level 1
      hi ,

      i want to send xml string as input to a webservice .i had a problem with this. iam pasting the code iam using.

      public var sResult:String="<?xml version='1.0' encoding='UTF-8' ?>
      <mx:WebService id="myws"
      wsdl=" http://localhost:8080/myws/method?wsdl"
      <mx:operation name="getCD" result="resultHandler(event)" fault="Alert.show(event.fault.message)">
      <String_1> {sResult} </String_1>
      <mx:Panel width="652" height="408">
      <mx:Button x="368" y="2" label="Lot_id" id="mybutton" click="myws.getCD.send()"/>

      when i use any string for sResult .it is working fine.but when i use xml string it is giving the error SOAP request error.
      i need ur help.
        • 1. Re: sending xml to webservice
          So i didn't know, if your question is still valid - but I had exactly the same problem and sovled it, using actionscript.
          The webservice operation has a request attribute, which accepts XML without problems. Short Example:
          <mx:WebService id="myWebService"
          useProxy="false" showBusyCursor="true" load="wsLoad(event)">
          <mx:operation name="calculate" fault="wsFault(event)"
          result="wsResult(event)" />
          <mx:Script> /* ... */
          private function calculate():void {
          myRequestParameter:XML = <myXml/>;
          myWebService.calculate.request = myRequestParameter;
          /* ...... */
          <mx:button click="calculate()" />