1 Reply Latest reply on Aug 5, 2010 2:18 AM by KishorePTNVK

    Problem in Consuming Webservice response in Flex project

    KishorePTNVK

      Hi All,

       

      PF below the error which we are receiving in consuming the webmethod response data in Flex.

       

       

      1.     In Flex Builder (3.0)project, we imported 3rd party webservice using File -->Import --> Web Services (WSDL) option.

      Flex builder created automatically required proxy classes to consume the same those webservices.

       

      2.     We are trying to get data from one of the webmethod by passing required data as input. 3rd party Webservice is

      responding properly with result as expected, but generated action script files in flex project are not able to decode

      the response data.

       

      XMLDecoder.as file throwing the runtime error as given below while processing the response object.

       

      Error: Cannot find definition for type 'http://schemas.datacontract.org/2004/07/Eiq.Web.DTO.Location::AreaDTO'

                      at mx.rpc.xml::XMLDecoder/decodeType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\xml\X MLDecoder.as:1658]

                      at mx.rpc.soap::SOAPDecoder/decodeType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\soa p\SOAPDecoder.as:792]

                      at mx.rpc.xml::XMLDecoder/decodeElementTopLevel()[E:\dev\3.0.x\frameworks\projects\rpc\src\m x\rpc\xml\XMLDecoder.as:1156]

                      at mx.rpc.xml::XMLDecoder/decodeGroupElement()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\r pc\xml\XMLDecoder.as:1064]

                      at mx.rpc.xml::XMLDecoder/decodeSequence()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\x ml\XMLDecoder.as:1320]

                      at mx.rpc.xml::XMLDecoder/decodeComplexType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rp c\xml\XMLDecoder.as:920]

                      at mx.rpc.soap::SOAPDecoder/decodeComplexType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\ rpc\soap\SOAPDecoder.as:719]

                      at mx.rpc.xml::XMLDecoder/decodeType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\xml\X MLDecoder.as:1671]

                      at mx.rpc.soap::SOAPDecoder/decodeType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\soa p\SOAPDecoder.as:786]

                      at mx.rpc.xml::XMLDecoder/decodeElementTopLevel()[E:\dev\3.0.x\frameworks\projects\rpc\src\m x\rpc\xml\XMLDecoder.as:1156]

                      at mx.rpc.xml::XMLDecoder/decodeGroupElement()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\r pc\xml\XMLDecoder.as:1099]

                      at mx.rpc.xml::XMLDecoder/decodeSequence()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\x ml\XMLDecoder.as:1320]

                      at mx.rpc.xml::XMLDecoder/decodeComplexType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rp c\xml\XMLDecoder.as:920]

                      at mx.rpc.soap::SOAPDecoder/decodeComplexType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\ rpc\soap\SOAPDecoder.as:719]

                      at mx.rpc.xml::XMLDecoder/decodeType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\xml\X MLDecoder.as:1671]

                      at mx.rpc.soap::SOAPDecoder/decodeType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\soa p\SOAPDecoder.as:786]

                      at mx.rpc.xml::XMLDecoder/decode()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\xml\XMLDe coder.as:162]

                      at mx.rpc.soap::SOAPDecoder/decodeBody()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\soa p\SOAPDecoder.as:452]

                      at mx.rpc.soap::SOAPDecoder/decodeEnvelope()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc \soap\SOAPDecoder.as:304]

                      at mx.rpc.soap::SOAPDecoder/decodeResponse()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc \soap\SOAPDecoder.as:236]

                      at com.wellmaster.services.EIQ.WellWS::BaseWellWebService/processResult()[E:\Kishore\SVNProj ects\WellMasterApplication\src\com\wellmaster\

                      services\EIQ\WellWS\BaseWellWebService.as:448] at mx.rpc::AsyncResponder/result()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncResp onder.as:84]

                      at mx.rpc::AsyncRequest/acknowledge()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncR equest.as:74]

                      at DirectHTTPMessageResponder/completeHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\ messaging\channels\DirectHTTPChannel.as:381]

                      at flash.events::EventDispatcher/dispatchEventFunction()

                      at flash.events::EventDispatcher/dispatchEvent()

                      at flash.net::URLLoader/onComplete()

       

      Points from my analysis:

       

      1. Required AreaDTO.as  file is already available in flex project.

      2. Definition for “Area DTO” is already available in BaseWellWebserviceSchema.as file.

        • 1. Re: Problem in Consuming Webservice response in Flex project
          KishorePTNVK Level 1

          Received similar error at the time of sending information from flex to webs

          ervice. i.e at the time of encoding the object which just before sending info to webservice method.

           

          Error : Error: Cannot find definition for type 'http://schemas.datacontract.org/2004/07/Eiq.Web.DTO.Location::AreaDTO'
          at mx.rpc.xml::XMLEncoder/encodeType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\xml\X MLEncoder.as:1425]
          at mx.rpc.soap::SOAPEncoder/encodeType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\soa p\SOAPEncoder.as:747]
          at mx.rpc.xml::XMLEncoder/encodeElementTopLevel()[E:\dev\3.0.x\frameworks\projects\rpc\src\m x\rpc\xml\XMLEncoder.as:989]
          at mx.rpc.xml::XMLEncoder/encodeGroupElement()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\r pc\xml\XMLEncoder.as:890]
          at mx.rpc.xml::XMLEncoder/encodeSequence()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\x ml\XMLEncoder.as:1110]
          at mx.rpc.xml::XMLEncoder/encodeComplexType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rp c\xml\XMLEncoder.as:764]
          at mx.rpc.xml::XMLEncoder/encodeType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\xml\X MLEncoder.as:1431]
          at mx.rpc.soap::SOAPEncoder/encodeType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\soa p\SOAPEncoder.as:747]
          at mx.rpc.xml::XMLEncoder/encode()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\xml\XMLEn coder.as:80]
          at mx.rpc.soap::SOAPEncoder/encode()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\soap\SO APEncoder.as:690]
          at mx.rpc.soap::SOAPEncoder/encodePartValue()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rp c\soap\SOAPEncoder.as:597]
          at mx.rpc.soap::SOAPEncoder/encodeMessage()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\ soap\SOAPEncoder.as:548]
          at mx.rpc.soap::SOAPEncoder/encodeOperationAsDocumentLiteral()[E:\dev\3.0.x\frameworks\proje cts\rpc\src\mx\rpc\soap\SOAPEncoder.as:387]
          at mx.rpc.soap::SOAPEncoder/encodeBody()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\soa p\SOAPEncoder.as:322]
          at mx.rpc.soap::SOAPEncoder/encodeEnvelope()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc \soap\SOAPEncoder.as:188]
          at mx.rpc.soap::SOAPEncoder/encodeRequest()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\ soap\SOAPEncoder.as:158]
          at com.wellmaster.services.EIQ.WellWS::BaseWellWebService/call()[E:\Kishore\SVNProjects\Well MasterApplication\src\com\wellmaster\services\EIQ\WellWS\BaseWellWebService.as:396]
          at com.wellmaster.services.EIQ.WellWS::BaseWellWebService/createVersion()[E:\Kishore\SVNProj ects\WellMasterApplication\src\com\wellmaster\services\EIQ\WellWS\BaseWellWebService.as:38 0]
          at com.wellmaster.services.EIQ.WellWS::WellWebService/createVersion()[E:\Kishore\SVNProjects \WellMasterApplication\src\com\wellmaster\services\EIQ\WellWS\WellWebService.as:621]
          at com.wellmaster.view::CreateWellNew/createWell()[E:\Kishore\SVNProjects\WellMasterApplicat ion\src\com\wellmaster\view\CreateWellNew.mxml:781]
          at com.wellmaster.view::CreateWellNew/__MySubmitButton_click()[E:\Kishore\SVNProjects\WellMa sterApplication\src\com\wellmaster\view\CreateWellNew.mxml:1557]