Clarity

  • 1.  attribute BLOB to XML and XOG

    Posted Feb 02, 2018 02:36 PM

    Hi guys!!

    I need you help, please!

     

    So, how do I use data of attribute of type large string on XOG?

     

    Example:

    I saved a request a invoke webservice to use again, but when I try to use the parse, it does not work.
    Do I need to convert to xml again?

     

    I convert the BLOB in gelscript.

     

    <core:if test="${linha.REQUEST != null}">
    <core:invoke method="getSubString" on="${linha.REQUEST}" var="v_REQUEST">
    <core:arg type="long" value="1"/>
    <core:arg type="int" value="${linha.REQUEST.length()}"/>
    </core:invoke>
    </core:if>

    <gel:log level="INFO">v_REQUEST =${v_REQUEST}</gel:log>

     

    It work!

     

    But I can not add the values in the parse, then the invoke.

     

    <gel:parse var="soap_base">
    ${v_REQUEST}
    </gel:parse>

     

    <gel:set select="$soap_base" var="output" asString="true" />
    <gel:log level="INFO">output = <x:expr select="$output"/></gel:log>

     

    It is always null.

     

     

    My attribute with request is

     

    <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap

     

    Can you help me?

     

    Thanks!

     

    Daniel Barros

     



  • 2.  Re: attribute BLOB to XML and XOG
    Best Answer

    Posted Feb 02, 2018 07:57 PM

    If you pass a string into gel:parse it thinks it is the name of a file containing xml.

     

    Load your string into a ByteArrayInputStream and pass that to gel:parse.

     

        <core:new var="inputStreamReader" className="java.io.ByteArrayInputStream" >
            <core:arg value="${v_REQUEST.getBytes()}" />
        </core:new>
        <gel:parse var="soap_base" file="${inputStreamReader}" />

     

    V/r,

    Gene



  • 3.  Re: attribute BLOB to XML and XOG

    Posted Feb 05, 2018 08:16 AM

    Gene Greiff escreveu:

     

    If you pass a string into gel:parse it thinks it is the name of a file containing xml.

     

    Load your string into a ByteArrayInputStream and pass that to gel:parse.

     

        <core:new var="inputStreamReader" className="java.io.ByteArrayInputStream" >
            <core:arg value="${v_REQUEST.getBytes()}" />
        </core:new>
        <gel:parse var="soap_base" file="${inputStreamReader}" />

     

    V/r,

    Gene

    Hello, Gene!

    It worked!

    Thanks a lot!

     

    []'s

    Daniel Barros!



  • 4.  Re: attribute BLOB to XML and XOG

    Posted Nov 14, 2018 08:27 AM

    Can i have the full gel script for this?