0 Replies Latest reply on Nov 26, 2009 6:17 AM by infloop

    Coersion error cannot convert to qname

    infloop

      Dear members of the community,

       

      We are trying to build a flex application that talks to a standard SAP ESOA webservice.

      To do this we first generated action script through the option under data -> import webservice(WSDL).

       

      To call on the generated code we use the following:

       

      private function createnotif():void
              {
               var ws:BaseECC_SRVCREQCRTRC = new BaseECC_SRVCREQCRTRC();
              
               var req:servicerequest.ServiceRequestERPCreateRequestMessage_sync = new           servicerequest.ServiceRequestERPCreateRequestMessage_sync();
               var srvReq:ServiceRequest_type0 = new ServiceRequest_type0();
              
               var matId:ProductInternalID = new ProductInternalID();
               matId._ProductInternalIDContent = "10006806";        
               srvReq.IndividualMaterialID = matId ;
              
               var typeCode:ServiceRequestTypeCode = new ServiceRequestTypeCode();
               typeCode.serviceRequestTypeCodeContent = "S1";
               srvReq.TypeCode = typeCode;
              
               var desc:SHORT_Description = new SHORT_Description();
               desc.sHORT_DescriptionContent = "Sample!"
               srvReq.Description = desc;
              
               req.ServiceRequest = srvReq;
               ws.serviceRequestERPCreateRequestConfirmation_In(req);
                       
              //Createnotif.ServiceRequestERPCreateRequestConfirmation_In();
              } 

       

      However when we try to run this code we get the following error:

       

      TypeError: Error #1034: Type Coercion failed: cannot convert servicerequest::ProductInternalID@6f939e9 to QName.
          at mx.rpc.xml::XMLEncoder/encodeSimpleContent()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\ rpc\xml\XMLEncoder.as:1200]
          at mx.rpc.xml::XMLEncoder/encodeComplexType()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rp c\xml\XMLEncoder.as:769]
          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/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/encodeElementTopLevel()[E:\dev\3.0.x\frameworks\projects\rpc\src\m x\rpc\xml\XMLEncoder.as:1002]
          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 servicerequest::BaseECC_SRVCREQCRTRC/call()[C:\Documents and Settings\Smits\My Documents\Flex Builder 3\ESRISAP\src\servicerequest\BaseECC_SRVCREQCRTRC.as:259]
          at servicerequest::BaseECC_SRVCREQCRTRC/serviceRequestERPCreateRequestConfirmation_In()[C:\D ocuments and Settings\Smits\My Documents\Flex Builder 3\ESRISAP\src\servicerequest\BaseECC_SRVCREQCRTRC.as:243]
          at ESRISAP/createnotif()[C:\Documents and Settings\Smits\My Documents\Flex Builder 3\ESRISAP\src\ESRISAP.mxml:225]
          at ESRISAP/__Servicemelding_click()[C:\Documents and Settings\Smits\My Documents\Flex Builder 3\ESRISAP\src\ESRISAP.mxml:334]

       

      The suspected reason we found was  public function encodeType(type:QName, parent:XML, name:QName, value:*, restriction:XML = null):void in XMLEncoder.as. which in turn is called by public function encodeSimpleContent

       

      the variables at the time of the error occurrance:

      args    Object (@6e85ee9)  

       

          ServiceRequestERPCreateRequest_sync    servicerequest.ServiceRequestERPCreateRequestMessage_sync (@6e3fa81)   
              MessageHeader    null   
              ServiceRequest    servicerequest.ServiceRequest_type0 (@6d8dd29)   
                  Activity    null   
                  AttachmentFolder    null   
                  ContactParty    null   
                  Description    servicerequest.SHORT_Description (@6e3fc61)   
                      [inherited]   
                          sHORT_DescriptionContent    "Sample!"   
                      languageCode    null   
                  IndividualMaterialID    servicerequest.ProductInternalID (@6e85e99)   
                      [inherited]   
                          _ProductInternalIDContent    "10006806"   
                      schemeAgencyID    null   
                      schemeID    null   
                  InstallationPointID    null   
                  IssueParentServiceIssueCategoryID    null   
                  IssueServiceIssueCategoryCatalogueID    null   
                  IssueServiceIssueCategoryID    null   
                  Item    null   
                  MaintenancePlantID    null   
                  MaterialInternalID    null   
                  Party    null   
                  ReporterInternalID    null   
                  RequestedProcessingPeriod    null   
                  StatusObject    null   
                  Task    null   
                  TypeCode    servicerequest.ServiceRequestTypeCode (@6e85ec1)   
                      [inherited]   
                          serviceRequestTypeCodeContent    "S1"   
                      listAgencyID    null   
                      listID    null   
                      listVersionID    null   
                  VendorParty    null   
                  WorkCentreID    null  

       

      Could someone please advise on how to solve this issue.

      many thanks in advance.