REST-BC BPEL MAPPING FROM XML SCHEMA

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

REST-BC BPEL MAPPING FROM XML SCHEMA

jorgecatomar
This post has NOT been accepted by the mailing list yet.
Hi,

I have a problem with REST, I'm ussing OpenESB 2.3.1.  I created a new WSDL concrete REST - Inbound, added a new operation with a defined XML Schema for the messages. When invoke the service with my own java client with Content-Type = "application/xml"  everything works fine, I can mapp the message correctly in my BPEL. But whe I try to use JSON with Content-Type = "application/json"  the mapper doesnt work, all values are nulls. I tried to set the correct namespace in my request JSON String, but doesnt work. Can you help me to find what I'm doing wrong?

My Schema is:

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

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://xml.netbeans.org/schema/op1Schema"
    xmlns:tns="http://xml.netbeans.org/schema/op1Schema"
    elementFormDefault="qualified">
    <xsd:element name="request">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="idUsuario" type="xsd:int"></xsd:element>
                <xsd:element name="edad" type="xsd:int"></xsd:element>
                <xsd:element name="sexo" type="xsd:string"></xsd:element>
                <xsd:element name="nombre" type="xsd:string"></xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="response">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="error" type="xsd:boolean"></xsd:element>
                <xsd:element name="mensaje" type="xsd:string"></xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

XML String that works:

String input = "<request xmlns=\"http://xml.netbeans.org/schema/op1Schema\"><idUsuario>100</idUsuario><edad>29</edad><sexo>masculino</sexo><nombre>Omar</nombre></request>";

JSON String that doesnt works:

String input = "{\"request\":{\"idUsuario\":100,\"edad\":29,\"nombre\":\"Omar\",\"sexo\":\"masculino\"}}";

JSON String that doesnt works with NS:

String input = "{\"request\":{\"idUsuario\":100,\"edad\":29,\"nombre\":\"Omar\",\"sexo\":\"masculino\",\"xmlns\"=\"http://xml.netbeans.org/schema/op1Schema\"}}";

In advance thanks for your help.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: REST-BC BPEL MAPPING FROM XML SCHEMA

David BRASSELY
Administrator
This post has NOT been accepted by the mailing list yet.
Hi Jorge,

Can you provide a test project for this ?
It will be easier for me to have a look to what is going wrong or what has been done wrongly.

Regards,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: REST-BC BPEL MAPPING FROM XML SCHEMA

jorgecatomar
This post has NOT been accepted by the mailing list yet.
Hi David,

In the next link you can download my proyects (BPEL, Composite and client Rest).

https://www.dropbox.com/s/m7ef9w68xkqr2b1/REST.zip?dl=0

Thanks for your support.

Greetings.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: REST-BC BPEL MAPPING FROM XML SCHEMA

jorgecatomar
This post has NOT been accepted by the mailing list yet.
Hi David,

You could review the information I shared you?, or you require a different way?

Thanks in advance.

Regards.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: REST-BC BPEL MAPPING FROM XML SCHEMA

David BRASSELY
Administrator
This post has NOT been accepted by the mailing list yet.
Hi Jorge,

By using this request :
{"request":{"idUsuario":100,"edad":29,"nombre":"Omar","sexo":"masculino"}}

I'm getting this response:
{
    "response": {
        "error": false,
        "mensaje": "Nombre:",
        "xmlns": "http://xml.netbeans.org/schema/op1Schema"
    }
}

Is this correct ? What should be the issue ?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: REST-BC BPEL MAPPING FROM XML SCHEMA

jorgecatomar
This post has NOT been accepted by the mailing list yet.
The issue is that the mapping doesnt work correctly, I am waiting that field "nombre" appers in the response:

{
    "response": {
        "error": false,
        "mensaje": "Nombre: Omar",
        "xmlns": "http://xml.netbeans.org/schema/op1Schema"
    }
}

When try the service with XML content the mapping works fine, but with json does not, all variables at the Bpel are empty.

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: REST-BC BPEL MAPPING FROM XML SCHEMA

David BRASSELY
Administrator
This post has NOT been accepted by the mailing list yet.
Oh ok I see !

Will have a look asap !

Regards,
Loading...