WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

mwso2
This post was updated on .
Hi ...

I'm making a soap call to an endpoint service through ESB6.1.1 from SOAPUI PROXY CONFIGURATION
((( I bloted out some information with xxx )))


<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="xxxxWs_Based_Proxy" startOnLoad="true" statistics="disable" trace="enable" transports="http,https">
    <target>
        <inSequence>
            <property name="FORCE_HTTP_1.0" scope="axis2" type="STRING" value="true"/>
            <property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>
            <property name="EXPECT-100" scope="axis2" type="STRING" value="true"/>
            <log level="full"/>
        </inSequence>
        <outSequence>
            <log level="full"/>
            <send/>
        </outSequence>
        <endpoint>
            <wsdl port="xxxxWsPort" service="xxxxxWsService" uri="file:/var/www/html/xxxxWs.wsdl"/>
        </endpoint>
    </target>
    <description/>
</proxy>


SOAPUI receives a correct response when the endpoint service returns a 'SOAP response'.
But i have other soap call that is returning the next non-soap formatted response:


NON-SOAP ENDPOINT RESPONSE
--urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1xxxxx8bxc
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: <urn:uuid:3xcxxx4b-x9ea-xxf6-81c3-8a8xxxxe6bx7>

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://xxxx.es/xxxx/ws/xxxxws_/1.0/infoEnvio">
<SOAP-ENV:Body>
<resultadoInfoEnvio>
<ns1:identificador>xa3x2xxxxx8xx7</ns1:identificador>
</resultadoInfoEnvio>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

--urn:uuid:a07xxx6-9xxx9-4xxa1-xx9c-a91dxxbcc
Content-Type: application/octet-stream; charset=utf-8
Content-Transfer-Encoding: binary
Content-ID: <urn:uuid:69xxx17b-x96c-xx3e-9x78-721dxxxxxxa23>
http://xx.x.x.xxx/Texto_de_prueba.txt
--urn:uuid:a07xxx6-9xxx9-4ea1-bxxc-a9xxx0c8bcc-


The problem is that wso2-esb doesn't return the response to SOAPUI because this ESB error:


TID: [-1234] [] [2017-12-21 17:15:38,305] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} -  Error while building Passthrough stream {org.apache.synapse.transport.passthru.util.RelayUtils}
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'


I'm only interested in reading last SOAP-ENV response from SOAPUI. For getting the solution. I would like to TRANSFORM 'ONLY' THE PROXY RESPONSE to a format that SOAPUI can read.

For solving the problem. I added the property messageBuilder to the proxy's out-sequence configuration:

NEW OUT-SEQUENCE PROXY CONFIGURATION
        <outSequence>
            <builder>
                <messageBuilder class="org.wso2.carbon.relay.BinaryRelayBuilder" contentType="text/xml" formatterClass="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
            </builder>
            <log level="full"/>
            <send/>
        </outSequence>

Note: When i added the last property messageBuilder. WSO2 editor added itself this new properties:

<outSequence>
    <builder>
        <messageBuilder class="org.apache.axis2.builder.ApplicationXMLBuilder" contentType="application/xml" formatterClass="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
        <messageBuilder class="org.apache.axis2.builder.MIMEBuilder" contentType="multipart/related"/>
        <messageBuilder class="org.apache.axis2.builder.SOAPBuilder" contentType="application/soap+xml" formatterClass="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
        <messageBuilder class="org.apache.axis2.json.JSONBuilder" contentType="application/json" formatterClass="org.apache.axis2.json.JSONMessageFormatter"/>
        <messageBuilder class="org.apache.axis2.builder.MTOMBuilder" contentType="application/xop+xml"/>
        <messageBuilder class="org.apache.axis2.builder.XFormURLEncodedBuilder" contentType="application/x-www-form-urlencoded" formatterClass="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
    </builder>
    <log level="full"/>
    <send/>
</outSequence>

But unfortunately i don't get any response in SOAPUI :(


After I maked other tests adding the next properties in outsequence. But with no effect:

<property name="ContentType" value="text/xml" scope="axis2"/>
<property name="messageType" value="text/xml" scope="axis2"/>

Note: I have used always the axis2.xml default file.

¿ Do you know which property should i use in my proxy configuration for managing this kind of text responses?


Thanks ...


_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

Vinod Kavinda
HI,
I'm sorry, I'm not clear about your question. Too much info :)

However, if you need to passthrough a non-standard content type, add following message formatter and builder to your axis2.xml. 
<messageFormatter contentType="application/binary" class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
<messageBuilder contentType="application/binary" class="org.wso2.carbon.relay.BinaryRelayBuilder"/>

