My Quotes

When U were born , you cried and the world rejoiced
Live U'r life in such a way that when you go

Friday, May 13, 2016

Web Services best practices

  1. Use XML Schema to define the input and output of your Web Service operations
  2. A Web Service should be defined with a WSDL (or WADL in case of REST) and all responses returned by the Web Service should comply with the advertised WSDL
  3. Do not use a proprietary authentication protocol for your Web Service.
  4. Rather use common standards like HttpAuth or Kerberos.
  5. Or define username/password as part of your XML payload and expose you Web Service via SSL
  6. Make sure your Web Service returns error messages that are useful for debugging/tracking problems.
  7. Make sure to offer a development environment for your service, which preferably runs the same Web Service version as production, but off of a test database rather than production data.
  8. Important to retain
    • Naming conventions
    • parameter validation
    • parameter order
  9. No session data
  10. Resource does not need to be in known state
  11. request alone contains all information
  12. Always include version parameter
  13. Handle multiple formates
  14. Use heartbeat methods
    • method that does nothing with no authentication
    • shows service is alive
  15. All services should be
    • accessible
    • documented
    • robust
    • reliable
    • simple
    • predictable
  16. Always implement a reliability error listener.
  17. Group messages into units of work
  18. Set the acknowledgement interval to a realistic value for your particular scenario.
  19. Set timeouts (inactivity and sequence expiration) to realistic values for your particular scenario.
  20. Configure Web service persistence and buffering (optional) to support asynchronous Web service invocation.
  21. Choose between three transport types: asynchronous client transport, MakeConnection transport, and synchronous transport.
  22. Using WS-Policy to Specify Reliable Messaging Policy Assertions
    • At Most Once
    • At Least Once
    • Exactly Once
    • In Order
  23. Define a logical store for each administrative unit (for example, business unit, department, and so on).
  24. Use the correct logical store for each client or service related to the administrative unit.
  25. Define separate physical stores and buffering queues for each logical store.
  26. Using the @Transactional Annotation
  27. Enabling Web Services Atomic Transactions on Web Services

No comments :