use of com.sun.xml.ws.api.pipe.TubelineAssembler in project metro-jax-ws by eclipse-ee4j.
the class Stub method createPipeline.
/**
* Creates a new pipeline for the given port name.
*/
private Tube createPipeline(WSPortInfo portInfo, WSBinding binding) {
// Check all required WSDL extensions are understood
checkAllWSDLExtensionsUnderstood(portInfo, binding);
SEIModel seiModel = null;
Class sei = null;
if (portInfo instanceof SEIPortInfo) {
SEIPortInfo sp = (SEIPortInfo) portInfo;
seiModel = sp.model;
sei = sp.sei;
}
BindingID bindingId = portInfo.getBindingId();
TubelineAssembler assembler = TubelineAssemblerFactory.create(Thread.currentThread().getContextClassLoader(), bindingId, owner.getContainer());
if (assembler == null) {
// TODO: i18n
throw new WebServiceException("Unable to process bindingID=" + bindingId);
}
return assembler.createClient(new ClientTubeAssemblerContext(portInfo.getEndpointAddress(), portInfo.getPort(), this, binding, owner.getContainer(), ((BindingImpl) binding).createCodec(), seiModel, sei));
}
use of com.sun.xml.ws.api.pipe.TubelineAssembler in project metro-jax-ws by eclipse-ee4j.
the class ClientProxyTest method testNullResponseFromTube.
@SuppressWarnings("unchecked")
public void testNullResponseFromTube() throws Exception {
URL wsdlURL = Thread.currentThread().getContextClassLoader().getResource("etc/EchoService.wsdl");
EchoService srv = new EchoService(wsdlURL, new ComponentFeature(new com.sun.xml.ws.api.Component() {
public <S> S getSPI(Class<S> spiType) {
if (TransportTubeFactory.class.equals(spiType))
return (S) new TransportTubeFactory() {
public Tube doCreate(ClientTubeAssemblerContext context) {
return new EchoTube();
}
};
if (TubelineAssemblerFactory.class.equals(spiType))
return (S) new TubelineAssemblerFactory() {
public TubelineAssembler doCreate(BindingID bindingId) {
return new TubelineAssembler() {
public Tube createClient(ClientTubeAssemblerContext context) {
final Tube head = context.createTransportTube();
return new EchoTube() {
public NextAction processRequest(Packet request) {
NextAction na = new NextAction();
na.invoke(head, request);
return na;
}
public NextAction processResponse(Packet response) {
NextAction na = new NextAction();
na.returnWith(new Packet());
return na;
}
};
}
public Tube createServer(ServerTubeAssemblerContext context) {
return null;
}
};
}
};
return null;
}
}));
Echo echo = srv.getEchoPort();
try {
int res = echo.add(new NumbersRequest());
fail();
} catch (Exception e) {
assertFalse(e instanceof NullPointerException);
assertTrue(e instanceof WebServiceException);
}
try {
echo.echoString(new Holder(wsdlURL.toString()));
fail();
} catch (Exception e) {
assertFalse(e instanceof NullPointerException);
assertTrue(e instanceof WebServiceException);
}
}
Aggregations