Here the content type should be whatever content type your backend is sending. Refer [1] for more info on message Relay.


Regards,
Vinod

On Thu, Jan 11, 2018 at 11:47 PM, Marcos Tarín Esteve <[hidden email]> wrote:

Hi …

I’m making a soap call to an endpoint service through ESB6.1.1 from SOAPUI

PROXY CONFIGURATION

((( I bloted out some information with xxxx )))

 

<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="xxxxWsV2_Based_Proxy" startOnLoad="true" statistics="disable" trace="enable" transports="http,https">

    <target>

        <inSequence>

            <property name="FORCE_HTTP_1.0" scope="axis2" type="STRING" value="true"/>

            <property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>

            <property name="EXPECT-100" scope="axis2" type="STRING" value="true"/>

            <log level="full"/>

        </inSequence>

        <outSequence>

            <log level="full"/>

            <send/>

        </outSequence>

        <endpoint>

            <wsdl port="xxxxWsV2Port" service="xxxxxWsV2Service" uri="file:/var/www/html/xxxxWsV2.wsdl"/>

        </endpoint>

    </target>

    <description/>

</proxy>

SOAPUI receives a correct response when the endpoint service returns a ‘SOAP response’.

But i have other soap call that is returning the next non-soap formatted response:

NON-SOAP ENDPOINT RESPONSE

--urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1xxxxx8bxc

Content-Type: text/xml; charset=utf-8

Content-Transfer-Encoding: 8bit

Content-ID: <urn:uuid:3xcxxx4b-x9ea-xxf6-81c3-8a8xxxxe6bx7>

 

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://xxxx.es/xxxx/ws/xxxxws_v2/1.0/infoEnvioV2">

<SOAP-ENV:Body>

<resultadoInfoEnvioV2>

<ns1:identificador>xa3x2xxxxx8xx7</ns1:identificador>

</resultadoInfoEnvioV2>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

--urn:uuid:a07xxx6-9xxx9-4xxa1-xx9c-a91dxxbcc

Content-Type: application/octet-stream; charset=utf-8

Content-Transfer-Encoding: binary

Content-ID: <urn:uuid:69xxx17b-x96c-xx3e-9x78-721dxxxxxxa23>

http://xx.x.x.xxx/Texto_de_prueba.txt

--urn:uuid:a07xxx6-9xxx9-4ea1-bxxc-a9xxx0c8bcc—

The problem is that wso2-esb doesn’t return the response to SOAPUI because this ESB error:

TID: [-1234] [] [2017-12-21 17:15:38,305] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} -  Error while building Passthrough stream {org.apache.synapse.transport.passthru.util.RelayUtils}

org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'

I'm only interested in reading last SOAP-ENV response from SOAPUI.

For getting the solution. I would like to TRANSFORM ‘ONLY’ THE PROXY RESPONSE to a format that SOAPUI can read.

For solving the problem. I added the property messageBuilder to the proxy’s out-sequence configuration:

NEW OUT-SEQUENCE PROXY CONFIGURATION

        <outSequence>

            <builder>

                <messageBuilder class="org.wso2.carbon.relay.BinaryRelayBuilder" contentType="text/xml" formatterClass="org.apache.axis2.transport.http.SOAPMessageFormatter"/>

            </builder>

            <log level="full"/>

            <send/>

        </outSequence>

Note: When i added the last property messageBuilder. WSO2 editor added itself this new properties:

<outSequence>

    <builder>

        <messageBuilder class="org.apache.axis2.builder.ApplicationXMLBuilder" contentType="application/xml" formatterClass="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>

        <messageBuilder class="org.apache.axis2.builder.MIMEBuilder" contentType="multipart/related"/>

        <messageBuilder class="org.apache.axis2.builder.SOAPBuilder" contentType="application/soap+xml" formatterClass="org.apache.axis2.transport.http.SOAPMessageFormatter"/>

        <messageBuilder class="org.apache.axis2.json.JSONBuilder" contentType="application/json" formatterClass="org.apache.axis2.json.JSONMessageFormatter"/>

        <messageBuilder class="org.apache.axis2.builder.MTOMBuilder" contentType="application/xop+xml"/>

        <messageBuilder class="org.apache.axis2.builder.XFormURLEncodedBuilder" contentType="application/x-www-form-urlencoded" formatterClass="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>

    </builder>

    <log level="full"/>

    <send/>

</outSequence>

