Download presentation
Presentation is loading. Please wait.
Published byCollin Fox Modified over 8 years ago
1
Web Services General [recap] about web services Project C# Java Python Python web service
2
General Information about WS Easy to implement in C# and Python Good for sharing functions Platform and language independent Uses XML for transfering data Not locked to one protocol (can use http, smtp... )
3
Project Web service to calculate foreign currencies Implement server in C# Implement clients in C#, Java and Python Use different data types Compare the three solutions
4
Project: C# Create class with necessary functions Use XML-file for storing currency information Needed functions: getNames() - string[] getAllCurrencies() - record/struct of name and ratio convert(string from, string to, double amount) - void update(string name, string ratio) – void Look at code
5
Project: Java Connect to web service using javax.jws Auto generation of stub file from WSDL Use NetBeans for stub file generation Look at code
6
Project: Python Connect to web service using suds No autogenerated stub files Easy to use, for small projects Alternative: SOAPpy Look at code
7
Alternative: Python web service Very easy to setup simple python web service Server: import SOAPpy def echo(msg): return msg server = SOAPpy.SOAPServer(("localhost", 8090)) server.registerFunction(echo) server.serve_forever()
8
Alternative: Python web service Client: import SOAPpy server = SOAPpy.SOAPProxy("http://localhost:8090/") print server.echo(”Hello!”)http://localhost:8090/ Look at example
9
Conclusion Python: Very fast setup for smaller projects C#: Fast to setup, also good for large projects Java: Difficult server setup, difficult client setup Several ways to go in each language
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.