8 Replies Latest reply on Jan 12, 2016 1:36 PM by shawkins

    Webservice datasource only getting partial result.

    realmad

      Hi,

       

      I have created a vdb using webservice as a data source.. Below is the transformation for the response procedure generated by teiid designer.

       

      BEGIN
          SELECT t.* FROM XMLTABLE(XMLNAMESPACES('http://webservices.samples.jboss.org/' AS tns), '/tns:getFileInputResponse/return' 
          PASSING DataServiceView.getFileInput_response.xml_in COLUMNS content string PATH '/content', name string PATH '/name', id integer PATH '/id') AS t;
      END
      
      

       

      content is actually byte[] having file content. So its a base64Binary when it comes from webservice. However base64Binary is not recognized as a type by the transformation editor so I had to change it to string as I realized that the run time type representation of base64Binary.

       

      This response procedure is used in a view FileInput with columns content, name, id.

       

      When I query using statement Select content from FileInput where id =1; I get only partial result of actual content. I know that webservice is returning the complete result as I checked it with SoapUI.


      I wanted to know if there is any configuration or any workaround that needs to be employed to get the complete response.


      Thank you.

        • 1. Re: Webservice datasource only getting partial result.
          shawkins

          With what you have above, I'm assuming you have a document such as:

           

          getFileInputResponse

          --return

          ----content

          ----name

          ----path

          --return

          ----content

          ----name

          ----path

          ...

           

          Then you are filtering to only the return elements that had an id of 1, correct?  So are you saying that there are other return element contents that should be returned but are not?

          • 2. Re: Webservice datasource only getting partial result.
            realmad

            oh no what I wanted to say was content element holds the base64 string representation of file content but the length of the value is only 4000 characters instead of 8496 characters. So its truncated.

             

            If I call the web service directly the value of content is 8496 characters.

             

            Here is the properties for content field

             

             

            Thanks.

            • 3. Re: Webservice datasource only getting partial result.
              shawkins

              See FROM Clause - Teiid 8.12 - Project Documentation Editor

               

              Rather than using the string type, which has a default limit of 4000 characters, you would use:

               

              content varbinary PATH 'xs:base64Binary(/content)'

               

              That should give the fully content as a byte array.

              • 4. Re: Webservice datasource only getting partial result.
                realmad

                Hi,

                 

                Thanks for the tip.

                 

                I have changed my transformation to

                 

                BEGIN  
                SELECT t.* FROM XMLTABLE(XMLNAMESPACES('http://webservices.samples.jboss.org/' AS tns), '/tns:getFileInputResponse/return'  
                PASSING DataServiceView.getFileInput_response.xml_in COLUMNS content  varbinary PATH 'xs:base64Binary(/content)', name string PATH '/name', id integer PATH '/id') AS t;  
                END
                


                and I have changed the property of content to varbinary

                but I get the following error in Teiid designer


                The column 'content' with runtime type 'string' does not match the runtime type 'varbinary' from the query transformation.   
                

                 

                I see the run time type for varbinary is string and I don't see varbinary type in runtime.


                I need help on how to proceed further.

                 

                Thanks.

                • 5. Re: Webservice datasource only getting partial result.
                  shawkins

                  > but I get the following error in Teiid designer

                   

                  That should be saying that the procedure result set or some other place in your vdb still thinks that the type for content is string.  Teiid Designer won't automatically correct the usage of a column once the type is changed.  So check any where you are referencing content and see if you are expecting a string and change it to varbinary.

                   

                  > I see the run time type for varbinary is string and I don't see varbinary type in runtime.

                   

                  The runtime type for varbinary is the varbinary type.  Depending upon what you are looking at, you may be seeing Designer walk the xsd base types for varbinary, which will go varbinary->base64Binary->anySimpleType and then may show the base representation of anySimpleType as string.  If it seems to actually be saying that the runtime type will be string, then please capture a screenshot and log a Teiid Designer issue - https://issues.jboss.org/browse/TEIIDDES

                  • 6. Re: Webservice datasource only getting partial result.
                    xyran

                    I am not sure whats happening. I have changed all the references to varbinary and still have the error.

                     

                    Here is my model

                     

                    getFileInput_response() --> GetFileInput() // wrapper procedure -->  FileInput_View // final view

                     

                    The content type in all of them is varbinary.

                     

                    Below is the screenshot that shows run-time type of varbinary as a string. Not sure how relevant this is

                    2016-01-11 13_59_57-Select a Datatype.png

                     

                    I am using Jboss dev studio 8 with teiid designer 9.2

                     

                    Thanks.

                    • 7. Re: Webservice datasource only getting partial result.
                      shawkins

                      It does seem like a Designer issue, what version are you on?

                       

                      A workaround would be to use a blob type instead of varbinary.

                      • 8. Re: Webservice datasource only getting partial result.
                        shawkins