public class WebService extends TypedAtomicActor
The WebService actor provides the user with a plug-in interface to execute any WSDL-defined web service. Given a URL for the WSDL of a web service and an operation name that is included in the WSDL, this actor customizes itself to execute this web service operation.
WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure- oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services). WSDL is extensible to allow description of endpoints and their messages regardless of what message formats or network protocols are used to communicate. More information on WSDL and realted standard can be found at: http://www.w3.org/TR/wsdl
The user can instantiate the generic web service actor by providing the WSDL URL and choosing the desired web service operation. The actor then a utomatically specializes itself and adds ports with the inputs and outputs as described by the WSDL. The so instantiated actor acts as a proxy for the web service being executed and links to the other actors through its ports.
The WSDL is parsed to get the input, output and binding information. It dynamically generates ports for each input and output of the operation. This customization happens at the configuration time of a model. When the actor is fired at run time, it gets the binding information and creates a call object to run the model. Using this call object, it invokes the web service and broadcasts the response to the output ports.
Notices to users:
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
TypedIOPort |
clientExecErrors
It outputs the errors if any occured when actor is executing.
|
Parameter |
hasTrigger
This is an parameter to activate the optional startTrigger port.
|
SingletonParameter |
hide |
StringParameter |
methodName
The parameter for the method name.
|
StringParameter |
password
The password to invoke the web service if necessary.
|
TypedIOPort |
startTrigger
This is an optional input port that can be used to help the scheduling of
the actor.
|
StringParameter |
timeout
The timeout duration in web service call.
|
StringParameter |
userName
The userName to invoke the web service if necessary.
|
StringParameter |
wsdlUrl
The parameter for the URL of the web service WSDL.
|
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
WebService(CompositeEntity container,
java.lang.String name)
Construct a WebService actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
void |
attributeChanged(Attribute at)
Callback for changes in attribute values Get the WSDL from the given URL.
|
void |
fire()
Get the URL address of the the location of the web service defined by the
given WSDL.
|
void |
preinitialize()
Create receivers and declare delay dependencies.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, initialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public StringParameter wsdlUrl
public StringParameter methodName
public StringParameter userName
public StringParameter password
public StringParameter timeout
public Parameter hasTrigger
public TypedIOPort startTrigger
This port is activated by the hasTrigger parameter. Double-click on the actor to enable. Please enable it ONLY when the actor has no input and it is required for scheduling of the actor.
public TypedIOPort clientExecErrors
public SingletonParameter hide
public WebService(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.IllegalActionException
- If the actor cannot be contained by the proposed
container.NameDuplicationException
- If the container already has an actor with this name.public void attributeChanged(Attribute at) throws IllegalActionException
attributeChanged
in class NamedObj
at
- The attribute that changed.IllegalActionException
public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If there is no director.public void preinitialize() throws IllegalActionException
AtomicActor
preinitialize
in interface Initializable
preinitialize
in class AtomicActor<TypedIOPort>
IllegalActionException
- Not thrown in this base class.