Class 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 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