22 Replies Latest reply on Aug 20, 2007 1:33 AM by kcell

    EncodingError

    Shah_Mohamed
      I have done a webservice through Flex, My request XML is proper, it is well formed and there is no problem until the request is made. But When i call this particular service it throws and exception which is below...

      if any one could able to find the solution for this ,my advance thanks to them, expecting good reply..

      FAultcode = EncodingError,
      FaultString = Cannot resolve element definition for name 'urn:tva:metadata:extended:2005::TVAMain'
      Message = faultCode:EncodingError faultString:'Cannot resolve element
      definition for name 'urn:tva:metadata:extended:2005::TVAMain''
      faultDetail:'null'

        • 1. Re: EncodingError
          kcell Level 2
          Hello Shah Mohamed,

          the encoding error means that the your flex client couldn´t build the soap message, which is than send through the webservice (server).

          You can use
          <mx:TraceTarget></mx:TraceTarget>
          to get more information what happend, you can also see than if the message was really send from the client to the webservice.

          For a deeper investigation we need :
          - a code example, how do you call the webservice
          - parts of the wsdl which are included (or the complete wsdl)

          best regards,
          kcell
          • 2. Re: EncodingError
            Shah_Mohamed Level 1
            thanks kcell...

            As you told, I have make a call to webservice after initializing the <mx:TraceTarget> ...
            what happen is after invoking the service it is loading the WSDL file and it can able creating the SOAP message.
            and while sending the message it throws an error.. I have added the stacktrace below . I have another doubt whether i need to escape the request XML before sending it. if so , wat to do...

            Expecting your reply...

            StackTrace:
            8/14/2007 12:41:05.351 [DEBUG] mx.rpc.soap.WebService WSDL loaded
            8/14/2007 12:41:11.307 [DEBUG] mx.rpc.soap.Operation Invoking SOAP
            operation uploadData
            8/14/2007 12:41:11.307 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP
            request envelope
            8/14/2007 12:41:11.323 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP
            request body
            8/14/2007 12:41:11.323 [INFO] mx.messaging.Producer
            '543B168B-427E-D09D-74C2-63361B378C55' producer sending message
            '16E0FA38-192C-F5C6-31EA-633637CBE3DB'
            8/14/2007 12:41:11.323 [DEBUG] mx.messaging.Channel
            'direct_http_channel' channel sending message:
            (mx.messaging.messages::SOAPMessage)#0
            body = "<SOAP-ENV:Envelope
            xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/"
            xmlns:xsd=" http://www.w3.org/2001/XMLSchema"
            xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
            <SOAP-ENV:Body>
            <ns1:get_Data xmlns:ns1="urn:tva:transport:2005">
            <ns1:PersonalInformation>
            <ns2:UserInformationTable
            xmlns:ns2="urn:tva:metadata:extended:2005">
            <ns2:UserInformation>
            <ns2:BiographicInformation>
            <ns2:Name>
            <ns3:GivenName lang="fdsa"
            xmlns:ns3="urn:tva:mpeg7:2005"
            xmlns=" http://www.w3.org/XML/1998/namespace">fdsa</ns3:GivenName>
            </ns2:Name>
            </ns2:BiographicInformation>
            </ns2:UserInformation>
            </ns2:UserInformationTable>
            </ns1:PersonalInformation>
            </ns1:get_Data>
            </SOAP-ENV:Body>
            </SOAP-ENV:Envelope>"
            clientId = "DirectHTTPChannel0"
            contentType = "text/xml; charset=utf-8"
            destination = "DefaultHTTP"
            headers = (Object)#1
            httpHeaders = (Object)#2
            SOAPAction = ""urn:uploadData""
            messageId = "16E0FA38-192C-F5C6-31EA-633637CBE3DB"
            method = "POST"
            recordHeaders = false
            timestamp = 0
            timeToLive = 0
            url = " http://localhost:8084/metasoft/services/MetasoftTVAService"
            8/14/2007 12:41:12.745 [INFO] mx.messaging.Producer
            '543B168B-427E-D09D-74C2-63361B378C55' producer acknowledge of
            '16E0FA38-192C-F5C6-31EA-633637CBE3DB'.
            8/14/2007 12:41:12.745 [ERROR] mx.messaging.Producer
            '543B168B-427E-D09D-74C2-63361B378C55' producer fault for
            '16E0FA38-192C-F5C6-31EA-633637CBE3DB'.
            [RPC Fault faultString="HTTP request error"
            faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent
            type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error
            #2032: Stream Error. URL:
            http://localhost:8084/metasoft/services/MetasoftTVAService" URL:
            http://localhost:8084/metasoft/services/MetasoftTVAService"
            at
            mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\dev\depot\flex\branches\flex _201_borneo\sdk\frameworks\mx\rpc\AbstractInvoker.as:193
            at
            mx.rpc::Responder/fault()[C:\dev\depot\flex\branches\flex_201_borneo\sdk\frameworks\mx\rp c\Responder.as:56]
            at
            mx.rpc::AsyncRequest/fault()[C:\dev\depot\flex\branches\flex_201_borneo\sdk\frameworks\mx \rpc\AsyncRequest.as:110]
            at
            DirectHTTPChannel.as$131::DirectHTTPMessageResponder/errorHandler()[C:\dev\depot\flex\bra nches\flex_201_borneo\sdk\frameworks\mx\messaging\channels\DirectHTTPChannel.as:345]
            at
            flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
            at flash.events::EventDispatcher/dispatchEvent()
            at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()
            • 3. Re: EncodingError
              Brant_Levinson
              Just to add to that...It looks as though you need access to the XSD's for reference. Here is a public accessible url for the actual webservice with a WSDL: http://www.mediaaddiction.com:8081/sandbox/services/MetasoftTVAService?wsdl. Thank you very much for your help...

              Brant
              • 4. EncodingError
                kcell Level 2
                Hi,

                Can you check if the webservice has received something ? ( log files )

                Flex client has logged "...producer acknowledge of ..." so I assume that the send was fine, but the error can be a result that the request could not be interpreted correctly.

                (deleted here a question to the wsdl, cause I recognized Brant`s post too late ;) .. I give a look )

                best regards,
                kcell
                • 5. Re: EncodingError
                  Brant_Levinson Level 1
                  We do not see anything in the logs although we only had the tomcat log on, We are looking into enabling the axis2 log. You may have to tell us what test you would like us to perform to get another log to happen so we can get back to you with more info.

                  Brant
                  • 6. Re: EncodingError
                    kcell Level 2
                    Hi Brant,

                    if the soap message was received by the tomcat, it should be logged in the axis2.log (never worked with the tomcat, but I have read that the axis is the soap monitor module).

                    Looking at the webservice wsdl and to the debug output I assume that the function "uploadData" is called with a xml with a "get_data" node as root. Is this correct and expected ?
                    ( "get_data" sounds more like a function call than a data structure)

                    best regards,
                    kcell
                    • 7. EncodingError
                      Brant_Levinson Level 1
                      Our side doesn't have any errors, can you determine why the response won't encode?
                      • 8. EncodingError
                        kcell Level 2
                        Did the axis.log contain any entry after you call "uploadData" ?

                        an example entry in a axis.log should look like:
                        2007-08-13 17:52:54,796 [http-8080-Processor24] DEBUG org.apache.axis.SOAPPart - Enter: SOAPPart::getAsString
                        2007-08-13 17:52:54,796 [http-8080-Processor24] DEBUG org.apache.axis.SOAPPart - Setting current message form to: FORM_STRING (currentMessage is now <?xml version="1.0" encoding="utf-8"?> ...soap message )
                        2007-08-13 17:52:54,796 [http-8080-Processor24] DEBUG org.apache.axis.SOAPPart - Exit: SOAPPart::getAsString(): <?xml version="1.0" encoding="utf-8"?>.. soap message

                        You should find the soap message you send (uploadData) and also the respone which returns. Please post the soap respones message which is logged in the axis.log.
                        • 9. Re: EncodingError
                          Shah_Mohamed Level 1
                          we couldn't find any message in the log file. We modified the request message as per the wsdl contract and landed into another error.

                          EncodingError: Cannot resolve attribute definition for ' http://www.w3.org/2001/XMLSchema::lang
                          • 10. Re: EncodingError
                            kcell Level 2
                            Hello Shah , Hello Brant,

                            @Brant: sorry I can´t determine why the response won´t encode, cause I didn´t know the response message.

                            @Shah: You didn´t post any trace output to your encoding error and didn´t describe how you have modified the request message.

                            Please note that I just can investigate the data you post through the forum.

                            best regards,
                            kcell



                            • 11. Re: EncodingError
                              Shah_Mohamed Level 1
                              Please refer below the trace output

                              8/16/2007 18:01:14.453 [DEBUG] mx.rpc.soap.Operation Invoking SOAP operation uploadData
                              8/16/2007 18:01:14.453 [DEBUG] mx.rpc.soap.Operation Invoking SOAP operation uploadData
                              8/16/2007 18:01:14.453 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP request envelope
                              8/16/2007 18:01:14.453 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP request envelope
                              8/16/2007 18:01:14.453 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP request body
                              8/16/2007 18:01:14.453 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP request body
                              8/16/2007 18:01:14.453 [INFO] mx.messaging.Producer '1736D74E-E5C4-5526-66B5-6EA73384589C' producer sending message '8C58572F-048F-82FD-58D4-6EA7F4158876'
                              8/16/2007 18:01:14.453 [INFO] mx.messaging.Producer '1736D74E-E5C4-5526-66B5-6EA73384589C' producer sending message '8C58572F-048F-82FD-58D4-6EA7F4158876'
                              8/16/2007 18:01:14.453 [DEBUG] mx.messaging.Channel 'direct_http_channel' channel sending message:
                              (mx.messaging.messages::SOAPMessage)#0
                              body = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
                              <SOAP-ENV:Body>
                              <ns1:upload_Personal_Data xmlns:ns1="urn:tva:transport:2005">
                              <ns1:PersonalInformation>
                              <ns2:UserInformationTable xmlns:ns2="urn:tva:metadata:extended:2005">
                              <ns2:UserInformation>
                              <ns2:BiographicInformation>
                              <ns2:Name>
                              <ns3:GivenName lang="pwd" xmlns:ns3="urn:tva:mpeg7:2005" xmlns=" http://www.w3.org/XML/1998/namespace">Seon</ns3:GivenName>
                              </ns2:Name>
                              </ns2:BiographicInformation>
                              </ns2:UserInformation>
                              </ns2:UserInformationTable>
                              </ns1:PersonalInformation>
                              </ns1:upload_Personal_Data>
                              </SOAP-ENV:Body>
                              </SOAP-ENV:Envelope>"
                              clientId = "DirectHTTPChannel0"
                              contentType = "text/xml; charset=utf-8"
                              destination = "DefaultHTTP"
                              headers = (Object)#1
                              httpHeaders = (Object)#2
                              SOAPAction = ""urn:uploadData""
                              messageId = "8C58572F-048F-82FD-58D4-6EA7F4158876"
                              method = "POST"
                              recordHeaders = false
                              timestamp = 0
                              timeToLive = 0
                              url = " http://localhost:8081/metasoft/services/MetasoftTVAService"
                              8/16/2007 18:01:14.453 [DEBUG] mx.messaging.Channel 'direct_http_channel' channel sending message:
                              (mx.messaging.messages::SOAPMessage)#0
                              body = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
                              <SOAP-ENV:Body>
                              <ns1:upload_Personal_Data xmlns:ns1="urn:tva:transport:2005">
                              <ns1:PersonalInformation>
                              <ns2:UserInformationTable xmlns:ns2="urn:tva:metadata:extended:2005">
                              <ns2:UserInformation>
                              <ns2:BiographicInformation>
                              <ns2:Name>
                              <ns3:GivenName lang="pwd" xmlns:ns3="urn:tva:mpeg7:2005" xmlns=" http://www.w3.org/XML/1998/namespace">Seon</ns3:GivenName>
                              </ns2:Name>
                              </ns2:BiographicInformation>
                              </ns2:UserInformation>
                              </ns2:UserInformationTable>
                              </ns1:PersonalInformation>
                              </ns1:upload_Personal_Data>
                              </SOAP-ENV:Body>
                              </SOAP-ENV:Envelope>"
                              clientId = "DirectHTTPChannel0"
                              contentType = "text/xml; charset=utf-8"
                              destination = "DefaultHTTP"
                              headers = (Object)#1
                              httpHeaders = (Object)#2
                              SOAPAction = ""urn:uploadData""
                              messageId = "8C58572F-048F-82FD-58D4-6EA7F4158876"
                              method = "POST"
                              recordHeaders = false
                              timestamp = 0
                              timeToLive = 0
                              url = " http://localhost:8081/metasoft/services/MetasoftTVAService"
                              8/16/2007 18:01:28.312 [INFO] mx.messaging.Producer '1736D74E-E5C4-5526-66B5-6EA73384589C' producer acknowledge of '8C58572F-048F-82FD-58D4-6EA7F4158876'.
                              8/16/2007 18:01:28.312 [INFO] mx.messaging.Producer '1736D74E-E5C4-5526-66B5-6EA73384589C' producer acknowledge of '8C58572F-048F-82FD-58D4-6EA7F4158876'.
                              8/16/2007 18:01:28.312 [ERROR] mx.messaging.Producer '1736D74E-E5C4-5526-66B5-6EA73384589C' producer fault for '8C58572F-048F-82FD-58D4-6EA7F4158876'.
                              8/16/2007 18:01:28.312 [ERROR] mx.messaging.Producer '1736D74E-E5C4-5526-66B5-6EA73384589C' producer fault for '8C58572F-048F-82FD-58D4-6EA7F4158876'.
                              [RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost:8081/metasoft/services/MetasoftTVAService" URL: http://localhost:8081/metasoft/services/MetasoftTVAService"
                              at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\dev\depot\flex\branches\flex _201_borneo\sdk\frameworks\mx\rpc\AbstractInvoker.as:193
                              at mx.rpc::Responder/fault()[C:\dev\depot\flex\branches\flex_201_borneo\sdk\frameworks\mx\rp c\Responder.as:56]
                              at mx.rpc::AsyncRequest/fault()[C:\dev\depot\flex\branches\flex_201_borneo\sdk\frameworks\mx \rpc\AsyncRequest.as:110]
                              at DirectHTTPChannel.as$131::DirectHTTPMessageResponder/errorHandler()[C:\dev\depot\flex\bra nches\flex_201_borneo\sdk\frameworks\mx\messaging\channels\DirectHTTPChannel.as:345]
                              at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
                              at flash.events::EventDispatcher/dispatchEvent()
                              at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()
                              • 12. Re: EncodingError
                                kcell Level 2
                                Hi Shah,

                                I wonder how you have created the output, cause it include two "parallel" calls.

                                How do you call the webservice ?

                                Is the webservice property "concurrency" set to "single"?
                                Its always good to add/remove event listener before and after a webservice call (also in failure case )

                                best regards,
                                kcell.

                                • 13. EncodingError
                                  Shah_Mohamed Level 1
                                  Please refer below the code through which we invoke the service.

                                  private var wsdl:String = " http://localhost:8081/metasoft/services/MetasoftTVAService?wsdl";
                                  private var metasoftWS:WebService;

                                  protected function initialize():void {
                                  initLogging();
                                  metasoftWS = new WebService();
                                  metasoftWS.useProxy = false;
                                  metasoftWS.wsdl = wsdl;
                                  metasoftWS.addEventListener("fault", faultHandler);
                                  }

                                  public function uploadPersonalData(uploadDataContent:String, callBack:Function):void {
                                  initialize();
                                  metasoftWS.uploadData.addEventListener("result", callBack);
                                  metasoftWS.uploadData.resultFormat = "xml";
                                  metasoftWS.loadWSDL();
                                  metasoftWS.uploadData(uploadDataContent);
                                  }

                                  Is there anything need to be added here?
                                  • 14. EncodingError
                                    Brant_Levinson Level 1
                                    Okay, we are still getting:
                                    Cannot resolve attribute definition for ' http://www.w3.org/2001/XMLSchema::lang'

                                    This happends from within Flex. This never makes it to our server. We use Charles (SOAP monitor) to check and no data is sent.

                                    Here is the function we are using:
                                    public function uploadPersonalData(uploadDataContent:String, callBack:Function):void {
                                    initialize();
                                    metasoftWS.uploadData.addEventListener("result", callBack);
                                    metasoftWS.uploadData.resultFormat = "xml";
                                    metasoftWS.loadWSDL();
                                    metasoftWS.uploadData(uploadDataContent);
                                    Alert.show("submitted");
                                    }

                                    Here is the output that we are getting for uploadDataContent when debugging:

                                    <tns:upload_Personal_Data xmlns:tva2="urn:tva:metadata:extended:2005" xmlns:soapenc=" http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:mpeg7="urn:tva:mpeg7:2005" xmlns:tns="urn:tva:transport:2005" xmlns:tva="urn:tva:metadata:2005" xmlns:xml=" http://www.w3.org/XML/1998/namespace"><tns:UserInformation><tva2:UserInformationTable><tva 2:UserInformation><tva2:BiographicInformation><tva2:Name><mpeg7:GivenName>Brant</mpeg7:Giv enName></tva2:Name></tva2:BiographicInformation></tva2:UserInformation></tva2:UserInformat ionTable></tns:UserInformation></tns:upload_Personal_Data>

                                    This same XML works fine in a SOAP packet through our SOAP testing software (mindreef), you should be able to test the same.

                                    Please use the same url we specified earlier for the web service:
                                    http://www.mediaaddiction.com:8081/sandbox/services/MetasoftTVAService?wsdl

                                    We really need help with this as it's holding up our development with flex.

                                    Regards,
                                    Brant
                                    • 15. Re: EncodingError
                                      Brant_Levinson Level 1
                                      Here is the debugger error, it looks like everything works fine until the last null pointer. We can't figure out why it complains about: ' http://www.w3.org/2001/XMLSchema::lang'. Can you tell by checking out our services (wsdl)?

                                      [SWF] D:\storage\metasoft\metasoft_flex\bin\iGallery-debug.swf - 2,423,669 bytes after decompression
                                      8/16/2007 23:25:00.246 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer set destination to 'DefaultHTTP'.
                                      8/16/2007 23:25:00.247 [INFO] mx.rpc.soap.Operation Creating SOAP Operation for uploadData
                                      ...

                                      ...
                                      body = (Object)#1
                                      clientId = "DirectHTTPChannel0"
                                      contentType = "application/x-www-form-urlencoded"
                                      destination = "DefaultHTTP"
                                      headers = (Object)#2
                                      httpHeaders = (Object)#3
                                      messageId = "12C2F1A7-7D9F-444B-C557-7280713D4A60"
                                      method = "GET"
                                      recordHeaders = false
                                      timestamp = 0
                                      timeToLive = 0
                                      url = " http://www.mediaaddiction.com:8081/metasoft/services/MetasoftTVAService?xsd=xsd82"
                                      8/16/2007 23:26:33.963 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of 'E2753C29-DECB-3283-3E1E-72806EA943FB'.
                                      8/16/2007 23:26:34.101 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of '9601CE74-CC8B-EEDE-1353-72806F660CC9'.
                                      8/16/2007 23:26:34.185 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of '59F4D58D-A4D6-325A-1137-72806EAA7725'.
                                      8/16/2007 23:26:34.243 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of '7E07FC12-4610-63AB-8948-72806F68B856'.
                                      8/16/2007 23:26:34.411 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of '95EE5821-585C-6346-07C6-72806F6A062C'.
                                      8/16/2007 23:26:34.482 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of 'BB19276A-2BCF-17AB-F427-72806F6C8CE1'.
                                      8/16/2007 23:26:34.540 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of '7C16ACCD-AE1D-4B8F-E345-72806F6D773B'.
                                      8/16/2007 23:26:34.614 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of '7794DC4A-E3A9-D80A-D133-72807061D08D'.
                                      8/16/2007 23:26:34.692 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of '6A9B4387-8F41-39A4-B263-728070976099'.
                                      8/16/2007 23:26:34.758 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of '5CA17B7F-BCEE-51C3-610C-728070E85BC5'.
                                      8/16/2007 23:26:34.825 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of '88D26ACC-0898-9825-1B63-728070EBF873'.
                                      8/16/2007 23:26:34.826 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer sending message '778E63C7-C72F-2DB7-7C6B-728074CA26DB'
                                      8/16/2007 23:26:34.826 [DEBUG] mx.messaging.Channel 'direct_http_channel' channel sending message:
                                      (mx.messaging.messages::HTTPRequestMessage)#0
                                      body = (Object)#1
                                      clientId = "DirectHTTPChannel0"
                                      contentType = "application/x-www-form-urlencoded"
                                      destination = "DefaultHTTP"
                                      headers = (Object)#2
                                      httpHeaders = (Object)#3
                                      messageId = "778E63C7-C72F-2DB7-7C6B-728074CA26DB"
                                      method = "GET"
                                      recordHeaders = false
                                      timestamp = 0
                                      timeToLive = 0
                                      url = " http://www.mediaaddiction.com:8081/metasoft/services/MetasoftTVAService?xsd=xsd85"
                                      8/16/2007 23:26:34.899 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of '12C2F1A7-7D9F-444B-C557-7280713D4A60'.
                                      8/16/2007 23:26:34.986 [INFO] mx.messaging.Producer '8CD8DA1D-58DC-23AC-D3D9-727F035626A2' producer acknowledge of '778E63C7-C72F-2DB7-7C6B-728074CA26DB'.
                                      8/16/2007 23:26:34.987 [DEBUG] mx.rpc.soap.WebService WSDL loaded
                                      8/16/2007 23:26:34.991 [INFO] mx.rpc.soap.AbstractWebService Invoking previously queued calls uploadData
                                      8/16/2007 23:26:34.992 [DEBUG] mx.rpc.soap.Operation Invoking SOAP operation uploadData
                                      8/16/2007 23:26:34.992 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP request envelope
                                      8/16/2007 23:26:34.992 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP request body
                                      [RPC Fault faultString="Cannot resolve attribute definition for ' http://www.w3.org/2001/XMLSchema::lang'" faultCode="EncodingError" faultDetail="null"]
                                      • 16. Re: EncodingError
                                        kcell Level 2
                                        Hi Shah,

                                        I suggest to put the loadwsdl call in the initialization function and wait until the wsdl is loaded, that will mean that the initialization function should be called during startup of you application.

                                        best regards,
                                        kcell

                                        import mx.rpc.soap.LoadEvent;
                                        import mx.rpc.soap.mxml.WebService;

                                        private var wsdl:String = " http://localhost:8081/metasoft/services/MetasoftTVAService?wsdl";
                                        private var metasoftWS:WebService;
                                        private var m_bWSloaded:Boolean;

                                        private function initializeWS():void {
                                        if (metasoftWS == null)
                                        {
                                        m_bWSloaded = false;
                                        initLogging();
                                        metasoftWS = new WebService();
                                        metasoftWS.useProxy = false;
                                        // metasoftWS.concurrency = "single" ; // try "single" m which means that only one call can be made per time otherwise a fault occure
                                        metasoftWS.wsdl = wsdl;
                                        metasoftWS.addEventListener("fault", faultHandler);
                                        metasoftWS.addEventListener("load" ,wsdlLoaded);
                                        metasoftWS.loadWSDL();
                                        }
                                        }
                                        private function wsdlLoaded(event:LoadEvent):void
                                        {
                                        metasoftWS.removeEventListener("load" ,wsdlLoaded);
                                        m_bWSloaded = true;
                                        }

                                        public function uploadPersonalData(uploadDataContent:String, callBack:Function):void {
                                        // initialize(); // initialze should be called once for initalzation not before every call
                                        // wait until the wsdl is loaded (m_bWSloaded == true)
                                        if ( m_bWSloaded == true)
                                        {
                                        metasoftWS.uploadData.addEventListener("result", callBack);
                                        metasoftWS.uploadData.resultFormat = "xml";
                                        metasoftWS.uploadData(uploadDataContent);
                                        }
                                        }

                                        • 17. Re: EncodingError
                                          kcell Level 2
                                          Hi Brant,

                                          Please try this again with the code from my last post.

                                          From the debug output I see that there are a lot of queued calls:
                                          ...
                                          8/16/2007 23:26:34.991 [INFO] mx.rpc.soap.AbstractWebService Invoking previously queued calls uploadData
                                          ...
                                          To avoid that there is a conflict with multiple calls you can try to use the metasoftWS.concurrency = "single".

                                          I am no expert in xsd, but the ::lang tag seems to be involved in some namespaces and schemas.
                                          Can you modify or configure an attribute xml:lang="en" lang="en" for the GivenName tag or for the whole message "upload_Personal_Data "?

                                          best regards,
                                          kcell
                                          • 18. EncodingError
                                            Shah_Mohamed Level 1
                                            Hi kcell,

                                            We tried with the sample code provided, but still we get the same problem.

                                            When a service is invoked during the initialization itself, the m_bWSloaded property specified is returning false which inturn skips the function.

                                            One morething, when concurrency property was set to "single", we got errors.

                                            Error: Cannot assign operations into an RPC Service (concurrency)
                                            • 19. Re: EncodingError
                                              kcell Level 2
                                              Hi Shah,

                                              the WSDL must be loaded before ANY function is called, otherwise the webservice class didn`t know how to decode/encode your function call .
                                              So the code make sense, but you should be aware in your application design that the service is not called before the wsdl is loaded.

                                              You can use dispatch an (custom) event in the wsdlLoaded function, to inform any listener that the service is now ready for service calls.

                                              I assumed that the "single" property doesn´t fit to your application, but for debugging reasons it may make sense to test the calls one by one, instead of sending multiple calls simultaneously. Maybe you can use a member variable as counter to limit the calls (increase after each call and if counter reached a value (counter == 1) you can suppress the call.) Just an idea ... code will something like this

                                              private var m_FunctionCounter:Number;
                                              ...
                                              private function initializeWS():void {
                                              ...
                                              m_FunctionCounter = 0;
                                              }
                                              public function uploadPersonalData(uploadDataContent:String, callBack:Function):void {
                                              if ( m_FunctionCounter > 1) // modify me for more calls ;)
                                              return;
                                              m_FunctionCounter++;
                                              ...

                                              }

                                              best regards and a nice weekend,
                                              kcell





                                              • 20. EncodingError
                                                Brant_Levinson Level 1
                                                The lang attribute is optional based on the contract, although we have put the optional items in there just to check, here is our XML in “uploadDataContent” when debugging:

                                                <tns:upload_Personal_Data xmlns:xml=" http://www.w3.org/XML/1998/namespace" xmlns:tva2="urn:tva:metadata:extended:2005" xmlns:soapenc=" http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:mpeg7="urn:tva:mpeg7:2005" xmlns:tns="urn:tva:transport:2005" xmlns:tva="urn:tva:metadata:2005">
                                                <tns:UserInformation>
                                                <tva2:UserInformationTable>
                                                <tva2:UserInformation userInformationId="">
                                                <tva2:BiographicInformation>
                                                <tva2:Name xml:lang="en">
                                                <mpeg7:GivenName xml:lang="en">Brant Levinson</mpeg7:GivenName>
                                                </tva2:Name>
                                                </tva2:BiographicInformation>
                                                </tva2:UserInformation>
                                                </tva2:UserInformationTable>
                                                </tns:UserInformation>
                                                </tns:upload_Personal_Data>

                                                I downloaded the SDK where it says that it’s open source and tried to find out where it errors out. I’ve checked the log:

                                                8/17/2007 21:25:55.932 [INFO] mx.rpc.soap.AbstractWebService Invoking previously queued calls uploadData
                                                8/17/2007 21:25:55.932 [DEBUG] mx.rpc.soap.Operation Invoking SOAP operation uploadData
                                                8/17/2007 21:25:55.932 [DEBUG] mx.rpc.soap.Operation Invoking SOAP operation uploadData
                                                8/17/2007 21:25:55.933 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP request envelope
                                                8/17/2007 21:25:55.933 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP request envelope
                                                8/17/2007 21:25:55.933 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP request body
                                                8/17/2007 21:25:55.933 [DEBUG] mx.rpc.soap.SOAPEncoder Encoding SOAP request body

                                                Although can’t find the SOAPEncoder in the code. I guess that source isn’t available.

                                                It would be great if you guys could run the example code provided above including the above XML, examine the error locally, and see if you can find a solution? It may be more visible to you because you have access to the SDK source code. This may be a bug with Flex.

                                                Note: It would be helpful if there was a more precise error.

                                                Regards,

                                                Brant
                                                • 21. EncodingError
                                                  Brant_Levinson Level 1
                                                  edited - accidentally posted twice...
                                                  • 22. Re: EncodingError
                                                    kcell Level 2
                                                    Hi Brant,

                                                    I am not working at Adobe, if you like to talk to someone from Adobe you should contact Adobe or find an Adobe guy here in the forum ( I just know peterent / http://weblogs.macromedia.com/pent/ ).

                                                    The SDK is open source for version 3.0, but Adobe changed a lot from 2.01 to version 3.0 /(or 2.01 Hotfix 2) as you can read here http://kb.adobe.com/selfservice/viewContent.do?externalId=kb402005
                                                    and
                                                    http://kb.adobe.com/selfservice/viewContent.do?externalId=kb402000&sliceId=2
                                                    .

                                                    You may also check the bug and issue managment system ( http://bugs.adobe.com/flex/). for similar entries.

                                                    best regards,
                                                    kcell