Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Wsdl SOAP - Can't get into callback : _3 is undefined

    Wsdl response is successfully received (which can be seen in firebug console, POST returns 200 OK). But after that my callback function is not called. Copied below is response part inside of SOAP-ENV:Body tag (please pay attention to type struct Element):

    <ns1:genericResponse xmlns:ns1="urn:genericWsdl">
    <return xsi:type="tns:OutData">
    <errcode xsi:type="xsd:string">0</errcode>
    <errtext xsi:type="xsd:string"></errtext>
    <data xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:Element[1]">
    <item xsi:type="tns:Element">
    <elementid xsi:type="xsd:string">id_of_elem</elementid>
    <elementdata xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:Data[2]">
    <item xsi:type="tns:Data">
    <key xsi:type="xsd:string">id</key>
    <value xsi:type="xsd:string">system</value>
    </item>
    <item xsi:type="tns:Data">
    <key xsi:type="xsd:string">description</key>
    <value xsi:type="xsd:string">System namespace</value>
    </item>
    </elementdata>
    </item>
    </data>
    </return>
    </ns1:genericResponse>

    'Contacting server...' message remains forever and callback (properly passed as second parameter to DataSource.fetchData()) is not called. In Developer Console can be found warning possibly pointing to problem:

    XRP3:WARN:Log:TypeError: _3 is undefined

    When I use similar response but using only Element struct type, this time not packing it into array everything works fine. Callback is properly called and there is not any warning. It differs only in data part from above.

    NO PROBLEMS:
    <data xsi:type="tns:Element">
    <elementid xsi:type="xsd:string">id_of_elem</elementid>
    <elementdata xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:Data[2]">
    <item xsi:type="tns:Data">
    <key xsi:type="xsd:string">id</key>
    <value xsi:type="xsd:string">system</value>
    </item>
    <item xsi:type="tns:Data">
    <key xsi:type="xsd:string">description</key>
    <value xsi:type="xsd:string">System namespace</value>
    </item>
    </elementdata>
    </data>

    It seems problem is caused by using array of Element struct type. Since I need to pass an array of Element structures, could you please help me about this?

    #2
    This could be caused by many different things, there's no way to tell what the problem is from this information.

    Please post a stack trace for the JS error (from the Developer Console in IE) and the complete WSDL and how you are calling it.

    Comment


      #3
      Thanks for response! Sorry for delay in sending details, I was not able to be in the office and to have access to web service until today.

      Trying to use IE Developer Console, I've got different behavior from FF. Using IE debugging, I got into callback! (Using Firebug it didn't happen, so I couldn't be aware of getting into callback). But I still have problems to read some data.

      I will divide details in few files. To show way of calling, I've put partly three relevant functions in jsFunctions.js. Here I would just like to point to few important places (main problem is in point1) :

      1. In jsFunctions.js loadWSDL() is called from callWsdl(). Callback function is componentDataLoaded() in which data are fetched, after which componentDataFetched() is called fine, but there problem is appears. In jsFunctions.js line 7 elementdata is undefined.
      In Watch window of IE Developer Tools can be seen that other passed stuff are defined and readable (elementid, errcode, errtext). I've copied here just few important lines:
      [-] dataArr {...} Object
      [-] [0] {...} Object
      [-] data {...} Object
      [-] [0] {...} Object
      elementid "id_namespaces_c0_t0_e00" String
      elementdata undefined Undefined
      errcode "0" String
      errtext "" String

      2. In stack-trace-developer-console.txt only last two lines are relevant, I believe, showing that elementId is: "id_namespaces_c0_t0_e00" and elementData is: undef.

      3. In genericWsdl.php : line 162 is place where output array from WSDL is set.

      4. In response.xml is POST response copied from Firebug console which content is the same as in XML Comm Watcher from IE Developer Console. There elementdata can be found, and from my perspective it seems correctly.

      Hopefully, attachments will be sufficient to understand problem and help me about solution. The question is why elementdata is undefined in jsFunctions.js line 7 ?
      Attached Files

      Comment


        #4
        Complete WSDL can be found in attached wsdl.xml.
        Attached Files

        Comment


          #5
          Still missing all the critical info. We've got code snippets showing calls to a WSDL service where the operatioName, resultType or XPath etc are not shown. You're also strangely claiming a JS error but have shown Developer Console logs where none is reported.

          What you should do is create a standalone test case that we can run to see the problem.

          Comment


            #6
            I've done suggested test case, but it consists of several files including small nusoap library, so it seemed better to send it all in one test.zip file. Since here that extension is not allowed, I've sent it to services@isomorphic.com, hopefully it will be forwarded to you.

            Here I've attached SmartClient Developer Console.JPG where it can be seen on XML Comm Watcher correct elementid of "string" type and elementdata of Array type. But at the same moment in Log Messages area can be seen that:

            15:33:13.515:XRP7:WARN:Log:elementId is: "testListGridId"
            15:33:13.515:XRP7:WARN:Log:elementData is: undef

            (Log:Error below is not relevant since it is caused by fact that elementData is undefined, so please do not pay attention to it)

            Two stated warnings above are called by me for check purposes in callback in a way as similar as:
            isc.logWarn("elementData is: " + isc.echo(data.elementdata));

            Problem is that elementdata is undefined, which I do not understand why, since it can be seen that it is present in XML Comm Watcher ?

            I hope you'll be able to get test.zip. After extracting it to your localhost root per example, you just need to do some small changes in test/web-frontend/index.php. Variable isomorphicDir (line 13) should be changed to point to isomorphic library on your pc and below that line paths to several isc_ files should be changed also. Then calling from browser's address bar ... test/web-frontend/index.php should allow you to see the problem.

            By putting breakpoint to callback dataFetched() function (TestManager.js line 44), you can be able to see that elementdata is undefined, while elementid can be correctly read. For that please use IE Developer Tools, since in Firebug I cannot get stop at breakpoint there!?

            To convince that code is working fine in case when simple Element data is passed you can search for comment string " // For passing just one Element, in case of no ElementArray " (once in TestManager.js and twice in genericWsdl.php), then comment line above that comment and uncomment line below it.

            Thank you for your attention! I hope you will not find this too demanded and that you will be able to help.

            Comment


              #7
              SmartClient Developer Console IE screenshot
              Attached Files

              Comment

              Working...
              X