问题
How do I draw a class in UML that uses a web service?
回答1:
You could also use WSDL (Web Services Description Language) UML profile with the appropriate WSDL stereotypes.
That would give for example:
--------------------
| <<wsdl:service>> |
--------------------
| MyWebService |
--------------------
| |
--------------------
| |
--------------------
{URI="/MyWebService"}
A full UML example involving many components of a web service would be:
(source: xml.com)
回答2:
Sounds like a sequence diagram, with client and service instances, where the client makes the call to the service. If the request is synchronous, you'll see the return come back to the client; if not, there's no return.
回答3:
I would have draw the web service as an interface.
I would put a boundary around the web service to indicate it's located outside my system boundary.
来源:https://stackoverflow.com/questions/428377/uml-class-diagram-web-service