Hi,

Please find the below queries which are currently en-counted.

1. Java Connector - parsing JSON as XML
We found the following method in the Twitter connector to parse JSON as XML:
private static OMElement parseJsonToXml(String sb) throws JSONException,
XMLStreamException,
                                              IOException {
        OMElement elm = JsonBuilder.toXml(new
ByteArrayInputStream(sb.getBytes()), false);
        return elm;
    }

The JsonBuilder.toXml method seems to be deprecated. Is there an alternative
for this?

2. To handle exceptions thrown within a Class mediator, we are using the
following method as specified in Google Spreadsheets and Twitter ESB
connectors:
public static void storeErrorResponseStatus(MessageContext ctxt, Exception
e) {
        ctxt.setProperty(SynapseConstants.ERROR_EXCEPTION, e);
        ctxt.setProperty(SynapseConstants.ERROR_MESSAGE, e.getMessage());
    }

Is this type of error handling sufficient? Or do we need to have a fault
sequence within each synapse template?


Thanks & Regards




--
View this message in context: 
http://wso2-oxygen-tank.10903.n7.nabble.com/Parsing-JSON-as-XML-and-handling-exceptions-tp91557.html
Sent from the WSO2 Development mailing list archive at Nabble.com.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to