But unfortunately i don’t get any response in SOAPUI :(

After I make other tests adding the next properties in outsequence. But with no effect:

<property name="ContentType" value="text/xml" scope="axis2"/>

<property name="messageType" value="text/xml" scope="axis2"/>

Note: I have used always the axis2.xml default file.

¿ Do you know which property should i use in my proxy configuration for managing this kind of text responses?

Thanks …

 


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Vinod Kavinda
Senior Software Engineer 
Mobile : <a href="tel:%2B94%20%280%29%20712%20415544" value="+94773451194" style="color:rgb(17,85,204)" target="_blank">+94 (0) 712 415544
http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

Vinod Kavinda
In reply to this post by mwso2
Hi,
Yes, It affects the whole ESB but for the requests coming with the defined content type only.

Regards,
Vinod

On Fri, Jan 12, 2018 at 7:30 PM, <[hidden email]> wrote:
If I'm not wrong, the commands you mentioned affect the operation of the entire ESB. And I'm only interested in modifying the operation of a single proxy that receives that type of non-SOAP response. I'm wrong ?

<quote author='Vinod Kavinda'>
HI,
I'm sorry, I'm not clear about your question. Too much info :)

However, if you need to passthrough a non-standard content type, add
following message formatter and builder to your axis2.xml.

<messageFormatter contentType="application/binary" class="
org.wso2.carbon.relay.ExpandingMessageFormatter"/>
<messageBuilder contentType="application/binary" class="
org.wso2.carbon.relay.BinaryRelayBuilder"/>


Here the content type should be whatever content type your backend is
sending. Refer [1] for more info on message Relay.

[1] - https://docs.wso2.com/display/ESB500/Message+Relay

Regards,
Vinod

On Thu, Jan 11, 2018 at 11:47 PM, Marcos Tarín Esteve <
[hidden email]> wrote:

