4 Replies Latest reply on Dec 12, 2007 9:18 AM by Alberto_Mz

    Error using Webservices and Flex Hotfix 2

    Alberto_Mz
      Hi

      I have a webservice in VB.NET which has 2 parameters: an object and a string. I have tested the webservice on 2 computers both with Flex Builder 2.0.1 but only one with FB2 Hotfix 2.

      The webservice definition looks like this:

      <mx:WebService id="wsTest" wsdl="{strWebService}" showBusyCursor="true" result="wsResult();">
      <mx:operation name="wsFunction">
      <mx:request xmlns="">
      <objArray>{arrData}</objArray>
      <sData>{strData}</sData>
      </mx:request>
      </mx:operation>
      </mx:WebService>

      When i make the call to this webservice on the computer without the hotfix it works correctly but on the computer with the hotfix i always get this error message:

      faultCode:EncodingError faultString:'Cannot resolve element definition for name ' http://tempuri.org/::objArray'' faultDetail:'null'

      i have been looking for some information but i only found that it is a problem with the hotfix but i don't know if it's possible to fix this.

      There is another hotfix? or should i not use the hotfix?

      Does someone knows something about this issue?

      Thanks!
        • 1. Re: Error using Webservices and Flex Hotfix 2
          kcell Level 2
          Hi Alberto,

          your <objArray>{arrData}</objArray> cannot be encoded to a soap message, but you didn´t posted the part of the WSDL (how content of objArray should be defined) nor the content of arrData (how content is defined and used).

          Can you post the infos ?

          best regards,
          kcell
          • 2. Re: Error using Webservices and Flex Hotfix 2
            Alberto_Mz Level 1
            Hi,

            well the objArray is defined like this:

            [Bindable] private var objArray:ArrayCollection;

            and i use it as a dataProvider for a DataGrid:

            <mx:DataGrid id="dg_Data" dataProvider="{objArray}" >
            ...
            </mx:DataGrid>

            in the web service part when i am not using the hotfix i do this:

            <WebMethod()> _
            Public GetArray(ByVal objArray As Object, ByVal strUser As String) As String

            Dim element As Object
            Dim elemXML As XmlElement
            Dim nodes As XmlNodeList
            Dim i As Integer
            Dim strArrData(4) As String

            For Each element In objArray
            If TypeOf element Is XmlElement Then
            elemXML = DirectCast(element, XmlElement)
            nodes = elemXML.GetElementsByTagName("*")
            For i = 0 To nodes.Count - 1
            Select Case nodes.Item(i).Name

            Case "ID"
            strArrData(0) = nodes.Item(i).InnerXml
            Case "NAME"
            strArrData(1) = nodes.Item(i).InnerXml
            Case "ADDRESS"
            strArrData(2) = nodes.Item(i).InnerXml
            Case "POBOX"
            strArrData(3) = nodes.Item(i).InnerXml
            Case "AGE"
            strArrData(4) = nodes.Item(i).InnerXml

            End Select
            Next

            .........

            End If
            Next

            End Function

            after i read all data i save them into a data base and it works fine, but when i use the hotfix i get the error:

            faultCode:EncodingError faultString:'Cannot resolve element definition for name ' http://tempuri.org/::objArray'' faultDetail:'null'

            right now i am not using the hotfix but i would like to know if there is a solution for this error.

            Thanks!
            • 3. Re: Error using Webservices and Flex Hotfix 2
              kcell Level 2
              Hi Alberto,

              I gave one more look and recognized that the namespace is not set properly (cause its empty):
              <mx:request xmlns="">
              <objArray>{arrData}</objArray>
              <sData>{strData}</sData>
              </mx:request>

              The hotfix pays more attention to the namespace and try to resolve to which namespace the request belongs and this cause the error.

              Did you try to set the namespace or delete the xmlns="" entry?

              best regards,
              kcell



              • 4. Re: Error using Webservices and Flex Hotfix 2
                Alberto_Mz Level 1
                Hi

                I haven't tried what you recomend me but i will and i'll let you know if this work.

                thanks a lot!

                Alberto