RESTBC - unexpected XML header when using text/plain

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

RESTBC - unexpected XML header when using text/plain

OpenESB Community Forum mailing list
I can't help wondering what I am missing!

The following happens with SE 3.05 binary and a build of the latest sources
- I have pared the example to down to the bare minimum

Scenario:
Define a REST GET service from a concrete WSDL that has both consume and
produce types set to text/plain. The BPEL is simply a receive, an assign and
a reply

In the BPEL assign step, assign a string literal (let us say 'fred') to
part1 of the REST response.

Create the composite application from the above.

Results:
My expectation would be, therefore, that invoking the service (with
Content-type and Accept of text/plain would provide the output of

fred

What I actually get is

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

Is there a trick to get the RESTBC to provide the output that I expect?



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: RESTBC - unexpected XML header when using text/plain

OpenESB Community Forum mailing list
In case they are of any use, some more details - I'd love to know what I am
doing wrong (or failing to do right :-) ).

The BPEL design - as simple as simple can be:-
 
<http://openesb-community-forum.794670.n2.nabble.com/file/t395940/SimpleCA.png>


The mapping;-
<http://openesb-community-forum.794670.n2.nabble.com/file/t395940/mapper.png>

The result:-
<http://openesb-community-forum.794670.n2.nabble.com/file/t395940/result.png>

And finally, the WSDL used:-

<definitions name="newWSDL"
    targetNamespace="http://j2ee.netbeans.org/wsdl/RESTtest/src/newWSDL"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:rest="http://schemas.sun.com/jbi/wsdl-extensions/rest/"
    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
xmlns:tns="http://j2ee.netbeans.org/wsdl/RESTtest/src/newWSDL">
    <types>
        <xsd:schema
targetNamespace="http://j2ee.netbeans.org/wsdl/RESTtest/src/newWSDL"/>
    </types>
    <message name="TestRequest">
        <part name="part1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
type="xsd:anyType"/>
    </message>
    <message name="TestResponse">
        <part name="part1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
type="xsd:anyType"/>
    </message>
    <portType name="RestInboundPortType">
        <operation name="Test">
            <input name="TestInput"
xmlns:tns="http://j2ee.netbeans.org/wsdl/RESTtest/src/newWSDL"
message="tns:TestRequest"/>
            <output name="TestOutput"
xmlns:tns="http://j2ee.netbeans.org/wsdl/RESTtest/src/newWSDL"
message="tns:TestResponse"/>
        </operation>
    </portType>
    <binding name="RestInboundBinding" type="tns:RestInboundPortType">
        <rest:binding/>
        <operation name="Test">
            <rest:operation>
&lt;![CDATA[
# optional, name of HTTP listener to bind to, defaults to "default-listener"
http-listener-name=default-listener

# required, path to this resource
path=/test/path

# optional, HTTP verb to access the resource, defaults to GET
method=GET

# optional, acceptable MIME types for request payload, defaults to
"application/json", "application/xml"
consume-types=[ "text/plain" ]

# optional, all possible MIME types of response payload, defaults to
"application/json", "application/xml"
produce-types=[ "text/plain" ]

forward-as-attachment=false

]]&gt;</rest:operation>
            <input name="TestInput"/>
            <output name="TestOutput"/>
        </operation>
    </binding>
    <service name="RestInboundService">
        <port name="RestInboundWSDL_InboundPort"
binding="tns:RestInboundBinding">
            <rest:address/>
        </port>
    </service>
    <plnk:partnerLinkType name="RestInboundWSDL">
       
        <plnk:role name="RestInboundPortTypeRole"
portType="tns:RestInboundPortType"/>
    </plnk:partnerLinkType>
</definitions>






--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: RESTBC - unexpected XML header when using text/plain

Paul Perez
Administrator
Hello Dave,

We Are working on your Topic.
First could you tell me why you want to use the text/plain media-type.
OpenESB requires structured messages such as JSON and XLM.
AFAIK and contrary to the documentation, the text/plain is not supported.
Further to your email, we are working on fixing the issue with the request
body in JSON.

