Loading...

Manual for training on web based IT support system

Author: Iloka Benneth Chiemelie
Published: 30th August 2015

1.0 How web services work.
John (2008) presented a clear idea of what web based service is all about and how it is operated. In that sense, the conception in this paper will be based on the presentations made by John.
1.      A web service is described in by a document that is contained in an XML format, and coded with an XML language known as WSDL (web service description language). This language is used to describe the service in terms of how it will operate, the messages it will deliver, how section of the service are bonded together, and it normally have URL that is used to call the service.
2.      The structure of the messages contained in web based services is described with XML Schema (XSD) that is either contained in the WSDL or referred by the WSDL.
3.      All the messages are being sent or received from the web services in the form of XML and it is always in compliance with the Schema, which follows the defined protocols contained in the WSDL, using an XML protocol known as SOAP (Simple Object Access Protocol).
In .NET, the normal way for accessing web based service is as follows. However, other platforms also maintain a similar mechanism in term of the functionality and access to web services.
1.      In order to access web based services, the developers will enact the permission for such by making the WSDL accessible. This can either be done by placing it on a website, or by generating the WSDL automatically.
2.      The developer of a client application will also have to add a Service Reference if they are using WCF, or a web reference in the case where they use the older technology ASMX. This need for such is to communicate with the Visual studio about the location of the WSDL for the web service.
3.      Once communication has been established, the visual studio now requests for the WSDL. It then parses the file in order to gain an understanding of the web service. From the information parsed, it will then create some classes. These classes are known as “Proxy Classes” (it should not be confused with the Internet proxy server). These classes represent the web service, which allows the user the illusion that it is just the normal methods that are being called on the normal classes – however, these classes are not normal.
4.      The client code will now create an instance of the proxy class for the service. This will be done by calling on the instance method of the class, by passing certain parameters. Additionally, the proxy class will turn these parameters into SOAP XML files that are properly-formatted and send them to the service.
5.      From the server side, the XML will probably be turned into parameters once again, and a service-side method will need then be called into these parameters if such expectations occur.
6.      The server will perform exactly what it has been requested to do and in return may produce result. The produced result will then be turned into SOAP XML that will also be sent back to the client.
7.      The proxy class on the client-side will then receive the called XML and turn it back into the return values, the returning the values back to the caller.
The outcome of all these descriptions is that the caller of a web service can treat the service operations exactly like the normal methods used on normal objectives. In most of the cases, even the developers of web based services can treat the service just like it is a normal object with normal methods. In any case, all the processing that happens in the middle prior to delivery of the message is done in the SOAP XML, which is described by the XML Schema, and referenced by a WSDL in XML.
The consequence of this however is that the only the things that can be described by the WSDL and XML Schema will be produced in the client proxy class. Both the WSDL and XML Schema don’t describe programming language concepts. For instance, the term “operation” is used not “method” as is obtainable in programming, or “function”, “substitute”, and “procedure.” Neither the WSDL nor the XML Schema can be used to describe things like construction, indexers, events, generies, or even indexed properties.
2.0 The differences between web services and other approaches to interoperability which may offer similar functionality
Precisely speaking, it is only the SOAP XML that is web services. They are normally based on the WS-*Specs and standardized by W3C and Oasis. In some occasions, they are also other applications that are referred to as web services and they are known as POX-Endpoint (Plain old XML) or REST Endpoint, which allows user to simply get a raw XML via HTTP GET. The difference between SOAP XML and other XML format are:
1.      Call functions - SOAP services perform their Schema in the form of a WSDL endpoint and as such there are a number of tools that can be used to create proxy objects and hide the complexity of the web service call. In the case of POX service however, there is the need to know which of the Schema to use (for instance from the documentations contained in the Schema language).
2.      Message – SOAP service carry the payload inside a SOAP envelope (an XML Schema with header and body and containing the payload in the body). With the header being independent from the payload, it allows for the rerouting of the contents, signing and encryption, authenticating and other functions without knowing the contents. However, the POX leaves all these functions for the webserver and relies purely on the HTTP for authentication and compression. The encryption and signing will be done by the user’s system and while it has a low overhead, it also has a low discoverability.
The function that works best for the user will depend on the user’s scenario. For instance, if the user is working in .NET or Java world, the user will normally find it very easy to create a proxy and use that to function with the web service on its own as a remote object. This will give the user a well-built infrastructure and a comfortable programming appearance. However, if the user’s environment doesn’t offer support for the generation of proxy and it is very hard to be called from any function, then POX is the best lightweight way to go about the functions.
3.0 How to set up and implement a web service using NetBeans IDE
In order to set up and implement the NetBeans IDE described in this page, the following software are required:
Software or Resource
Version Required
Java EE download bundle
version 6 or version 7
Java EE-compliant web or application server
GlassFish Server Open Source Edition 3.1.x, or Oracle WebLogic Server 11g or 12c
3.1 Introduction
The components that are related to advanced web services interoperability fall within four main categories as:
3.1.1 Bootstrapping and configuration – this involve the process that is executed in order to create a Web service client that can allow for access and the consumption of a web service.
3.1.2 Message security – a number of security configurations are supported and they include:
  1. Targets to sign and encrypt options
  2. Client/service Web services security
  3. Client/service trust options
  4. Advanced configuration options
  5. Keystore configuration options
