use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.
the class EndpointAPITester method testEndpoint1.
public void testEndpoint1() {
int port = Util.getFreePort();
String address = "http://localhost:" + port + "/hello";
Endpoint endpoint = Endpoint.create(new RpcLitEndpoint());
endpoint.publish(address);
doAPItesting(endpoint);
}
use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.
the class MessageContextTest method testHttpProperties.
public void testHttpProperties() throws Exception {
int port = PortAllocator.getFreePort();
String address = "http://localhost:" + port + "/hello";
Endpoint e = Endpoint.create(HTTPBinding.HTTP_BINDING, new MessageContextProvider());
e.publish(address);
URL url = new URL(address + "/a/b?a=b");
InputStream in = url.openStream();
BufferedReader rdr = new BufferedReader(new InputStreamReader(in));
String str;
while ((str = rdr.readLine()) != null) ;
e.stop();
}
use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.
the class OnewayTest method testOneway.
public void testOneway() throws Exception {
int port = PortAllocator.getFreePort();
String address = "http://localhost:" + port + "/oneway";
Endpoint endpoint = Endpoint.create(new OnewayEndpoint());
endpoint.publish(address);
int status = getHttpStatus(address);
assertEquals(202, status);
// Commenting this out. It's possible that
// verifyInteger() could be called before echoInteger()
// since 202 is sent before invoking echoInteger
// assertTrue(verify(address).contains("12345"));
endpoint.stop();
}
use of jakarta.xml.ws.Endpoint 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);
}
use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.
the class EndpointWsdlLocationTest method testHtmlPage.
public void testHtmlPage() throws Exception {
try {
HttpAdapter.setPublishStatus(true);
int port = PortAllocator.getFreePort();
String address = "http://localhost:" + port + "/hello";
Endpoint endpoint = Endpoint.create(new RpcLitEndpointWsdlLocation());
endpoint.publish(address);
URL pubUrl = new URL(address);
URLConnection con = pubUrl.openConnection();
InputStream is = con.getInputStream();
int ch;
while ((ch = is.read()) != -1) ;
assertTrue(con.getContentType().contains("text/html"));
endpoint.stop();
} finally {
HttpAdapter.setPublishStatus(false);
}
}
Aggregations