Please let me know

Best regards

Paul Perez Chief Architect
Pymma Consulting
--------------------------
Tel: +44 79 44 36 04 65
Skype ID : polperez

-----Original Message-----
From: User <[hidden email]> On Behalf Of Dave Woodman via
User
Sent: 12 July 2018 15:06
To: [hidden email]
Cc: Dave Woodman <[hidden email]>
Subject: Re: [User] RESTBC - unexpected XML header when using text/plain

In case they are of any use, some more details - I'd love to know what I am
doing wrong (or failing to do right :-) ).

The BPEL design - as simple as simple can be:-
 
<http://openesb-community-forum.794670.n2.nabble.com/file/t395940/SimpleCA.p
ng>


The mapping;-
<http://openesb-community-forum.794670.n2.nabble.com/file/t395940/mapper.png
>

The result:-
<http://openesb-community-forum.794670.n2.nabble.com/file/t395940/result.png
>

And finally, the WSDL used:-

<definitions name="newWSDL"
    targetNamespace="http://j2ee.netbeans.org/wsdl/RESTtest/src/newWSDL"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:rest="http://schemas.sun.com/jbi/wsdl-extensions/rest/"
    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
xmlns:tns="http://j2ee.netbeans.org/wsdl/RESTtest/src/newWSDL">
    <types>
        <xsd:schema
targetNamespace="http://j2ee.netbeans.org/wsdl/RESTtest/src/newWSDL"/>
    </types>
    <message name="TestRequest">
        <part name="part1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
type="xsd:anyType"/>
    </message>
    <message name="TestResponse">
        <part name="part1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
type="xsd:anyType"/>
    </message>
    <portType name="RestInboundPortType">
        <operation name="Test">
            <input name="TestInput"
xmlns:tns="http://j2ee.netbeans.org/wsdl/RESTtest/src/newWSDL"
message="tns:TestRequest"/>
            <output name="TestOutput"
xmlns:tns="http://j2ee.netbeans.org/wsdl/RESTtest/src/newWSDL"
message="tns:TestResponse"/>
        </operation>
    </portType>
    <binding name="RestInboundBinding" type="tns:RestInboundPortType">
        <rest:binding/>
        <operation name="Test">
            <rest:operation>
&lt;![CDATA[
# optional, name of HTTP listener to bind to, defaults to "default-listener"
http-listener-name=default-listener

# required, path to this resource
path=/test/path

# optional, HTTP verb to access the resource, defaults to GET method=GET

# optional, acceptable MIME types for request payload, defaults to
"application/json", "application/xml"
consume-types=[ "text/plain" ]

# optional, all possible MIME types of response payload, defaults to
"application/json", "application/xml"
produce-types=[ "text/plain" ]

forward-as-attachment=false

]]&gt;</rest:operation>
            <input name="TestInput"/>
            <output name="TestOutput"/>
        </operation>
    </binding>
    <service name="RestInboundService">
        <port name="RestInboundWSDL_InboundPort"
binding="tns:RestInboundBinding">
            <rest:address/>
        </port>
    </service>
    <plnk:partnerLinkType name="RestInboundWSDL">
       
        <plnk:role name="RestInboundPortTypeRole"
portType="tns:RestInboundPortType"/>
    </plnk:partnerLinkType>
</definitions>






--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/

www.pymma.com The best services on OpenESB
Reply | Threaded
Open this post in threaded view
|

Re: RESTBC - unexpected XML header when using text/plain

OpenESB Community Forum mailing list
Hi Paul,

Thanks for the response!

This is for a service that would be effectively a lookup for a REST get on a
parameterised path

i.e

/get/me/info/about/{ID}

The consuming process expects plain text. I just reduced this to the minimum
required to illustrate the problem.

It appears that this used to be supported, as evidenced by the Logicoy
example (old) at
http://www.logicoy.com/wikilogicoy/Wiki.jsp@page=SimpleRestfulServiceAccessingDERBYCustomerDatabase.html

Thanks,

       Dave.





--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/