3.1.3 Message optimization – there is the need to ensure that the web service messages are being transmitted over the internet in the most efficient manner. This is achieved in web service communication by encoding the messages before they are being transmitted and then de-encoding then when they reach their final destination.
3.1.4 Reliable messaging - this is measure by the potentials of the system’s ability to deliver message from one point to another without any attached error.
3.2 Calculator sample
3.2.1 Accessing the calculator sample
The first approach in this section is to get the sample from the new project wizard, then examine the sample and deploy it. This is done by:

1.      Choose File >> New project. Then from the sample category, select the web service node and then the calculator sample as illustrated in the figure below.
1.      Then click NEXT. Make sure all the defaults are unchanged and then click FINISH. In the process, two projects will be created. The first project is named CalculatorApp, which provides a web service named CalculatorWS that brings out an operation termed “add”. The second project is named CalculatorClientApp, and this provides a client that is named CalculatorWSServcie, that calls the web service “add” operations.
1.      Double-click the CalculatorWS web services to open the Visual Designer which is one of the tools provided by IDE for development of web service
3.2.2 Deploying and Testing Calculator
1.      Right-click on the CalculatorApp project and choose run
1.      Click on the WSDL link that is contained inside the browser to access the WSDL file that will be used in definition of the web service.
1.      You can now use the IDE to test the web service. The IDE will provide a client for your web service automatically without having the create one on your own. In order to test the web service, right-click on the CalculatorWS node as contained in the Web Services node and then choose Test Web Service.
1.      Once the above 3 has been done, it will open a test application where the values can be entered for each of the field that have already been defined in the web service.
1.      The next step will be to conduct an examination of the CalculatorClientApp project in the project window. If any error occurs for the ClientSeviet.Java, the solution is to right-click on the project node and select clean and build. The reason why the error occurred is because the CalculatorWS service had not been deployed. Once it is deployed, the IDE can then parse its WSDL and the ClientSerbiet compiles.
2.      Right-click the CalculatorClientAppl project node and then select run. The client in this case is a serviet with the responsibility of providing the user interface in the browser.
1.      Click Get Result to have the result displayed in the client
References
John, S (2010), “Basics: How Web Services Work.” Available at: http://johnwsaunders3.wordpress.com/2008/09/23/basics-how-web-services-work/ [Accessed on: 17/08/2013].
Technology 2158395212985752203

Post a Comment

Tell us your mind :)

emo-but-icon

Home item

Popular Posts

Random Posts

Click to read Read more View all said: Related posts Default Comments