Need Help with the JSR component of servicemix

View: New views
1 Messages — Rating Filter:   Alert me  

Need Help with the JSR component of servicemix

by Akshatha Shetty :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

I am trying to access the remote methods of EJB (in Websphere) from Servicemix BC.
I have been able to access methods which accept string as inputs and give string as output.
How can Invoke methods which take User defined objects as Input and return user-defined objects as output?

Below is my code

        String namespaceURI = "http://com.nsn.obs.mw.mediation/ne3soap/1.0";
        ClientFactory factory = getServiceMixClientFactory();
        ServiceMixClient client = factory.createClient();
        InOut exchange = client.createInOutExchange();
        exchange.setService(new QName(namespaceURI, endpoint));
        exchange.getInMessage().setContent(new StringSource(sendString));
        client.sendSync(exchange);
        LOGGER.log(Level.WARNING, " STATUS==========" + exchange.getStatus());
        NormalizedMessage outResponse = exchange.getOutMessage();
        if (null == outResponse) {
            LOGGER.log(Level.WARNING,
                    "OEIGEP003 : The out response after fetching is null.");
            throw new Exception("Output object is null");
        } else {
            StringSource out = (StringSource) outResponse.getContent();
            LOGGER.log(Level.WARNING, "OUT MESSAGE ISSSSSSSSSSS" + out);
            exchange.setStatus(ExchangeStatus.DONE);
            return out;
        }

Regards,
Akshatha