Exemplo n.º 1
0
  @SuppressWarnings("unchecked")
  public Object invokeWS(String name) {
    WSDynamicClient client = null;
    try {
      URL wsdlURL = new URL("http://127.0.0.1:8080/basic/HelloWorld?wsdl");

      WSDynamicClientBuilder clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
      client = clientBuilder.verbose(true).keepSource(true).wsdlURL(wsdlURL.toString()).build();
      WSMethod method = client.getWSMethod("HelloService", "HelloWorldBeanPort", "echo");
      Map<String, Object> args = new java.util.HashMap<String, Object>();
      args.put("arg0", name);
      InvocationResult result = method.invoke(args, null);
      Map<String, Object> res = result.getMapRequestAndResult(null, null);
      Map<String, Object> test = (Map<String, Object>) res.get("results");
      client.close();
      return test.get("result");
    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {
      if (client != null) {
        client.close();
      }
    }
  }
Exemplo n.º 2
0
 public WSSecurityEnabler(WSDynamicClient client) {
   delegate = client.getWSExtensionEnablerDelegate();
 }