> Hi …
>
> I’m making a soap call to an endpoint service through ESB6.1.1 from SOAPUI
>
> PROXY CONFIGURATION
>
> ((( I bloted out some information with xxxx )))
>
>
>
> <?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/
> ns/synapse" name="xxxxWsV2_Based_Proxy" startOnLoad="true"
> statistics="disable" trace="enable" transports="http,https">
>
>     <target>
>
>         <inSequence>
>
>             <property name="FORCE_HTTP_1.0" scope="axis2" type="STRING"
> value="true"/>
>
>             <property name="DISABLE_CHUNKING" scope="axis2" type="STRING"
> value="true"/>
>
>             <property name="EXPECT-100" scope="axis2" type="STRING"
> value="true"/>
>
>             <log level="full"/>
>
>         </inSequence>
>
>         <outSequence>
>
>             <log level="full"/>
>
>             <send/>
>
>         </outSequence>
>
>         <endpoint>
>
>             <wsdl port="xxxxWsV2Port" service="xxxxxWsV2Service"
> uri="file:/var/www/html/xxxxWsV2.wsdl"/>
>
>         </endpoint>
>
>     </target>
>
>     <description/>
>
> </proxy>
>
> SOAPUI receives a correct response when the endpoint service returns a
> ‘SOAP response’.
>
> But i have other soap call that is returning the next non-soap formatted
> response:
>
> NON-SOAP ENDPOINT RESPONSE
>
> --urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1xxxxx8bxc
>
> Content-Type: text/xml; charset=utf-8
>
> Content-Transfer-Encoding: 8bit
>
> Content-ID: <urn:uuid:3xcxxx4b-x9ea-xxf6-81c3-8a8xxxxe6bx7>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
> envelope/" xmlns:ns1="https://xxxx.es/xxxx/ws/xxxxws_v2/1.0/infoEnvioV2">
>
> <SOAP-ENV:Body>
>
> <resultadoInfoEnvioV2>
>
> <ns1:identificador>xa3x2xxxxx8xx7</ns1:identificador>
>
> </resultadoInfoEnvioV2>
>
> </SOAP-ENV:Body>
>
> </SOAP-ENV:Envelope>
>
>
>
> --urn:uuid:a07xxx6-9xxx9-4xxa1-xx9c-a91dxxbcc
>
> Content-Type: application/octet-stream; charset=utf-8
>
> Content-Transfer-Encoding: binary
>
> Content-ID: <urn:uuid:69xxx17b-x96c-xx3e-9x78-721dxxxxxxa23>
>
> http://xx.x.x.xxx/Texto_de_prueba.txt
>
> --urn:uuid:a07xxx6-9xxx9-4ea1-bxxc-a9xxx0c8bcc—
>
> The problem is that wso2-esb doesn’t return the response to SOAPUI because
> this ESB error:
>
> TID: [-1234] [] [2017-12-21 17:15:38,305] ERROR
> {org.apache.synapse.transport.passthru.util.RelayUtils} -  Error while
> building Passthrough stream {org.apache.synapse.transport.
> passthru.util.RelayUtils}
>
> org.apache.axiom.om.OMException:
> com.ctc.wstx.exc.WstxUnexpectedCharException:
> Unexpected character '-' (code 45) in prolog; expected '<'
>
> I'm only interested in reading last SOAP-ENV response from SOAPUI.
>
> For getting the solution. I would like to TRANSFORM ‘ONLY’ THE PROXY
> RESPONSE to a format that SOAPUI can read.
>
> For solving the problem. I added the property messageBuilder to the
> proxy’s out-sequence configuration:
>
> NEW OUT-SEQUENCE PROXY CONFIGURATION
>
>         <outSequence>
>
>             <builder>
>
>                 <messageBuilder
> class="org.wso2.carbon.relay.BinaryRelayBuilder"
> contentType="text/xml" formatterClass="org.apache.axis2.transport.http.
> SOAPMessageFormatter"/>
>
>             </builder>
>
>             <log level="full"/>
>
>             <send/>
>
>         </outSequence>
>
> Note: When i added the last property messageBuilder. WSO2 editor added
> itself this new properties:
>
> <outSequence>
>
>     <builder>
>
>         <messageBuilder
> class="org.apache.axis2.builder.ApplicationXMLBuilder"
> contentType="application/xml" formatterClass="org.apache.
> axis2.transport.http.ApplicationXMLFormatter"/>
>
>         <messageBuilder class="org.apache.axis2.builder.MIMEBuilder"
> contentType="multipart/related"/>
>
>         <messageBuilder class="org.apache.axis2.builder.SOAPBuilder"
> contentType="application/soap+xml" formatterClass="org.apache.
> axis2.transport.http.SOAPMessageFormatter"/>
>
>         <messageBuilder class="org.apache.axis2.json.JSONBuilder"
> contentType="application/json" formatterClass="org.apache.axis2.json.
> JSONMessageFormatter"/>
>
>         <messageBuilder class="org.apache.axis2.builder.MTOMBuilder"
> contentType="application/xop+xml"/>
>
>         <messageBuilder
> class="org.apache.axis2.builder.XFormURLEncodedBuilder"
> contentType="application/x-www-form-urlencoded"
> formatterClass="org.apache.axis2.transport.http.
> XFormURLEncodedFormatter"/>
>
>     </builder>
>
>     <log level="full"/>
>
>     <send/>
>
> </outSequence>
>
> But unfortunately i don’t get any response in SOAPUI :(
>
> After I make other tests adding the next properties in outsequence. But
> with no effect:
>
> <property name="ContentType" value="text/xml" scope="axis2"/>
>
> <property name="messageType" value="text/xml" scope="axis2"/>
>
> Note: I have used always the axis2.xml default file.
>
> ¿ Do you know which property should i use in my proxy configuration for
> managing this kind of text responses?
>
> Thanks …
>
>
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


--
Vinod Kavinda
Senior Software Engineer
*WSO2 Inc. - lean . enterprise . middleware <http://www.wso2.com>.*
Mobile : <a href="tel:%2B94%20%280%29%20712%20415544" value="+94712415544">+94 (0) 712 415544
Blog : http://soatechflicks.blogspot.com/
[image: http://wso2.com/signature]
<http://wso2.com/signature>

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev

</quote>
Quoted from:
http://wso2-oxygen-tank.10903.n7.nabble.com/WSO2-Oxygen-Tank-Manage-endpoint-text-responses-from-proxy-Unexpected-character-some-character-code--tp154376p154387.html


_____________________________________
Sent from http://wso2-oxygen-tank.10903.n7.nabble.com




--
Vinod Kavinda
Senior Software Engineer 
Mobile : <a href="tel:%2B94%20%280%29%20712%20415544" value="+94773451194" style="color:rgb(17,85,204)" target="_blank">+94 (0) 712 415544
http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

mwso2
I got a compilation error (pop up) setting your wso2 commands. Can you check
class path, please?

<messageFormatter contentType="application/binary"
class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
<messageBuilder contentType="application/binary"
class="org.wso2.carbon.relay.BinaryRelayBuilder"/>



--
Sent from: http://wso2-oxygen-tank.10903.n7.nabble.com/WSO2-Development-f3.html
_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

Vinod Kavinda
Please refer the Message relay documentation I shared and add the configurations to correct place and correct class names. These are the classes AFAIK.

Thanks,
Vinod

On Fri, Jan 12, 2018 at 8:39 PM, mwso2 <[hidden email]> wrote:
I got a compilation error (pop up) setting your wso2 commands. Can you check
class path, please?

<messageFormatter contentType="application/binary"
class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
<messageBuilder contentType="application/binary"
class="org.wso2.carbon.relay.BinaryRelayBuilder"/>



--
Sent from: http://wso2-oxygen-tank.10903.n7.nabble.com/WSO2-Development-f3.html
_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev



--
Vinod Kavinda
Senior Software Engineer 
Mobile : <a href="tel:%2B94%20%280%29%20712%20415544" value="+94773451194" style="color:rgb(17,85,204)" target="_blank">+94 (0) 712 415544
http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

mwso2
This post was updated on .
I don't have compilation errors. But just stuked, because  none of the configurations has any effect.

Please take in consideration that i receive at the end of the response message this ==>

Content-Type: application/octet-stream; charset=utf-8
Content-Transfer-Encoding: binary

I repeated using,  configuration like <property name="messageType" socpe="axis2"
value="application/binary"/> and other value configurations ... No  effect







--
Sent from: http://wso2-oxygen-tank.10903.n7.nabble.com/WSO2-Development-f3.html
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

Nadeeshaan Gunasinghe
Hi Marco,

Can you share the current configuration, to get a closer look at?

Cheers,

Nadeeshaan Gunasinghe
Senior Software Engineer, WSO2 Inc. http://wso2.com
<a href="tel:+94770596754" style="color:#8d8d8d;text-decoration:none">+94770596754 | [hidden email] | Skype: nadeeshaan.gunasinghe

On Fri, Jan 12, 2018 at 10:36 PM, mwso2 <[hidden email]> wrote:
just stuked .... No solution effects

Please take in consideration that i receive at the end of the response
message this ==>

Content-Type: application/octet-stream; charset=utf-8
Content-Transfer-Encoding: binary

I repeated using, other time,<property name="messageType" socpe="axis2"
value="application/binary"/> and other value configurations ... No effect


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

mwso2
This post was updated on .
Hello Nadeeshaan

I have this simple proxy:

<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse"<http://ws.apache.org/ns/synapse%22> name="xxxxWs_Based_Proxy" startOnLoad="true" statistics="disable" trace="enable" transports="http,https">
    <target>
        <inSequence>
            <property name="FORCE_HTTP_1.0" scope="axis2" type="STRING" value="true"/>
            <property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>
            <property name="EXPECT-100" scope="axis2" type="STRING" value="true"/>
            <log level="full"/>
        </inSequence>
        <outSequence>
            <log level="full"/>
            <send/>
        </outSequence>
        <endpoint>
            <wsdl port="xxxxWsPort" service="xxxxxWsService" uri="file:/var/www/html/xxxxWs.wsdl"/>
        </endpoint>
    </target>
    <description/>
</proxy>

The proxy receives this response from endpoint:

--urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1xxxxx8bxc
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: <urn:uuid:3xcxxx4b-x9ea-xxf6-81c3-8a8xxxxe6bx7>

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"<http://schemas.xmlsoap.org/soap/envelope/%22> xmlns:ns1="https://xxxx.es/xxxx/ws/xxxxws_/1.0/infoEnvio"><https://xxxx.es/xxxx/ws/xxxxws_/1.0/infoEnvio%22%3E>
<SOAP-ENV:Body>
<resultadoInfoEnvio>
<ns1:identificador>xa3x2xxxxx8xx7</ns1:identificador>
</resultadoInfoEnvio>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

--urn:uuid:a07xxx6-9xxx9-4xxa1-xx9c-a91dxxbcc
Content-Type: application/octet-stream; charset=utf-8
Content-Transfer-Encoding: binary
Content-ID: <urn:uuid:69xxx17b-x96c-xx3e-9x78-721dxxxxxxa23>
http://xx.x.x.xxx/Texto_de_prueba.txt
--urn:uuid:a07xxx6-9xxx9-4ea1-bxxc-a9xxx0c8bcc-

You can see that this response that comes with a coded file:

Content-Type: application/octet-stream; charset=utf-8
Content-Transfer-Encoding: binary

The problem is proxy doesn’t return any response to SOAPUI. Also ESB log shows this error:

TID: [-1234] [] [2017-12-21 17:15:38,305] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} -  Error while building Passthrough stream {org.apache.synapse.transport.passthru.util.RelayUtils}
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'

I just want to know which wso2 command/s should I add to the proxy configuration for bypassing this response so that it can be read by SOAPUI

Thanks

Marcos


_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

Nadeeshaan Gunasinghe
Hi Marco,

According to the description, this what I understood. If the provided response is a single response, then it is a multipart response as I understood correctly. If that's the case you need to enable BinaryRelayBuilder and the ExpandingMessageFormatter for that particular multipart content type. Please correct me If I'm wrong. And in order to get an idea about the full response payload can you enable wirelogs and share the log information? You can enable wirelogs by uncommenting the following entry in <CARBON_HOME>/repository/conf/log4j.properties

log4j.logger.org.apache.synapse.transport.http.headers=DEBUG
log4j.logger.org.apache.synapse.transport.http.wire=DEBUG

Cheers,
Nadeeshaan Gunasinghe
Senior Software Engineer, WSO2 Inc. http://wso2.com
<a href="tel:+94770596754" style="color:rgb(141,141,141);text-decoration:none">+94770596754 | [hidden email] | Skype: nadeeshaan.gunasinghe

On Mon, Jan 15, 2018 at 8:08 PM, Marcos Tarín Esteve <[hidden email]> wrote:

Hello Nadeeshaan

 

I have this simple proxy:


<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="
http://ws.apache.org/ns/synapse" name="xxxxWsV2_Based_Proxy" startOnLoad="true" statistics="disable" trace="enable" transports="http,https">
    <target>
        <inSequence>
            <property name="FORCE_HTTP_1.0" scope="axis2" type="STRING" value="true"/>
            <property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>
            <property name="EXPECT-100" scope="axis2" type="STRING" value="true"/>
            <log level="full"/>
        </inSequence>
        <outSequence>
            <log level="full"/>
            <send/>
        </outSequence>
        <endpoint>
            <wsdl port="xxxxWsV2Port" service="xxxxxWsV2Service" uri="file:/var/www/html/xxxxWsV2.wsdl"/>
        </endpoint>
    </target>
    <description/>
</proxy>

The proxy receives this response from endpoint:


--urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1xxxxx8bxc 
Content-Type: text/xml; charset=utf-8 
Content-Transfer-Encoding: 8bit 
Content-ID: <urn:uuid:3xcxxx4b-x9ea-xxf6-81c3-8a8xxxxe6bx7>

<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://xxxx.es/xxxx/ws/xxxxws_v2/1.0/infoEnvioV2">
<SOAP-ENV:Body>
<resultadoInfoEnvioV2>
<ns1:identificador>xa3x2xxxxx8xx7</ns1:identificador>
</resultadoInfoEnvioV2>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

--urn:uuid:a07xxx6-9xxx9-4xxa1-xx9c-a91dxxbcc 
Content-Type: application/octet-stream; charset=utf-8 
Content-Transfer-Encoding: binary 
Content-ID: <urn:uuid:69xxx17b-x96c-xx3e-9x78-721dxxxxxxa23>
http://xx.x.x.xxx/Texto_de_prueba.txt
--urn:uuid:a07xxx6-9xxx9-4ea1-bxxc-a9xxx0c8bcc- 

 

You can see that this response that comes with a coded file:

 

Content-Type: application/octet-stream; charset=utf-8 
Content-Transfer-Encoding: binary 

 

The problem is proxy doesn’t return any response to SOAPUI. Also ESB log shows this error:


TID: [-1234] [] [2017-12-21 17:15:38,305] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} -  Error while building Passthrough stream {org.apache.synapse.transport.passthru.util.RelayUtils} 
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<' 

 

