0 Replies Latest reply on Oct 4, 2006 10:52 AM by ftremblay

    Webservice request serialization problem

    ftremblay
      Hi,

      I'm currently using webservices in flex and for most of them are working pretty well... except this case

      On my first try I did:


      <mx:WebService id="ws" wsdl="/_vti_bin/lists.asmx?WSDL" fault="GenerateFaultErrorMessages(event);">
      <mx:operation name="UpdateListItems">
      <mx:request format="xml">
      <UpdateListItems xmlns=" http://schemas.microsoft.com/sharepoint/soap/">
      <listName>{ws.GetListAndView.lastResult.GetListAndViewResult.ListAndView.View.Name}</list Name>
      <updates>
      <Batch OnError="Return">
      <Method ID='1' Cmd='New'>
      <Field Name='LinkTitle'>{inpTitle.text}</Field>
      <Field Name='Picture'>{inpPicture.text}</Field>
      <Field Name='Body'>{inpBody.text}</Field>
      </Method>
      </Batch>
      </updates>
      </UpdateListItems>
      </mx:request>
      </mx:operation>
      </mx:WebService>

      First Try resulted in:


      <?xml version="1.0" encoding="utf-8"?>
      <SOAP-ENV:Envelope xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/2001/XMLSchema">
      <SOAP-ENV:Body>
      <ns1:UpdateListItems xmlns:ns1=" http://schemas.microsoft.com/sharepoint/soap/">
      <ns1:listName />
      <ns1:updates>
      <ns1:Batch OnError="Return">
      <ns1:Method ID="1" Cmd="New">
      <ns1:Field Name="LinkTitle" />
      <ns1:Field Name="Picture" />
      <ns1:Field Name="Body" />
      </ns1:Method>
      </ns1:Batch>
      </ns1:updates>
      </ns1:UpdateListItems>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      Which is almost what I wanted except that it seems that the binding does not work probably because of the request format="xml" thing...



      On my second try I did:


      <mx:WebService id="ws" wsdl="/_vti_bin/lists.asmx?WSDL" fault="GenerateFaultErrorMessages(event);">
      <mx:operation name="UpdateListItems">
      <mx:request xmlns=" http://schemas.microsoft.com/sharepoint/soap/">
      <listName>{ws.GetListAndView.lastResult.GetListAndViewResult.ListAndView.View.Name}</list Name>
      <updates>
      <Batch OnError="Return">
      <Method ID='1' Cmd='New'>
      <Field Name='LinkTitle'>{inpTitle.text}</Field>
      <Field Name='Picture'>{inpPicture.text}</Field>
      <Field Name='Body'>{inpBody.text}</Field>
      </Method>
      </Batch>
      </updates>
      </mx:request>
      </mx:operation>
      </mx:WebService>

      Second Try resulted in:


      A compilation error :
      Severity Description Resource In Folder Location Creation Time Id
      2 Element may not contain both a binding expression and attribute initializers. Announcement.mxml SPFlexSite/body line 54 4 octobre 2006 13:44:26 2805

      the Name attribute seems to reserved and makes the compiler to fail

      Anyone knows another way to do this ?