use of com.oracle.webservices.api.message.MessageContext in project metro-jax-ws by eclipse-ee4j.
the class DatabindingTest method testMessageContextFactory.
public void testMessageContextFactory() throws Exception {
DatabindingFactory fac = DatabindingFactory.newInstance();
Databinding.Builder builder = fac.createBuilder(Hello2.class, null);
builder.targetNamespace("mytns");
builder.serviceName(new QName("mytns", "myservice"));
MessageContextFactory mcf = MessageContextFactory.createFactory();
MySaajFac saajFac = new MySaajFac();
mcf.setSAAJFactory(saajFac);
builder.property("com.sun.xml.ws.api.message.MessageContextFactory", mcf);
com.oracle.webservices.api.databinding.Databinding db = builder.build();
assertTrue(((com.sun.xml.ws.api.databinding.Databinding) db).getMessageContextFactory() == mcf);
Class[] paramType = { String.class };
Object[] params = { "echoResponse" };
com.oracle.webservices.api.databinding.JavaCallInfo call = db.createJavaCallInfo(Hello2.class.getMethod("echo", paramType), params);
call.setReturnValue("echoResponse");
MessageContext mc = db.serializeResponse(call);
SOAPMessage soap = mc.getAsSOAPMessage();
assertTrue(saajFac.called);
}
Aggregations