Package org.jbpm.process.workitem.webservice

## Class WebServiceCommand

- java.lang.Object
- - org.jbpm.process.workitem.webservice.WebServiceCommand

- All Implemented Interfaces:
    `org.kie.api.executor.Command`, `org.kie.internal.runtime.Cacheable`

      public class WebServiceCommand
      extends Object
      implements org.kie.api.executor.Command, org.kie.internal.runtime.Cacheable

  Web Service executor command that executes web service call using Apache CXF. It expects following parameters to be able to operate:
  - Interface - valid interface/service name of the web service (port type name from wsdl)
  - Operation - valid operation name
  - Parameter - object that is going to be used as web service message
  - Url - location of the wsdl file used to look up service definition
  - Namespace - name space of the web service
  - Endpoint - overrides the endpoint address defined in the referenced WSDL.
  - Username - username for authentication (optional)
  - Password - password for authentication (optional)

  Web service call is synchronous but since it's executor command it will be invoked as asynchronous task any way.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `WebServiceCommand()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `applyAuthorization​(String userName, String password, org.apache.cxf.endpoint.Client client)` |
    `void` | `close()` |
    `org.kie.api.executor.ExecutionResults` | `execute​(org.kie.api.executor.CommandContext ctx)` |
    `protected org.apache.cxf.endpoint.dynamic.DynamicClientFactory` | `getDynamicClientFactory​(org.kie.api.executor.CommandContext ctx)` |
    `protected org.apache.cxf.endpoint.Client` | `getWSClient​(org.kie.api.runtime.process.WorkItem workItem, String interfaceRef, org.kie.api.executor.CommandContext ctx)` |
    `void` | `setClients​(ConcurrentHashMap<String,​org.apache.cxf.endpoint.Client> clients)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WebServiceCommand

          public WebServiceCommand()

  - ### Method Detail

    - #### execute

          public org.kie.api.executor.ExecutionResults execute​(org.kie.api.executor.CommandContext ctx)
                                                        throws Exception

      Specified by:
        `execute` in interface `org.kie.api.executor.Command`
      Throws:
        `Exception`

    - #### getWSClient

          protected org.apache.cxf.endpoint.Client getWSClient​(org.kie.api.runtime.process.WorkItem workItem,
                                                               String interfaceRef,
                                                               org.kie.api.executor.CommandContext ctx)

    - #### getDynamicClientFactory

          protected org.apache.cxf.endpoint.dynamic.DynamicClientFactory getDynamicClientFactory​(org.kie.api.executor.CommandContext ctx)

    - #### applyAuthorization

          protected void applyAuthorization​(String userName,
                                            String password,
                                            org.apache.cxf.endpoint.Client client)

    - #### close

          public void close()

      Specified by:
        `close` in interface `org.kie.internal.runtime.Cacheable`

    - #### setClients

          public void setClients​(ConcurrentHashMap<String,​org.apache.cxf.endpoint.Client> clients)