use of com.sun.xml.ws.client.WSServiceDelegate in project metro-jax-ws by eclipse-ee4j.
the class TubelineAssemblerFactoryImplTest method getClientContext.
private ClientTubeAssemblerContext getClientContext(final BindingID bindingId, final Container container) {
final WSBinding binding = bindingId.createBinding();
final EndpointAddress address = new EndpointAddress(ADDRESS_URL);
final WSDLPort port = null;
final QName serviceName = new QName(NAMESPACE, "Service1Service");
WSService service = WSService.create(serviceName);
final QName portName = new QName(NAMESPACE, "Service1Port");
// Corresponds to Service.addPort(portName, bindingId, address)
service.addPort(portName, bindingId.toString(), ADDRESS_URL.toString());
final WSPortInfo portInfo = ((WSServiceDelegate) service).safeGetPort(portName);
WSBindingProvider wsbp = new WSBindingProvider() {
public void setOutboundHeaders(List<Header> headers) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setOutboundHeaders(Header... headers) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setOutboundHeaders(Object... headers) {
throw new UnsupportedOperationException("Not supported yet.");
}
public List<Header> getInboundHeaders() {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setAddress(String address) {
throw new UnsupportedOperationException("Not supported yet.");
}
public WSEndpointReference getWSEndpointReference() {
throw new UnsupportedOperationException("Not supported yet.");
}
public WSPortInfo getPortInfo() {
return portInfo;
}
public Map<String, Object> getRequestContext() {
throw new UnsupportedOperationException("Not supported yet.");
}
public Map<String, Object> getResponseContext() {
throw new UnsupportedOperationException("Not supported yet.");
}
public Binding getBinding() {
return binding;
}
public EndpointReference getEndpointReference() {
throw new UnsupportedOperationException("Not supported yet.");
}
public <T extends EndpointReference> T getEndpointReference(Class<T> clazz) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void close() throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}
public ManagedObjectManager getManagedObjectManager() {
return null;
}
public Set<Component> getComponents() {
throw new UnsupportedOperationException("Not supported yet.");
}
public <S> S getSPI(Class<S> type) {
throw new UnsupportedOperationException("Not supported yet.");
}
};
final ClientTubeAssemblerContext context = new ClientTubeAssemblerContext(address, port, wsbp, binding, container, ((BindingImpl) binding).createCodec(), null, null);
return context;
}
use of com.sun.xml.ws.client.WSServiceDelegate in project metro-jax-ws by eclipse-ee4j.
the class TubelineAssemblerFactoryImplTest method testDispatch.
/**
* Execute a sequence that corresponds to:
* <pre>
* Service.createService(null, serviceName);
* Service.addPort(portName, bindingId, address);
* </pre>
*/
private Tube testDispatch(String configFileName) throws PolicyException {
final URL wsdlLocation = null;
final QName serviceName = new QName(NAMESPACE, "Service1Service");
// Corresponds to Service.createService(wsdlLocation, serviceName)
final WSServiceDelegate serviceDelegate = new WSServiceDelegate(wsdlLocation, serviceName, Service.class);
final QName portName = new QName(NAMESPACE, "Service1Port");
final BindingID bindingId = BindingID.SOAP11_HTTP;
// Corresponds to Service.addPort(portName, bindingId, address)
serviceDelegate.addPort(portName, bindingId.toString(), ADDRESS_URL.toString());
final EndpointAddress address = new EndpointAddress(ADDRESS_URL);
final WSDLPort port = null;
final WSPortInfo portInfo = serviceDelegate.safeGetPort(portName);
final WSBinding binding = bindingId.createBinding(new AddressingFeature(true));
final Container container = MockupMetroConfigLoader.createMockupContainer("tubes-config/" + configFileName);
WSBindingProvider wsbp = new WSBindingProvider() {
public void setOutboundHeaders(List<Header> headers) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setOutboundHeaders(Header... headers) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setOutboundHeaders(Object... headers) {
throw new UnsupportedOperationException("Not supported yet.");
}
public List<Header> getInboundHeaders() {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setAddress(String address) {
throw new UnsupportedOperationException("Not supported yet.");
}
public WSEndpointReference getWSEndpointReference() {
throw new UnsupportedOperationException("Not supported yet.");
}
public WSPortInfo getPortInfo() {
return portInfo;
}
public Map<String, Object> getRequestContext() {
throw new UnsupportedOperationException("Not supported yet.");
}
public Map<String, Object> getResponseContext() {
throw new UnsupportedOperationException("Not supported yet.");
}
public Binding getBinding() {
return binding;
}
public EndpointReference getEndpointReference() {
throw new UnsupportedOperationException("Not supported yet.");
}
public <T extends EndpointReference> T getEndpointReference(Class<T> clazz) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void close() throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}
public ManagedObjectManager getManagedObjectManager() {
return null;
}
public Set<Component> getComponents() {
throw new UnsupportedOperationException("Not supported yet.");
}
public <S> S getSPI(Class<S> type) {
throw new UnsupportedOperationException("Not supported yet.");
}
};
final ClientTubeAssemblerContext context = new ClientTubeAssemblerContext(address, port, wsbp, binding, container, ((BindingImpl) binding).createCodec(), null, null);
return getAssembler(bindingId).createClient(context);
}
use of com.sun.xml.ws.client.WSServiceDelegate in project metro-jax-ws by eclipse-ee4j.
the class SourceTest method testServiceCreateUsingInMemorySource.
/**
* This test ensures that when a valid Source object is provided to the JAX-WS client for
* the WSDL, it gets used instead of going over the wire to read from the WSDL URL
* (Associated change is in RuntimeWSDLParser.resolveWSDL)
*
* The test first reads the WSDL into an in-memory Source object and uses that
* to construct the Service delegate (using WSServiceDelegate constructor since
* no standard API is available). It then creates the service with this Source and makes
* sure that the InputStream underlying the Source has been consumed
*
* @throws Exception
*/
public void testServiceCreateUsingInMemorySource() throws Exception {
int port = PortAllocator.getFreePort();
String address = "http://localhost:" + port + "/source2";
Endpoint endpoint = Endpoint.create(new SourceEndpoint());
endpoint.publish(address);
QName portName = new QName(NS, "RpcLitPort");
QName serviceName = new QName(NS, "RpcLitEndpoint");
StreamSource wsdlSource = readWsdlToInMemorySource(address + "?wsdl");
WSServiceDelegate svcDel = new WSServiceDelegate(wsdlSource, serviceName, Service.class);
byte[] b = new byte[512];
int len = wsdlSource.getInputStream().read(b);
assertTrue("In-memory WSDL Source passed to client must be consumed!", len < 0);
}
Aggregations