I just want to know which wso2 command/s should I add to the proxy configuration for bypassing this response so that it can be read by SOAPUI

 

Thanks

 

Marcos

 



_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

mwso2
This post was updated on .
Hi Nadeeshaan

Very grateful for your help

The error I reported was obtained from the log file. It is the only one found.

TID: [-1234] [] [2017-12-21 17:15:38,305] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} -  Error while building Passthrough stream {org.apache.synapse.transport.passthru.util.RelayUtils}
org.apache.axiom.om<http://org.apache.axiom.om>.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'

I only show a single line belonging to the log for privacy issues.

It is clear that the problem is because WSO-ESB receives a response from the endpoint in which its first character is a symbol symbol '-' and that¡s why ESB gives error.

FULL RECEIVED RESPONSE

--urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1xxxxx8bxc
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: <urn:uuid:3xcxxx4b-x9ea-xxf6-81c3-8a8xxxxe6bx7>

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"<http://schemas.xmlsoap.org/soap/envelope/%22> xmlns:ns1="https://xxxx.es/xxxx/ws/xxxxws_/1.0/infoEnvio"><https://xxxx.es/xxxx/ws/xxxxws_/1.0/infoEnvio%22%3E>
<SOAP-ENV:Body>
<resultadoInfoEnvio>
<ns1:identificador>xa3x2xxxxx8xx7</ns1:identificador>
</resultadoInfoEnvio>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

