use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.
the class ProviderTest method testHttpProviderEndpoint.
public void testHttpProviderEndpoint() {
int port = PortAllocator.getFreePort();
String address = "http://127.0.0.1:" + port + "/";
Endpoint e = Endpoint.create(new HttpProvider());
e.publish(address);
// TODO add dispatch client to access this endpoint
e.stop();
}
use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.
the class SchemaRedefineTest method testSchemaRedefine.
public void testSchemaRedefine() throws Exception {
int port = PortAllocator.getFreePort();
String address = "http://localhost:" + port + "/redefine";
Endpoint e = Endpoint.create(new RedefineProvider());
List<Source> metadata = new ArrayList<Source>();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
String[] docs = { "SchemaRedefine.wsdl", "SchemaRedefine.xsd" };
for (String doc : docs) {
URL url = cl.getResource(doc);
metadata.add(new StreamSource(url.openStream(), url.toExternalForm()));
}
e.setMetadata(metadata);
e.publish(address);
XMLInputFactory factory = XMLInputFactory.newInstance();
XMLStreamReader reader = factory.createXMLStreamReader(new URL(address + "?wsdl").openStream());
while (reader.hasNext()) {
reader.next();
if (reader.getEventType() == XMLStreamConstants.START_ELEMENT && reader.getLocalName().equals("redefine")) {
String loc = reader.getAttributeValue(null, "schemaLocation");
assertEquals(address + "?xsd=1", loc);
}
}
e.stop();
}
use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.
the class NamespaceTest method testNamespace.
public void testNamespace() throws Exception {
int port = PortAllocator.getFreePort();
String address = "http://localhost:" + port + "/hello";
Endpoint e = Endpoint.create(new MyProvider());
e.publish(address);
String message = "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>" + " <s:Body xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>" + "<ping xmlns='urn:com:dassault_systemes:webservice'><iSentence xsi:nil='true'/></ping>" + "</s:Body>" + "</s:Envelope>";
HTTPResponseInfo rInfo = ClientServerTestUtil.sendPOSTRequest(address, message);
assertEquals(200, rInfo.getResponseCode());
e.stop();
}
use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.
the class SubDomainTest method testSubDomainCookies.
public void testSubDomainCookies() throws Exception {
InetAddress addr = InetAddress.getLocalHost();
String host = addr.getCanonicalHostName();
if (!isFqdn(host)) {
System.out.println("Cannot run test with hostname=" + host + " Need a hostname with two dots");
return;
}
int port = PortAllocator.getFreePort();
String address = "http://" + host + ":" + port + "/hello";
Endpoint endpoint = Endpoint.publish(address, new HelloServiceImpl());
invoke(host, address);
endpoint.stop();
}
use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.
the class EndpointAPIWithZeroPortTest method testEndpointWithZeroPort.
public void testEndpointWithZeroPort() {
int port = 0;
String address = "http://localhost:" + port + "/hello";
Endpoint endpoint = Endpoint.publish(address, new RpcLitEndpoint());
doAPItesting(endpoint);
}
Aggregations