use of org.apache.hello_world_soap_http.SOAPService in project cxf by apache.
the class ClientEndpointCreationLoop method iteration.
private void iteration() throws URISyntaxException {
SOAPService service = new SOAPService();
service.getPort(portName, Greeter.class);
}
use of org.apache.hello_world_soap_http.SOAPService in project cxf by apache.
the class Client method main.
public static void main(String[] args) throws Exception {
if (args.length == 0) {
System.out.println("please specify wsdl");
System.exit(1);
}
Server.main(new String[] { "inProcess" });
URL wsdlURL;
File wsdlFile = new File(args[0]);
if (wsdlFile.exists()) {
wsdlURL = wsdlFile.toURI().toURL();
} else {
wsdlURL = new URL(args[0]);
}
System.out.println(wsdlURL);
SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
Greeter port = ss.getSoapPort();
String resp;
System.out.println("Invoking sayHi...");
resp = port.sayHi();
System.out.println("Server responded with: " + resp);
System.out.println();
System.out.println("Invoking greetMe...");
resp = port.greetMe(System.getProperty("user.name"));
System.out.println("Server responded with: " + resp);
System.out.println();
try {
System.out.println("Invoking pingMe, expecting exception...");
port.pingMe();
} catch (PingMeFault ex) {
System.out.println("Expected exception: PingMeFault has occurred: " + ex.getMessage());
FaultDetail detail = ex.getFaultInfo();
System.out.println("FaultDetail major:" + detail.getMajor());
System.out.println("FaultDetail minor:" + detail.getMinor());
}
System.exit(0);
}
use of org.apache.hello_world_soap_http.SOAPService in project cxf by apache.
the class Client method main.
public static void main(String[] args) throws Exception {
URL wsdlURL = Client.class.getResource("/wsdl/hello_world.wsdl");
SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
Greeter port = ss.getSoapPort();
org.apache.cxf.endpoint.Client client = ClientProxy.getClient(port);
client.getInInterceptors().add(new StreamInterceptor());
client.getInFaultInterceptors().add(new StreamInterceptor());
System.out.println("Invoking sayHi...");
String resp = port.sayHi();
System.out.println("Server responded with: " + resp);
System.out.println();
System.exit(0);
}
use of org.apache.hello_world_soap_http.SOAPService in project cxf by apache.
the class Client method main.
public static void main(String[] args) throws Exception {
if (args.length == 0) {
System.out.println("please specify wsdl");
System.exit(1);
}
try {
URL wsdlURL;
File wsdlFile = new File(args[0]);
if (wsdlFile.exists()) {
wsdlURL = wsdlFile.toURI().toURL();
} else {
wsdlURL = new URL(args[0]);
}
SpringBusFactory bf = new SpringBusFactory();
URL busFile = Client.class.getResource("/client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
SOAPService service = new SOAPService(wsdlURL, SERVICE_NAME);
Greeter port = service.getSoapPort();
implicitPropagation(port);
explicitPropagation(port);
implicitPropagation(port);
} catch (UndeclaredThrowableException ex) {
ex.getUndeclaredThrowable().printStackTrace();
} catch (Throwable ex) {
ex.printStackTrace();
} finally {
System.exit(0);
}
}
use of org.apache.hello_world_soap_http.SOAPService in project cxf by apache.
the class NettyServerTest method start.
@BeforeClass
public static void start() throws Exception {
Bus b = createStaticBus();
BusFactory.setThreadDefaultBus(b);
ep = Endpoint.publish("netty://http://localhost:" + PORT + "/SoapContext/SoapPort", new org.apache.hello_world_soap_http.GreeterImpl());
URL wsdl = NettyServerTest.class.getResource("/wsdl/hello_world.wsdl");
assertNotNull("WSDL is null", wsdl);
SOAPService service = new SOAPService(wsdl);
assertNotNull("Service is null", service);
g = service.getSoapPort();
assertNotNull("Port is null", g);
}
Aggregations