--urn:uuid:a07xxx6-9xxx9-4xxa1-xx9c-a91dxxbcc
Content-Type: application/octet-stream; charset=utf-8
Content-Transfer-Encoding: binary
Content-ID: <urn:uuid:69xxx17b-x96c-xx3e-9x78-721dxxxxxxa23>
http://xx.x.x.xxx/Texto_de_prueba.txt
--urn:uuid:a07xxx6-9xxx9-4ea1-bxxc-a9xxx0c8bcc-

END OF FULL RECEIVED RESPONSE

I also tried configurations with "BinaryRelayBuilder and the ExpandingMessageFormatter" included within the proxy. But they had no effect.

"the provided response is a single response, then it is a multipart response as I understood correctly." ==> Sorry I did not understand your assertion. I try to explain better. The answer coming from the endpoint is simple, with the particularity that besides SOAP labels, it adds extra information related a file. It seems is the file, or access information to it, which seems to be encoded in octet format within the response.

if I could erase all the information in the answer except the SOAP information. Staying only:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"<http://schemas.xmlsoap.org/soap/envelope/%22> xmlns:ns1="https://xxxx.es/xxxx/ws/xxxxws_/1.0/infoEnvio"><https://xxxx.es/xxxx/ws/xxxxws_/1.0/infoEnvio%22%3E>
<SOAP-ENV:Body>
<resultadoInfoEnvio>
<ns1:identificador>xa3x2xxxxx8xx7</ns1:identificador>
</resultadoInfoEnvio>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I am sure that I will get WSO2-ESB working correctly.

