服务承诺
资金托管
原创保证
实力保障
24小时客服
使命必达
51Due提供Essay,Paper,Report,Assignment等学科作业的代写与辅导,同时涵盖Personal Statement,转学申请等留学文书代写。
51Due将让你达成学业目标
51Due将让你达成学业目标
51Due将让你达成学业目标
51Due将让你达成学业目标私人订制你的未来职场 世界名企,高端行业岗位等 在新的起点上实现更高水平的发展
积累工作经验
多元化文化交流
专业实操技能
建立人际资源圈Web_Services_Interoperability_in_Online_Sales
2013-11-13 来源: 类别: 更多范文
Web services interoperability in online sales
Morar Gabriela Andreea
Babeş – Bolyai University Cluj-Napoca, Faculty of Economics and Business Administration
Supervisor: Professor Nicolae Tomai, PhD
Abstract: The purpose of this article is to give an example of how to improve communication between suppliers and retailers using web services interoperability. Web services, at their core, are technologies designed to improve the interoperability between the different application development platforms that exist today. By developing several web applications (in PHP, ASP.Net and a mobile device application) I gave a practical example of how to create a SOAP web service using NuSOAP libraries (on Linux platform using PHP), and how to consume it using SOAP clients written in different programming languages and running on different platforms.
The web service has the role of giving information to retailers about the products that are being sold by the supplier (quantity of products available in stock, their specific features, products’ pictures and categories of products available). The estimated result is a faster and better communication between members of the supply chain as web services possess immense potential to make supply chains more agile and competitive through the quick and secure dissemination of information.
Keywords: web service, SOAP, NuSOAP, interoperability, supply chain, ASP.NET client, PHP client, web service Smart client
1. Introduction
What is a web service' “A web service is a collection of protocols and standards used for exchanging data between applications or systems “[1].
Web services are the fundamental building blocks in creating distributed applications that work over the Internet. They are becoming the platform for application integration because of their open standards and their focus on communication and collaboration among applications and people.
One of the greatest web services benefits is interoperability.
What is interoperability' “Interoperability is the transfer and use of information in a uniform and efficient manner across multiple organizations and IT systems.” [2]
What is web services interoperability' “Software applications written in various programming languages and running on various platforms can use web services to exchange data over computer networks like the Internet in a manner similar to inter-process communication on a single computer.”[1]
Data exchange requires the data to be semantically matched (i.e. ensuring that the data describe the same thing) and for any differences in representation within the data models to be eliminated or meaningfully handled. [5]
2. Context
Supply Chain has emerged as an important factor in creating value for companies seeking to reduce costs, increase asset productivity and improve customer relationships. Nowadays on-line sales have increased and presence on the Internet is a must for all the companies. Supply chain dynamics have to keep-up with trends on the market so the need for online data exchange between suppliers and retailers has emerged.
Assuming that we are a supplier that delivers furniture to different retailers and we have a web application that allows us to administrate data about the furniture entries and exits in/out of our storehouse. This data is being kept in a database and we want to give our business partners data about the products that we are able to offer. The problem is that our application was build using another programming language and another platform than those of our partners. Because other companies have invested heavily in older technologies we have to find a method that allows us to communicate with their already build applications. In B2B relations we have to find technologies that will permit communication regardless the platform we are using. When choosing a solution we have to keep in mind the increasing need of accessing information no matter where we are using our mobile devices. How can we simplify interoperability between our applications' One of the possible answers to this question is by using web services.
Next I am going to give a practical example of how to implement a web service using NuSOAP libraries (on Linux platform using PHP), and how to consume it using SOAP clients written in different programming languages and running on different platforms. I this case the clients will be written in PHP, ASP.NET and C# .NET for mobile devices.
[pic]Figure 2.1 Structure of the developed system
3. Benefits of Interoperability
The benefits of interoperability can be summarized as follows [3]:
• Facilitates the creation of a new presentation layer using a new technology and providing the possibility of reusing the existing business components.
• It allows integration of heterogeneous software components within an enterprise
• It requires lower integration efforts
• The fact that interoperability is based on already agreed upon standards makes interfaces between the systems and the processes compatible to each other.
• Lower maintenance efforts. The cost and efforts of maintenance inherently decreases with the use of interoperable components.
• Increased market and technology opportunities. With the scope of web services and interoperability, the enterprises have a wider choice of vendors, as technologies no longer remain a hindering factor.
• Quicker transfer of data and more efficient working
• Reduction in duplication effort as data is being stored only in one database and data is being structured only one time using data types definition in the web server
• Unexpected data use which could potentially lead to innovative research and analysis [2]
I think that one of the main purposes of interoperability should not only be finding out in which programming language you should write your web service for getting better time performance, but what type of web service you should create in order to interact better with your business partners no matter what technology their applications where written in. This does not mean that performance should not be one of the criteria used when choosing a developing technology.
By using a SOAP web service to communicate between different applications we can ensure cross-platform interoperability. In the given example the platforms are Windows and Linux. As it follows I will list some of the advantages and drawbacks of Windows-Linux marriage using web services developed with open source resources (such as PHP and NuSOAP) .
Advantages of a Windows-Linux Marriage:
• Maximum desktop reach: The majority of users are running Windows on their machines. So by creating a SOAP web service our data can be used by the majority.
• Low licensing costs on the server: The resources needed for developing the web service were all open source. Even the database server was free as I used MySQL.
• Reusable libraries are available at low or no cost for server development: While there are many sites devoted to facilitating code exchange between Windows developers, there are a greater number for Linux. The Linux community thrives on collaboration and openness.
Disadvantages of a Windows-Linux Marriage
• A hybrid solution requires multiple complementary skill sets: Developers have to be trained in both Windows and Linux.
• Perfect interoperability has not yet been achieved. Perfect interoperability is not yet there with many open source packages for implementing SOAP on Linux because there still are complex data types that are not compatible.
4. Building the web service with NuSOAP
NuSOAP is a powerful group of PHP classes that makes the process of communicating and creating SOAP messages trivial. Written by Dietrich Ayala, NuSOAP works seamlessly with many of the most popular SOAP server implementations.[4]
Advantages [7]:
• Written in PHP it offers cross-platform interoperability
• It ensures automatic WSDL generation
• When accessed with a browser, it presents a friendly HTML interface which lists all the published methods / objects and their parameters
• Distributed as PHP source files which can be easily installed to most hosts (the user doesn't need to ask the server administrator to load extra binary modules)
• While PHP has no integrated debugging support, the library itself tries to output debugging information. To activate this mode set the debug variable to 1 (like this: $debug = 1). The debugging information will be appended to the response XML as a comment.
Disadvantages [7]:
• Not very well maintained (probably because of the existence of the "official" PHP SOAP module)
• Few examples and many of the examples don't work.
• Conflicts with the official PHP SOAP module. This may require the unloading of the PHP SOAP module or the renaming of the class soap_client.
• No real debugging support (because PHP doesn't have one).
The web service I have developed using NuSoap and the PHP programming language has the purpose of giving data about the products that the supplier distributes to its retailers. Through the web service the supplier gives the retailer the opportunity of selling products directly from his storehouse. By doing so it allows the retailer to sell products without having to store a big number of products in their storehouses. Based on the order the customer makes the products will be delivered to the retailer and then to the customer.
For security reasons the access to the web server functions is permitted based on a key. This web service has several methods that retrieve data from the server or write data on it, such as:
• GetCategories() – is the method that retrieves the categories of products that exist in the suppliers database ;
• GetCategory() – gets a category based on the CategoryID ;
• GetProductByCategory() – retrieves the list of products that exist in a category
• GetProduct() – retrieves data about a specific product;
• GetProductStock() – retrieves data of the quantity of a product existing in the suppliers storehouse;
• SaleProduct() – is the method that modifies the quantity of the product available in the suppliers storehouse.
Before you can declare any data types and functions in the web server you have to create a web server instance and initialize the WSDL support.
[pic]
As follows I will give an example of such a function and of the way the type used by it is declared in the WSDL file.
[pic]
Figure 4.1 Function’s definition in WSDL file
[pic]
Figure 4.2 Function body in WSDL file
[pic]
Figure 4.3 Definition of the data type returned by the function
As you can see from the example given above the functions contained by the web service are specific to the business logic layer that is present in the application that collects data about the supplier’s products. The data types transmitted through the web service are complex as some of the functions return an array of objects.
Next I’m going to give examples of different clients that consume the above web service. Although not discussed in this article another interesting issue will be a comparison between web services developed in different programming languages and the way these interact with their clients. Some of the comparison metrics could be: end to end transport time, memory used on the server, how many data can be exchanged and how easy it is to customize error messages.
5. Consuming the web service using a PHP client
Consuming the web service using a PHP client does not cause many problems being the fact that the library and the language used during the development process are PHP specific.
First we have to create a connection to the web service, thus is realized in PHP by creating an instance of a soapclient() as shown below.
[pic]
For efficiency reasons the web service location is kept in the configuration file. This allows programmers to change the location of the service, in case this changes, only in one place without having to interfere with the rest of the code.
[pic]
The following code shows how one can call a web service function in PHP.
[pic]
The below code is an example of how the information about a product retrieved via the GetProduct() function can be displayed in PHP.
[pic]
Figure 4.4 Example of how to use web method output
[pic]
Figure 5.1 Output of data retrieved via web service
As you can see is quite simple to consume in PHP a web service developed using NuSoap.
6. Consuming the web service using an ASP.NET client
The true challenge that interoperability faces is to ensure communication between applications that are running on distinct platforms and are written in different programming languages.
Through standardization this challenge has been almost overcome. This I have discovered when I’ve tried to create a client for my web service using the .NET platform.
No matter in what language is written the web service you want to consume the first step in creating an ASP.NET client is always the same: to add a web reference to the web service.
The next step is to create an instance of the web service that will allow calls to the web server functions. The fact that I have declare my own data types in the WSDL file that describes the web service ensures me that the structure of the data will be maintained no matter in what language the client will be developed. This also facilitates the consumption of complex data types through the web server.
stocuri.Stocuri ws = new stocuri.Stocuri();
Creation of an instance of the web service
stocuri.Product list = ws.GetProduct("asdf", Convert.ToInt32(Page.Request.QueryString["id"]));
Example of function call and initialization of data type declared in the WSDL file
Example of using data from the datatype created:
ShoppingCartItem item = new ShoppingCartItem();
item.ID = Convert.ToInt32(dvProduct.DataKey.Value);
item.ProductID = list.ProductID;
item.Name = list.ProductName;
[pic]
Figure 6.1 Output of data retrieved via web service
7. Consuming the web service from a mobile device
The continuous evolution of technology allows us to access data from wherever we are. By using smart phones, PDA’s and other mobile devices businessman nowadays can keep an eye on their businesses. Is a well known fact that the use of mobile applications by regular users of mobile devices has exploded in the past few years. The trend registered signalizes the fact that in the near future the presence of companies on mobile devices will be a must as their presence on the Internet is today.
The possibility of accessing data related to the supply chain on their mobile devices is an attractive idea for retailers and suppliers too. The example I have given is a basic one and has only the goal of demonstrating how data regarding the quantity of a product existing in the storehouse of a supplier can be accessed from a mobile device through a web service.
Due to memory space limitations and processors available on mobile devices is recommend that the communication with a web service to be done using a proxy class.
The steps that are to be followed are the same as in the case of the ASP.NET client. The only difference is that in the testing phase you may experience some bottlenecks until you will get your emulator running well and communicating with the web service that is running on your local machine. After solving all this problems you should encounter no more troubles while consuming the service.
Below is an example of how data about the quantity of a product existing in the storehouse can be retrieved.
[pic]
Figure 7.1 Web service Smart Client
8. Challenges to Interoperability
As is the case of any path-breaking technologies, the web service and the interoperability aspects also presents the providers and consumers with a few bottlenecks. Some of the challenges faced, include the following [3]:
• One of the most evident and well known challenges in interoperability is the fact that you never know if the data type you are using on a platform is equivalent with the corresponding data type of another platform. There are languages that do not support data types supported by other languages. Even if the same data type exists on both platforms the way it is implemented may differ from a platform to another. Data interoperability is only one aspect of the overall interoperability problem. Data could be requested that is not actually held, the hardware or connectors, operating systems, metadata, protocols, or applications could be incompatible. These are interoperability issues that go beyond data integration. [5]
• Because organizations are addressing the interoperability problem from their own perspective many “proprietary” standards have arisen. Due to this the very objective of interoperability is being questioned. These specifications cannot be guaranteed to be compatible with those adopted by other vendor(s) or client(s).
• A human issue is the fear of losing control over interoperable data, the training and process change required to technically and administratively manage complex systems over a dispersed community.
• With the growing scope and horizon of the web services, new specifications and standards are being constantly added to the existing set, by the vendors, consortia of companies, standard bodies as well as individual companies. These groups may or may not be communicating with each other regarding any of their releases. This contributes to a growing set of incompatible specifications.
• The four types of basic conflict that arise when merging various data sources:
o Semantic Conflicts (different schema do not match conceptually and therefore must be aggregated)
o Descriptive Conflicts (e.g. terminological choices, naming difference between conceptually identical data, different measurement values that need to be resolved or mapped)
o Heterogeneous Conflicts (the methodologies being used to describe the concepts differ substantially)
o Structural Conflicts (concepts are structured differently, e.g. one schema uses an attribute whereas another uses a reference). [6]
9. Related work
Several other approaches exist to solve the set of problems that Web services address, both preceding and contemporary to it. RMI was one of many middleware systems that have seen wide deployment. More ambitious efforts like CORBA and DCOM attempted to affect distributed objects, which Web services implementations sometimes try to mimic.
More basic efforts include XML-RPC, a precursor to SOAP that was only capable of RPC, and various forms of HTTP usage without SOAP.
Here are some new directions regarding web services:
• Semantic web services - DAML-S (DARPA Agent Markup Language-Services) is a major effort aimed at enabling the semantic description of Web services.[9]
• Standardization efforts for web services - Several efforts are under way to define new standards for Web services. BPEL4WS (Business Process Execution Language for Web Services) is a language for specifying composite services. [9]
• Automatic service composition - A recent trend in automatic service composition is to use Artificial Intelligence planning techniques. For example, SHOP2 (Simple Hierarchical Ordered Planner 2) adopts the Hierarchical Task Network concept as a planning methodology. The planning system decomposes tasks into smaller and smaller subtasks, until it finds primitive tasks that can be performed directly.[9]
• E-government web service projects - WebSenior is one of the first projects to provide support for e-government Web services. The Organization for the Advancement of Structured Information Standards (OASIS) has an e-government technical committee. The TC is a forum for governments to express their requirements with respect to XML-based standards. It provides a mechanism for creating best-practice documents and promotes the adoption of Oasis specifications. [9]
10. Conclusions and future work
During my attempt of achieving interoperability between platforms using web services I have discovered that PHP and .NET interoperability are not that well documented as I have spent considerable time and effort in finding examples of .NET clients that consume a SOAP web service created in PHP. Although the given example is not a complex one it demonstrates that interoperability can be achieved trough a SOAP web service created using NuSOAP library.
My purpose was to show how data types declared in the WSDL file can be used by different programming languages in order to keep the data structured has it was intended by the supplier. Even if data types differ from a programming language to another I have shown that by creating your own data types, based on basic data types that every language has, you can easily exploit information that has been already structured and that gives you a hint on how you should use it.
By combining web services interoperability with emerging technologies, such as mobile devices applications, I have demonstrated how supply chain can become more agile and competitive through the quick and secure dissemination of information. Suppliers now have the opportunity of keeping an eye on their storehouses while being on the move.
Distributed systems integration is the future in B2B and B2C relations and one possibility of achieving it is using web services.
Future development for this paper could be creating an e-Mall where suppliers can display their offers via web services and where retailers can chose the suppliers they like. By selecting the desired supplier they will receive all the necessary data for exploiting its web service and establishing a B2B relation with it. This will ensure better opportunities for retailers and will increase competition between suppliers as they will be forced to improve the offered services.
Acknowledgement: The work presented has been founded by the research grant" CONTRIBUTII LA STUDIUL SISTEMELOR MOBILE; STUDIU DE CAZ PRIVIND IMPLEMENTAREA UNUI ERP PE UN SISTEM MOBIL", Idei, ID_573, Director Nicolae Tomai, PhD., Professor, PNII Program, 573/2009 supported by CNCSIS.
References
[1] Andreas Tolk, James A. Muguira (2003), The Levels of Conceptual Interoperability Model, http://www.sisostds.org/index.php'tg=fileman&idx=get&id=2&gr=Y&path=Simulation+Interoperability+Workshops%2F2003+Fall+SIW%2F2003+Fall+SIW+Papers+and+Presentations&file=03F-SIW-007.pdf
[2] www.calstatela.edu/faculty/jmiller6/cs420-winter2007/notes/notes12-1/notes.doc, 2/12/2007
[3] Maulik Shah (2004), Web Services-Interoperability,
http://www.cs.helsinki.fi/u/mlaanti/WSInterop.html
[4] Daisy Abbott (2009), University of Glasgow, Interoperability, http://www.dcc.ac.uk/resource/briefing-papers/interoperability
[5] http://education.sys-con.com/node/44884
[6]http://hype-free.blogspot.com/2007/01/implementing-web-services-with-open.html
[7] Renner (2001), A "Community of Interest" Approach to Data Interoperability
[8] W.J. Gilmore (2006), Beginning PHP and MySQL 5: from novice to professional, Apress publishing house.
[9] Related Work in Web Services Delivery (2006), http://dsonline.computer.org/portal/site/dsonline/menuitem.9ed3d9924aeb0dcd82ccc6716bbe36ec/index.jsp'&pName=dso_level1&path=dsonline/2006/01&file=x6bou-sb.xml&xsl=article.xsl&;jsessionid=Jzmq6TBQhWhQbJnvHryLtR5GQhtHrQ3xD2V70XT1kbSc2Mnh4hZy!1370494067