We’ll be in contact … Thanks

Marcos


_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

Nadeeshaan Gunasinghe
Hi Marcos,

This is what I see, you get the content type as text/xml and when you try to build this particular payload it is invalid xml content. If you take a look at the wirelogs, you will be able to find that the content type is set to text/xml before the below payload.

--urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1xxxxx8bxc 
Content-Type: text/xml; charset=utf-8 
Content-Transfer-Encoding: 8bit 
Content-ID: <urn:uuid:3xcxxx4b-x9ea-xxf6-81c3-8a8xxxxe6bx7>

<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://xxxx.es/xxxx/ws/xxxxws_v2/1.0/infoEnvioV2">
<SOAP-ENV:Body>
.......
.......

As I think, if you are trying to extract the soap envelope specifically from this payload, you will need to write a custom message formatter/builder.

Thanks,
Nadeeshaan Gunasinghe
Senior Software Engineer, WSO2 Inc. http://wso2.com
<a href="tel:+94770596754" style="color:rgb(141,141,141);text-decoration:none">+94770596754 | [hidden email] | Skype: nadeeshaan.gunasinghe

On Tue, Jan 16, 2018 at 3:18 PM, Marcos Tarín Esteve <[hidden email]> wrote:

Hi Nadeeshaan

 

Very grateful for your help

 

The error I reported was obtained from the log file. It is the only one found.

 

TID: [-1234] [] [2017-12-21 17:15:38,305] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} -  Error while building Passthrough stream {org.apache.synapse.transport.passthru.util.RelayUtils} 
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<' 


I only show a single line belonging to the log for privacy issues.

It is clear that the problem is that WSO-ESB receives a response from the endpoint in which its first character is a symbol symbol '-' and that is why ESB gives error.


--urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1xxxxx8bxc 
Content-Type: text/xml; charset=utf-8 
Content-Transfer-Encoding: 8bit 
Content-ID: <urn:uuid:3xcxxx4b-x9ea-xxf6-81c3-8a8xxxxe6bx7>

<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://xxxx.es/xxxx/ws/xxxxws_v2/1.0/infoEnvioV2">
<SOAP-ENV:Body>
<resultadoInfoEnvioV2>
<ns1:identificador>xa3x2xxxxx8xx7</ns1:identificador>
</resultadoInfoEnvioV2>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

--urn:uuid:a07xxx6-9xxx9-4xxa1-xx9c-a91dxxbcc 
Content-Type: application/octet-stream; charset=utf-8 
Content-Transfer-Encoding: binary 
Content-ID: <urn:uuid:69xxx17b-x96c-xx3e-9x78-721dxxxxxxa23>
http://xx.x.x.xxx/Texto_de_prueba.txt
--urn:uuid:a07xxx6-9xxx9-4ea1-bxxc-a9xxx0c8bcc- 


I also tried configurations with "BinaryRelayBuilder and the ExpandingMessageFormatter" included within the proxy. But they had no effect.

"the provided response is a single response, then it is a multipart response as I understood correctly." ==> Sorry I did not understand your sentence. I try to explain better. The answer coming from the endpoint is simple, with the particularity that besides SOAP labels, it adds extra information related a file. It seems is the file, or access information to it, which seems to be encoded in octet format within the response.

 

if I could erase all the information in the answer except the SOAP information:

 

<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://xxxx.es/xxxx/ws/xxxxws_v2/1.0/infoEnvioV2">
<SOAP-ENV:Body>
<resultadoInfoEnvioV2>
<ns1:identificador>xa3x2xxxxx8xx7</ns1:identificador>
</resultadoInfoEnvioV2>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

I am sure that I found that WSO2-ESB would work.

 

We’ll be in contact … Thanks

 

Marcos

 



_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

mwso2
This post was updated on .
Hi Nadeeshaan

Regarding the need to create a custom message formatter / builder. I do not have enough knowledge to implement it. And I would like to make a solution as simple as possible.
As a solution I propose the following (if you could help me).


Just take the complete response received from the endpoint and wrap it within a new SOAP structure that contains all the received response (regardless of the transport format used: txt, binary ..


IDEA >>
CREATE NEW SOAP STRUCTURE
-- Embedded Full endpoint response --
END NEW SOAP STRUCTURE


It would be enough solution for me. Since in this way the client, at least, could receive the information. Client who subsequently has the ability to decompose / process it.

Would it be possible?

Thanks
Marcos


_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

mwso2
In reply to this post by Nadeeshaan Gunasinghe

For facilitating a simple solution. I suggest only to send to client the SOAP part of response:

 

<? xml version = "1.0" encoding = "UTF-8"?>

<SOAP-ENV: Envelope xmlns: SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: ns1 = "https://xxxx.es/xxxx/ws/xxxxws_/1.0/infoEnvi">

<SOAP-ENV: Body>

<resultInfoEnv>

<ns1: identifier> xa3x2xxxxx8xx7 </ ns1: identifier>

</ resultInfoSend>

</ SOAP-ENV: Body>

</ SOAP-ENV: Envelope>

 

And remove file’s information:

 

--urn: uuid: ax7xx36-98xx9-4ex1-bxxc-ax1xxxxx8bxc

Content-Type: text / xml; charset = utf-8

Content-Transfer-Encoding: 8bit

Content-ID: <urn: uuid: 3xcxxx4b-x9ea-xxf6-81c3-8a8xxxxe6bx7>

 

--urn: uuid: a07xxx6-9xxx9-4xxa1-xx9c-a91dxxbcc

Content-Type: application / octet-stream; charset = utf-8

Content-Transfer-Encoding: binary

Content-ID: <urn: uuid: 69xxx17b-x96c-xx3e-9x78-721dxxxxxxa23>

http://xx.x.x.xxx/Texto_de_prueba.txt

--urn: uuid: a07xxx6-9xxx9-4ea1-bxxc-a9xxx0c8bcc-

 

 

Would it be possible?

 

thanks


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

mwso2
In reply to this post by Nadeeshaan Gunasinghe

Apologies for the insistence ...

 

Would this solution be enough?

 

<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="%%%%%%_Based_Proxy" startOnLoad="true" statistics="disable" trace="enable" transports="http,https">

    <target>

        <inSequence>

            <property name="FORCE_HTTP_1.0" scope="axis2" type="STRING" value="true"/>

            <property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>

            <log level="full"/>

        </inSequence>

        <outSequence>

            <log level="full"/>

            <enrich>

                <source clone="false" type="body"/>

                <target property="ORIGINAL_BODY" type="property"/>

            </enrich>

            <payloadFactory media-type="xml">

                <format>

                    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

                        <soapenv:Body/>

                    </soapenv:Envelope>

                </format>

                <args/>

            </payloadFactory>

            <enrich>

                <source clone="false" property="ORIGINAL_BODY" type="property"/>

                <target type="body"/>

            </enrich>

            <property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="false"/>

            <property name="messageType" scope="transport" value="text/xml"/>

            <send/>

        </outSequence>

        <endpoint>

            <wsdl port="%%%%%%Port" service="%%%%%%Service" uri="file:/var/www/html/%%%%%%.wsdl"/>

        </endpoint>

    </target>

    <description/>

</proxy>

 

Well, it still doesn’t work

 

thanls


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

mwso2
Hello

Finally I found this solution that applies to the general operation ESB

You have to add in axis2.xml file at least

<messageBuilder contentType = "multipart/form-data" class =
"org.wso2.carbon.relay.BinaryRelayBuilder" />

<messageBuilder contentType = "multipart/related" class =
"org.wso2.carbon.relay.BinaryRelayBuilder" />

With more time I will perform more checks.. no time

Marcos




--
Sent from: http://wso2-oxygen-tank.10903.n7.nabble.com/WSO2-Development-f3.html
_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev