<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>C# Help &#187; Web Services</title>
	<atom:link href="http://www.csharphelp.com/tag/web-services/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharphelp.com</link>
	<description>C# Tutorial and Guides</description>
	<lastBuildDate>Tue, 07 Feb 2012 01:03:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WebServices with Language Interoperability</title>
		<link>http://www.csharphelp.com/2007/11/webservices-with-language-interoperability-2/</link>
		<comments>http://www.csharphelp.com/2007/11/webservices-with-language-interoperability-2/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 01:36:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.csharphelp.com.php5-3.dfw1-2.websitetestlink.com/?p=1718</guid>
		<description><![CDATA[By Vijay Cinnakonda A webservice in general is a way of exposing the properties and methods through the Internet In other words, it&#8217;s an URL-addressable resource that programmatically returns information to clients who want to use it. A webservice is based on XML standards and has been implemented by different vendors like IBM, Sun Microsystems, CapeClear [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 10pt;">By Vijay Cinnakonda</span></p>
<p><span style="font-size: 10pt;">A webservice in general is a way of exposing the properties and methods through the Internet In other words, it&#8217;s an URL-addressable resource that programmatically returns information to clients who want to use it. A webservice is based on XML standards and has been implemented by different vendors like IBM, Sun Microsystems, CapeClear etc. Currently there is no official body, such as the W3C who have under taken the job of defining this fast evolving technology. Webservices have been foreseen as the future of computing over the web and are more pronounced in the .NET framework owing to its ease in development as well as consumption with or even without VisualStudio.NET. A webservice works on Simple Object Access Protocol (SOAP). Every call to the webmethod from the client&#8217;s machine is sent in the form of a SOAP envelope and result from the server is sent back in SOAP containing the result.</p>
<p>The facility of language interoperability that .NET offers within its Common Language Runtime (CLR) offers a new dimension to using webservices. Owing to these attractive features, .NET is predicted to take command of the client side computing market in the years to come. We can for sure get a feel on the nature of computing where you could develop and use applications in languages of your choice, at least in .NET environment.</p>
<p>In this article I plan to elaborate more on this aspect by<br />
Developing a simple webservice in a normal text editor in C#.<br />
Consuming the webservice described above through a console application written in VB.NET.</p>
<p>Although the application might seem complicated, it is fairly simple to achieve this objective. For the sake of better understanding, I have illustrated simple and straightforward examples. Let&#8217;s march in to out first step of our objective.</p>
<p>Creating a simple Webservice in C#<br />
The webservice application provides a Web Method called Add, which takes in two integers as parameters and returns their sum as integer. The following code is typed in a simple text editor.</p>
<pre>using System;
using System.Web.Services;

public class sumThis:WebService
{
	[WebMethod]
	public int Add(int a,int b)
	{
		int sum;
          sum=a+b;

		return sum;
	}
}</pre>
<p>Note: MSDN documents imply that although language interoperability is supported within the .NET platform, it is advisable to use attributes like the ones described below to ensure type compliancy detection at compile time. In other words, these attributes help identify the types that are not recognized by the CTS at compile time. These attributes need to be included in the program prior to declaration of the class in the program.</p>
<pre>//optional attributes to ensure type compliancy
// Assembly marked as compliant.
[assembly: CLSCompliantAttribute(true)]
// Class marked as compliant.
[CLSCompliantAttribute(true)]</pre>
<p>Few pointers that one must pay attention to while developing a web service are:<br />
The file must be saved as filename.asmx. The file can be checked for its proper syntax and its construct by opening it in a web browser.<br />
It is not necessary to compile the web service (.asmx) file.<br />
In case of developing a webservice in VB.NET one must use the construct instead of the regular construct [WebMethod] used in C#.<img src="http://www.csharphelp.com/archives/files/archive155/1.jpg" alt="" /></p>
<p>View of sumThis webmethod in the browser</p>
<p>If we were to use the webservice in a client&#8217;s machine, we need to create a proxy class or more commonly called stub file. The proxy class contains the details of the web method, the server it is contained in etc. This proxy class can be generated on the client&#8217;s machine by using the utility WSDL.exe which is packaged along with .NET SDK (Beta 2).</p>
<p>Consuming the Webservice in a Client&#8217;s machine using VB.NET</p>
<p>One of the highlights of this utility is one can generate the stub file by just specifying the ip address or the hostname that contains the web service. At the command prompt, the stub file can be generated as</p>
<p>WSDL http://[hostname of server] or [ip address of server] [/n:[namespace to be used in client's machine]] [/l: [language of proxy/C#]] /out:[output file name[.cs/.vb]]</p>
<p>My compilation string for the webmethod sumThis was</p>
<p>wsdl http://ora08.st.utoledo.edu/vijay/webservice/addService.asmx /n:myNamespace /l:vb /out:vbAddWebservice.vb</p>
<p><img src="http://www.csharphelp.com/archives/files/archive155/2.jpg" alt="" /></p>
<p>There are a other switches in the command which can be explored by issuing<br />
WSDL /? at command prompt. We can inspect the output file for more details on the WebMethod.</p>
<p>Once the output file is obtained, we have to compile it using appropriate compiler to produce a DLL file (in my case the VB.NET&#8217;s compiler).</p>
<p>vbc /t:library /r:System.dll,System.web.services.dll,System.xml.dll vbAddWebService.vb</p>
<p>Note: The VB.NET compiler needs to be given the reference of System.dll too, which is not so in the case of C# compiler.</p>
<p>Now we are all set to create a client&#8217;s application that can access the webmethod Add defined in the webservice. In this example, the client application I conceived of is a simple console application written in VB.NET. The code for the application is as follows:</p>
<pre>Imports System
'import the namespace assigned in WSDL compilation
Imports myNamespace

Module Module1
  Sub Main()
      'instantiating a object of the webservice

  Dim ob As New sumThis

       'Ask the user to input two value to add up
      Console.WriteLine("***ENTER TWO INTEGERS TO ADD***")
        Console.Write("FIRST INTERGER :")
        'inputing the values in variables
        Dim var1,var2 As Integer
        var1=Integer.Parse(Console.ReadLine())
        Console.Write("SECOND INTERGER :")
        var2=Integer.Parse(Console.ReadLine())

        'Obtain the answer and display
        Console.WriteLine("The Sum of {0} and {1} is {2}" var1,  var2,ob.Add(var1,var2))

  End Sub
End Module</pre>
<p>Compile the above application at the command prompt asvbc /r:vbAddWebservice.dll,system.dll,system.web.services.dll,system.xml.dll testerCalc.vb</p>
<p><img src="http://www.csharphelp.com/archives/files/archive155/3.jpg" alt="" /></p>
<p>Test the application as a normal console application. And voila, we have an application that can communicate to a method from another server written in language different than that of the client&#8217;s development language, albeit on the same platform.</p>
<p><img src="http://www.csharphelp.com/archives/files/archive155/4.jpg" alt="" /></p>
<p>One can similarly develop and use webservices with ease in Visual Studio.NET. This example was intended to make clear that webservices could be used in simple console and other command line utilities with ease as any other application.</p>
<p>References:</p>
<p>1.	Professional C# by Simon Robinson et al.<br />
2.	Create and Deploy a web service using C# Rajadurai P (csharphelp.com).<br />
3.	Professional ASP.NET by Richard Anderson et al.<br />
4.	MSDN Documentation from http://msdn.microsoft.com/net.<br />
5.	www.gotdotnet.com<br />
6.	www.webservices.org</p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csharphelp.com/2007/11/webservices-with-language-interoperability-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SOAP, .NET, and COM &#8211; an Introduction</title>
		<link>http://www.csharphelp.com/2007/04/soap-net-and-com-an-introduction/</link>
		<comments>http://www.csharphelp.com/2007/04/soap-net-and-com-an-introduction/#comments</comments>
		<pubDate>Wed, 25 Apr 2007 04:01:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C# Language]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.csharphelp.com.php5-3.dfw1-2.websitetestlink.com/?p=524</guid>
		<description><![CDATA[SOAP is a protocol specification to invokemethods on servers, services, components and objects. The availableprocedure of using XML and HTTP as a method invocation mechanism isimplied by SOAP. A small number of HTTP headers that facilitatefirewall/proxy filtering are authorized by the SOAP specification. TheSOAP specification also mandates an XML vocabulary that is used torepresent method [...]]]></description>
			<content:encoded><![CDATA[<p><span class="smallblack">SOAP is a protocol specification to invokemethods on servers, services, components and objects. The availableprocedure of using XML and HTTP as a method invocation mechanism isimplied by SOAP. A small number of HTTP headers that facilitatefirewall/proxy filtering are authorized by the SOAP specification. TheSOAP specification also mandates an XML vocabulary that is used torepresent method parameters, return values, and exceptions.</span></p>
<p><span class="smallblack">To exchange structured and typed informationbetween peers in a decentralized, distributed environment using XML,SOAP presents an uncomplicated mechanism. SOAP defines a simplemechanism for expressing application semantics by providing a modularpackaging model and encoding mechanisms for encoding data withinmodules instead of defining any application semantics such as aprogramming model or implementation specific semantics. This allowsSOAP to be used in a large variety of systems ranging from messagingsystems to RPC.</span></p>
<p><span class="smallblack"><span style="text-decoration:underline;">An Overview to SOAP</span></span></p>
<p><span class="smallblack">SOAP, (the Simple Object Access Protocol), isXML syntax to exchange messages. Moreover, since it is XML, it isindependent from both language and platform. In addition, SOAP is afundamental part of .NET, Microsoft&#39;s new development platform, and tounderstand what SOAP is and how it works it will be important fordevelopers to move towards .NET.</span></p>
<p><span class="smallblack">In SOAP, there are four parts:</span></p>
<p><span class="smallblack">[<a href="http://www.csharphelp.com/archives3/files/archive542/Soap.zip">Continued</a>]</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csharphelp.com/2007/04/soap-net-and-com-an-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Services Architecture</title>
		<link>http://www.csharphelp.com/2006/12/web-services-architecture/</link>
		<comments>http://www.csharphelp.com/2006/12/web-services-architecture/#comments</comments>
		<pubDate>Tue, 19 Dec 2006 04:01:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.csharphelp.com.php5-3.dfw1-2.websitetestlink.com/?p=397</guid>
		<description><![CDATA[We canunderstand without difficulty why Web Services are produced if we lookat the computer and software worlds. There are many systems andplatforms out there on the Internet and there are even moreapplications that living on these systems and platforms. If we needmore explanation about this, there are many technologies out there toconnect clients to servers, [...]]]></description>
			<content:encoded><![CDATA[<p class="CO" style="margin:6pt 0in;"><span class="smallblack">We canunderstand without difficulty why Web Services are produced if we lookat the computer and software worlds. There are many systems andplatforms out there on the Internet and there are even moreapplications that living on these systems and platforms. If we needmore explanation about this, there are many technologies out there toconnect clients to servers, including DCOM, CORBA and others and WebServices growing on a new and much simpler type of connectivity, basedon open standards such as HTTP, XML and SOAP.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Simply,we can imagine, Web Services a component whose methods you can invokeusing an internet or intranet connection or a Web Service is acomponent that exposes its interface via Web. Web Services build on therecognition of XML in the open arena. Web Services use XML as the wayfor serializing data to receive from, or return to the client. A clientthat can parse XML can use the data returned, even the client and theWeb Service host are using the different operating system, or theapplications are developed with the different programming language. Wewill discuss on Web Services more lately in this article. Let us lookto full story.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">WebServices are not necessarily will replace component development;components make a lot of sense in an intranet solution where theenvironment is controlled, and it does not make sense to escape purelyinternal objects through a less efficient web service interface. WebServices make interoperating easy and effective, but they are not asfast as a binary proprietary protocol such as DCOM. The problem withcomponents was facing when distributing them across the Internet. Inthis article, I assume that you have the knowledge of distributedcomponent technology and basic knowledge of middle-tier programming.</span></p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;">A Short History to &lt;st1:city&gt;&lt;st1:place&gt;Enterprise&lt;/st1:place&gt;&lt;/st1:city&gt; Programming Model</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Theenterprise environment in which present companies now find themselveshas undergone major change over the last few decades. As USA and globalmarkets have opened up, so war has start, and in order to survive,companies have to make better and improved use of the tools at theirarea. In the early days of software world in the workplace,applications were confined to single computers, greatly limiting theproblem domain that they could operate in. Many early desktop solutionsrelied on local copies of the company?s databases being stored on eachcomputer, where they would be accessed and manipulated separately. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">As thetechnology improved, and applications became more sophisticated,solutions to this arrangement started to appear based on an onlinecentral database accessed over a network. Often, the workload ofperforming the tasks requested by users is shared between the desktopmachines and the servers. This model knowing as distributed computing.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Manyrecent enterprise solutions cover several distributed applications,where the workload is shared between client and server according to theenvironment of the task and the power of the client machine. Theseapplications, running on fast local networks, are prepared to beextended to provide access through the Internet. The Client-Server termis a little primitive for the networked systems establish in today?sworld of business, but the principal notion of a separation betweenclient and server is still applicable. Many such applications can stillbe thought of as client-server, although their original model is moresophisticated, such as the n-tier arrangement.</span></p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;">&lt;st1:city&gt;&lt;st1:place&gt;Enterprise&lt;/st1:place&gt;&lt;/st1:city&gt; Application Integration Architecture</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">EAIbuilds on proven middleware techniques such as message brokering anddata transformation, and introduces architectural components calledadapters for communication with applications and other data sources.EAI also incorporates business process modeling and workflow, metadatamanagement, security and system administration, and monitoring. Workingin concert, this set of services provides a robust environment forintegrating disparate applications within and across enterprises.</span></p>
<p><span class="smallblack"><img src="http://www.csharphelp.com/archives2/files/archive414/pic1.jpg" alt="" /></span></p>
<p>&nbsp;</p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;"><span>&nbsp;</span>&lt;st1:city&gt;&lt;st1:place&gt;Enterprise&lt;/st1:place&gt;&lt;/st1:city&gt; Distributed Computing</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Insteadof running on a single computer, large-scale systems execute on anumber of different machines. One simple reason is to distributeprocessing. Other reasons for distributing functionality amongdifferent physical machines include the ability to separateuser-interface functionality from business logic, increase systemrobustness, and add security features. By separating user-interfacefunctionality from business logic, you can more easily partitionuser-interface development from business logic. This makes developmentand management of the code much easier. Once you have developed yourbusiness logic, you can reuse it later. For example, two differentuser-interface applications can make use of the same business logicwithout changes to the business-logic code.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Robustnessis another important reason for separating the user interface from theback-end business logic. In a client/server application, the server mayservice hundred clients. If one of these clients causes a generalprotection fault, it should not affect the execution of the server orthe other ninety-nine clients. In addition, when you split up userinterface, business, and data logic, you may add security features toyour system. For instance, your server can provide securityfunctionality that authenticates the client each time it connects tothe server. You can even add security logic to authorize everysubsequent request that the authenticated client sends. These reasonsmake distributed computing very elegant. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Thereare very benefits to this model, as we have seen from the substantialincrease in internet companies and internet/intranet applications inthe last few years. </span></p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;">Component Technology</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Allthese mean, that the distributed computing uprising was taking place,importance of component technology was also rising. The idea supportsthis technology was interface based programming. A component wouldpublish a particular interface that could be used to interact with it.This interface was a contract that was guaranteed to remain in place.Other developers could, develop using these interfaces; confident thatfuture changes to the component would not break their code.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Thecomponent interfaces were in a binary standard, giving developers thechoice to use different programming languages for the component and theclient. COM/DCOM and CORBA have done very well in this arena.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class</p>
<p>="smallb<br />
lack">On theother hand, Web Services are not necessarily going to replace componentdevelopment. Components make a lot of sense in an intranet solutionwhere the environment is controlled, and it does not make sense toexpose purely internal objects through a less efficient web serviceinterface. Web Services make interoperating easy and effective, butthey are not as fast as a binary proprietary protocol such as DCOM.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Distributedobject computing extends an object-oriented programming system byallowing objects to be distributed across a heterogeneous network, sothat each of these distributed object components interoperate as aunified total. These objects may be distributed on different computersthroughout a network, living within their own address space outside ofan application, and yet appear as though they were local to anapplication. <span style="font-family:&#39;Times New Roman&#39;;">&lt;o:p&gt;&lt;/o:p&gt;</span></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Three of the most popular distributed object paradigms are Microsoft&#39;s <span>Distributed Component Object Model (DCOM)</span>, OMG&#39;s <span>Common Object Request Broker Architecture (CORBA)</span> and JavaSoft&#39;s <span>Java/Remote Method Invocation (Java/RMI)</span>.Now we will have some more information about COM/DCOM, COM+ and CORBAfor clean understand component and distributed programming techniques.</span></p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;">COM/DCOM, COM+</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Component-baseddevelopment has become the software concept, with its own conferences,magazines, and consultants. However, the original component technology,and the one that is by far the most widely used, is Microsoft&#39;sComponent Object Model (COM). Introduced in 1993, COM is now a maturefoundation for component-based development, and it is the rareapplication for Windows and Windows NT that does not use COM in someway. With its integrated services, and its excellent tool support fromMicrosoft and others, COM makes it easy to develop powerfulcomponent-based applications.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Fromits original application on a single machine, COM has expanded to allowaccess to components on other systems. Distributed COM (DCOM),introduced in 1996, makes it possible to create networked applicationsbuilt from components. Available on various versions of UNIX, IBMmainframes, and other systems, DCOM is used today in applicationsranging from innovative medical technology to traditional accountingand human resources systems. Once a bleeding edge technology,distributed components have gone mainstream, and the primarytechnologies enabling this are COM and DCOM.</span></p>
<p class="BT" style="margin:6pt 0in;"><span lang="EN"><span class="smallblack">A <span>COM server</span> can create object instances of multiple <i>object classes</i>. A COM object can support multiple <b>interfaces</b>,each representing a different view or behavior of the object. Aninterface consists of a set of functionally related methods. A COMclient interacts with a COM object by acquiring a pointer to one of theobject&#39;s interfaces and invoking methods through that pointer, as ifthe object resides in the client&#39;s address space. COM specifies thatany interface must follow a standard memory layout, which is the sameas the C++ virtual function table. Since the specification is at thebinary level, it allows integration of binary components possiblywritten in different programming languages such as C++, Java and VisualBasic. &lt;o:p&gt;&lt;/o:p&gt;</span></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Theevolution of Microsoft component services continues with COM+. Byenhancing and extending existing services, COM+ further increases thevalue these services provide. COM+ includes: &lt;o:p&gt;&lt;/o:p&gt;</span></p>
<p class="BLSUB" style="margin:6pt 0in 6pt 1in;"><span style="font-family:Symbol;"><span><span class="smallblack">?<span style="font-family:&#39;Times New Roman&#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span><span class="smallblack"><b>A publish and subscribe service</b>- Provides a general event mechanism that allows multiple clients to&quot;subscribe&quot; to various &quot;published&quot; events. When the publisher fires anevent, the COM+ Events system iterates through the subscriptiondatabase and notifies all subscribers. &lt;o:p&gt;&lt;/o:p&gt;</span></p>
<p class="BLSUB" style="margin:6pt 0in 6pt 1in;"><span style="font-family:Symbol;"><span><span class="smallblack">?<span style="font-family:&#39;Times New Roman&#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span><span class="smallblack"><b>Queued components</b>- Allows clients to invoke methods on COM components using anasynchronous model. Such as model is particularly useful in onunreliable networks and in disconnected usage scenarios. &lt;o:p&gt;&lt;/o:p&gt;</span></p>
<p class="BLSUB" style="margin:6pt 0in 6pt 1in;"><span style="font-family:Symbol;"><span><span class="smallblack">?<span style="font-family:&#39;Times New Roman&#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span><span class="smallblack"><b>Dynamic Load balancing</b> &#8211; Automatically spreads client requests across multiple equivalent COM components. &lt;o:p&gt;&lt;/o:p&gt;</span></p>
<p class="BLSUB" style="margin:6pt 0in 6pt 1in;"><span style="font-family:Symbol;"><span><span class="smallblack">?<span style="font-family:&#39;Times New Roman&#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span><span class="smallblack"><b>Full integration of MTS into COM</b>- Includes broader support for attribute-based programming,improvements in existing services such as Transactions, Security andAdministration, as well as improved interoperability with othertransaction environments through support for the Transaction InternetProtocol (TIP). &lt;o:p&gt;&lt;/o:p&gt;</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">COM+builds on what already exists?it is not a revolutionary departure.Microsoft component services provide an infrastructure for buildingenterprise applications, and enterprises seldom welcome revolutions intheir infrastructure. However, software technology cannot stand still.The goal, then, must be to provide useful innovations that make iteasier to create great applications without disrupting what is alreadyin place. By extending and further unifying the existing componentservices, COM+ does exactly this.&lt;o:p&gt;&lt;/o:p&gt;</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Takenas a whole, Microsoft component services provide a powerful, flexible,and easy-to-use platform for building distributed applications. Nothingelse available offers the same level of integration, broad toolsupport, and solid services.</span></p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;">CORBA</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span lang="EN"><span class="smallblack">Youmay read this on several CORBA articles; CORBA is a distributed objectframework proposed by a consortium of hunderds companies called theObject Management Group (OMG). The core of the CORBA architecture isthe <span>Object Request Broker (ORB)</span> tha</p>
<p>t acts as theobject bus over which objects transparently interact with other objectslocated locally or remotely. A CORBA object is represented to theoutside world by an interface with a set of methods. A particularinstance of an object is identified by an object reference. The clientof a CORBA object acquires its object reference and uses it as a handleto make method calls, as if the object is located in the client&#39;saddress space. The ORB is responsible for all the mechanisms requiredto find the object&#39;s implementation, prepare it to receive the request,communicate the request to it, and carry the reply if any back to theclient. The object implementation interacts with the ORB through eitheran <span>Object Adapter (OA)</span> or through the ORB interface. &lt;o:p&gt;&lt;/o:p&gt;</span></span></p>
<p class="BLSUB" style="margin:6pt 0in 6pt 1in;"><span style="font-family:Symbol;"><span><span class="smallblack">?<span style="font-family:&#39;Times New Roman&#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span><span class="smallblack">CORBA objects can be located anywhere on a network. </span></p>
<p class="BLSUB" style="margin:6pt 0in 6pt 1in;"><span style="font-family:Symbol;"><span><span class="smallblack">?<span style="font-family:&#39;Times New Roman&#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span><span class="smallblack">CORBA objects can interoperate with objects written on other platforms. </span></p>
<p class="BLSUB" style="margin:6pt 0in 6pt 1in;"><span style="font-family:Symbol;"><span><span class="smallblack">?<span style="font-family:&#39;Times New Roman&#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span><span class="smallblack">CORBA objects can be written in any programming language for which there is a mapping from IDL to that language. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack"><a name="b"></a>Developersuse CORBA to distribute applications across client-server,peer-to-peer, 3-tier, n-tier, Internet/Intranet etc. networks. Insteadof having hundreds of thousands of lines of code running on mainframecomputers with dumb terminals, smaller, more robust applications thatcommunicate between file servers and workstations are now necessary. <span>Tokeep this distribution of applications simple, a plug-and- playarchitecture is necessary to distribute the client-server (CS)applications</span>. Although the computing trend seems to be towardsthe peer-to-peer computing. The developer then can write apps that workindependently across various platforms and diverse networks. The <span>idea behind CORBA is a software intermediary that handles and disperses access requests on data sets</span>. This intermediary is referred to as an <span>Object Request Broker (ORB)</span>.The ORB interacts and makes requests to differing objects. It sits onthe host between the data and the application layer (that is, one levellower than the application layer (level 7 in the OSI model). An ORBnegotiates between request messages from objects or object servers andthe affiliated data sets.</span></p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;">Limitation of DCOM and CORBA</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Perhaps,we can talk about all other distributed object technologies such asSun?s RMI (Remote Method Invocation) protocol. However, this article?sobjective is not talk all detail about existing technologies.Therefore, we choose two strongest alternatives to discuss what theproblem on existing gear was. In that case, let us talk about why weneed a new technology. Unfortunately, existing technologies have somecruel limitations that have dissatisfied or at least more complex,several existing projects. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Thebiggest problem about DCOM and CORBA were both are platform specific.Both were not easy integrating with each other. You may create a kindof bridge that process translates messages from one to other. However,this system already has some difficulty because of DCOM and CORBAfunctionality, data types etc. An important key barrier iscommunication over the Internet. The distributed communicationtechnologies described earlier have a symmetrical requirement, meaningthat both ends of the communication link would typically need to haveimplemented the same distributed object model. In Internet, nobody canpromise that both ends of the communication link will have implementedthe same distributed object model. Promising this on the Internet isrisky and normally just impossible. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Anotherissue about limitation is Firewalls and Proxy servers. DCOM and CORBAare not firewall and proxy friendly. Both architectures typically forcethem to listen to port numbers, which this is may not be withoutproblems or usually known. The challenge with proxy servers is thatclients using these protocols typically require having a directconnection to the server. In general, firewalls does not givingpermission (in case of security) keeps open many ports, except someusually used ones. For instance, these ports are HTTP and SMTP.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Furthermore,as CORBA and DCOM are respectable protocols, the business world has notyet moved completely to one in exacting. All sides pointing out theother?s shortcoming mark the lack of worldwide commerce recognition.With other words, some models, for example DCOM, CORBA as well as RMIfor Java, work very well in an intranet environment. These technologiesprovide components to be invoked over network connections, as a result,make possible distributed application development. In a pureenvironment each of these works well, but interoperating with the otherprotocols, none is very successful. For example, using DCOM, Javacomponents cannot be called, and COM objects cannot be invoked usingRMI. Attempting to use these technologies over the Internet presentseven more difficulty. Firewalls often block access to the requiredTCP/IP ports, and because they are proprietary formats both the clientand server must be running compatible software.</span></p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;">An Architectural Overview to Web Services</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Althoughthis time we talked about several issues about Web Services also talkedabout is the Web Services shortly. One of the most important rewards ofthe XML Web services architecture is that it allows programs developedin different programming languages on different platforms tocommunicate with each other in a standards-based technique. There aretwo different methods to work with Web Services; to allow access tointernal system functionality, exposing them to the outside world andas a client, or consumer of external Web Services. In this model, WebServices are used to access functionality from any tier in anapplication. This provides the possible of any distributed systemexposed on the Internet to be incorporated into a custom application.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Ingeneral, the architecture of a Web Service divided into five logicallayers such as Data Layer, Data Access Layer, Business Layer, BusinessFa?ade and Listener. The Listener is nearest to client, and the layerfurthest from the client is the data layer. The business layer isfurther divided in to two sub layers named Business logic and</p>
<p> Businessfa?ade (this mean is an elevation at front side). Any physical datathat the Web Service requires is stored in the data layer. Above thedata layer is the data access layer, which presents a logical vision ofthe physical data to the business logic. The data access layer isolatesbusiness logic from changes to the underlying data stores and ensuresthe integrity of the data. The business fa?ade provides a simpleinterface, which maps directly to operations exposed by the WebService. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Businessfacade block is constantly used to provide a dependable interface tothe underlying business objects and to isolate the client from changesto the underlying business logic. When it is present, it liveswhichever involving the client and the business logic or involving theWeb service projects and the business logic layers. </span></p>
<p><span class="smallblack"><img src="http://www.csharphelp.com/archives2/files/archive414/pic2.jpg" alt="" /></span></p>
<p>&nbsp;</p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Thebusiness logic layer provides services for the business fa?ade?s use.All the business logic might be implemented by the business fa?ade in asimple Web Service, which would interact directly with the data accesslayer. Web Service client applications interact with the Web Servicelistener. The listener is responsible for receiving incoming messages,which contain requests for services, parsing the messages, anddispatching the requests to the appropriate methods in the businessfa?ade.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">This architecture is very similar to the <i>n</i>-tierapplication architecture defined by Windows DNA. The Web Servicelistener is equivalent to the presentation layer of a Windows DNAapplication. The listener is responsible for packaging the responsefrom the business fa?ade into a message and sending that back to theclient, if the service returns a response. The listener also handlesrequests for Web Service contracts and other documents about the WebService. By adding a Web Service listener parallel to the presentationlayer and providing it the access to the existing business fa?ade, itis easy to migrate a Windows DNA application to a Web Service. Whileweb browser clients can continue to use the presentation layer webService client applications will interact with the listener.<span>&nbsp; </span></span></p>
<p class="BT" style="margin:6pt 0in;">&lt;o:p&gt;<span class="smallblack">&nbsp;</span>&lt;/o:p&gt;</p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;">Web Services Stack</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">We canstart to talk with HTTP (HyperText Transfer Protocol); with thiscommunication protocol, it is possible to send information from onepoint on the Internet to another point. The information that is sentover the wire can be structured by using XML (eXtensible MarkupLanguage). The XML protocol defines the format and the semantics of theinformation. XML is a fundamental foundation for the later layers. SOAP(Simple Object Access Protocol) is a protocol that defines how toinvoke function calls from objects that live in different environments.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Duringusing SOAP, it is possible to defeat problems that are move up whentrying to integrate different operating systems, object models, andprogramming languages. With SOAP, it turns into possible for the firsttime to easily integrate different category of business processes. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">HTTP,XML, and SOAP can be seen as the core layers for Web Services. Theselayers define how Web Services have to interact with each other. Thesethree protocols have been accepted by the W3C (World Wide WebConsortium, http://www.w3.org/) as standards. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Theprotocol WSDL (Web Services Description Language) describes how tocommunicate with a Web Service. In the WSDL definition, different typesof communication (bindings) are allowed. Its one thing to havedeveloped a Web Service, but it is another to earn money with it aswell. In order to do this, we need a central market place where we canpublish our Web Service, so other parties can find it and use it. Thisis where UDDI (Universal Description, Discovery and Integration) comesin. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">WebServices technology can be generally classified into three keyassemblies, Description Stack, Discovery Stack and Wire Stack. Thedescription stack deals with a wide range of technologies that describeWeb Services in order to facilitate their common use for businessprocess modeling and workflow composition in B2B relationships. Thediscovery stack deals with technologies that allow for directory,discovery, and inspection services. The wire stack consists oftechnologies that provide the steam for the runtime engines of WebServices.</span></p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;">Building Blocks</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Let usstart like this; Web Services are building blocks for constructingdistributed Web-based applications in a platform, object model, andMultilanguage manner. Web Services are based on open Internetstandards, such as HTTP and XML, and form the basis of Microsoft&#39;svision of the programmable Web. What are the ?Building Blocks? SOAP,WSDL and UDDI.</span></p>
<p class="H4" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><em><span style="font-size:x-small;">SOAP</span></em></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Let?s, we will put general information over SOAP as a fundamental building block of Web Services.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">SOAP isa standard way of serializing that the information needed to invokeservices located on remote systems as a result, which the informationcan be sent over a network to the remote system in a format the remotesystem can understand, regardless of what platform the remote serviceruns on or what language it is written in. Fundamentally, SOAP is anXML-based protocol that is designed to exchange structured and typedinformation on the Web. SOAP can be used in combination with a varietyof existing Internet protocols and formats including HTTP, SMTP, andMIME and can support a wide range of applications from messagingsystems to RPC.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">SOAPaddresses the issue of passing information to and from remoteapplications through firewalls.&nbsp; Firewalls, as the paper points out,often prohibit remote communication through ports other than somepredefined, well-known ports, reserved for a specific purpose.&nbsp; Thisbecomes an issue as most distributed protocols do not use assignedports, but dynamically select them.&nbsp; The solution, as implemented byMicrosoft&#39;s SOAP technology, is to pass a call to a remote processthrough port 80, the port assigned for HTTP traffic.&nbsp; The remote callsare attached on top of the HTTP protocol using XML to define the formatof the request or response messages. Among the advantages of thistechnology is clearly the ease at which firewall complications can beavoided.&nbsp; Cross platform compatibility also comes to mind, althoughthis wasn&#39;t discussed beyond a passing comment in the article.&nbsp; Adrawback might be in some inefficiency as port 80 is a commonly usedport used for all web traffic through the server.&lt;o:p&gt;&lt;/o:p&gt;</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">SOAPhas been developed to solve an aging problem with developingapplications for the Internet: interoperability. Imagine a world whereyou can access objects and services on remo</p>
<p>te (or local) servers in aplatform-independent manner. Today?s world is infected with differentoperating systems, different firewalls, different methods of makingremote procedure calls, and different platforms. In order tointeroperate across the Internet both the client and server need tounderstand each others security types and trusts, service deploymentschemas, and implementation details, not to mention speak the sameplatform language (e.g. COM to COM, ORB to ORB, EJB to EJB, etc.). <span>&nbsp;</span>WithSOAP, an end to all of this platform-specific confusion has arrived.Based on the already industry wide accepted IETF HTTP standard and W3CXML standard, SOAP bridges the opening between competing object RPCtechnologies and provides a light-weight messaging format that workswith any operating system, any programming language, and any platform. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">There are three main parts in the SOAP architecture.<span style="font-family:Arial;">&lt;o:p&gt;&lt;/o:p&gt;</span></span></p>
<p class="BLSUB" style="margin:6pt 0in 6pt 1in;"><span style="font-family:Symbol;"><span><span class="smallblack">?<span style="font-family:&#39;Times New Roman&#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span><span class="smallblack">An envelope that describes the contents of a message and how to process it. </span></p>
<p class="BLSUB" style="margin:6pt 0in 6pt 1in;"><span style="font-family:Symbol;"><span><span class="smallblack">?<span style="font-family:&#39;Times New Roman&#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span><span class="smallblack">A set of encoding rules for expressing instances of application-defined datatypes. </span></p>
<p class="BLSUB" style="margin:6pt 0in 6pt 1in;"><span style="font-family:Symbol;"><span><span class="smallblack">?<span style="font-family:&#39;Times New Roman&#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span><span class="smallblack">A convention for representing remote procedure calls and responses. </span></p>
<p class="BT" style="margin:6pt 0in;">&lt;o:p&gt;<span class="smallblack">&nbsp;</span>&lt;/o:p&gt;</p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Simplydeclared, SOAP provides a technique to access services, objects, andservers in a completely platform-independent mode. By SOAP, you willcapable of query, invoke, communicate with, and otherwise handleservices provided on remote systems without regard to the remotesystem?s location, operating system, or platform. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">SOAP byitself provides a way to exchange messages with Web Services, but itdoes not provide a way to find out what messages a Web Service mightwant to exchange. It also, does not give you any way of finding WebServices or negotiating with them. &lt;o:p&gt;&lt;/o:p&gt;</span></p>
<p class="H4" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><em><span style="font-size:x-small;">WSDL&lt;o:p&gt;&lt;/o:p&gt;</span></em></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">The WebServices Description Language (WSDL) along with SOAP, form theessential building blocks for Web Services. WSDL is an XML-based formatfor describing Web Services. It describes which operations Web Servicescan execute and the format of the messages Web Services can send andreceive. A WSDL document can be consideration of as a contract betweena client and a server. With WSDL-aware tools, you can also automatethis process, enabling applications to simply integrate new serviceswith little or no manual code. WSDL therefore represents a cornerstoneof the web service architecture, because it provides a common languagefor describing services and a platform for automatically integratingthose services.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Whilemost WSDL documents are used in RPC-style request/response pairs, WSDLas well supports one-way messages. WSDL supports the same four types ofoperations that SOAP messages accomplish that request-response,solicit-response, one-way, and notification.</span></p>
<p class="H4" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><em><span style="font-size:x-small;">UDDI</span></em></strong></span></p>
<p><span class="smallblack">UDDI <span class="BTChar"><span style="font-size:11pt;">(Universal Description, Discovery, and Integration</span></span><span style="font-size:11pt;font-family:&#39;New York&#39;;">)</span> is the building block that will enable businesses to quickly, easily and dynamically find and transact <span class="BTChar"><span style="font-size:11pt;">businesswith one another using their preferred applications. With differentway, UDDI is an XML-based registry for businesses worldwide to listthem on the Internet. Its ultimate goal is to streamline onlinetransactions by enabling companies to find one another on the Web andmake their systems interoperable for e-commerce. UDDI is often comparedto a telephone book&#39;s white, yellow, and green pages. The projectallows businesses to list themselves by name, product, location, or theWeb services they offer.</span></span><span style="font-size:10pt;font-family:Arial;"> &lt;o:p&gt;&lt;/o:p&gt;</span></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">TheUDDI focus is on providing large organizations the means to reach outto and manage their network of smaller business customers. The biggestissues facing UDDI are ones of acceptance and buy-in from businessesthemselves, and implementation issues of scalability and physicalimplementation.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">TheUDDI Consortium, established by hundreds of companies, emerged inresponse to a series of challenges posed by the new Web Services model.These challenges included the how do you discover Web Services, howshould information about Web Services be categorized. These challengesalso included how do you handle the global nature of Web Services, howdo you provide for localization and how can interoperability beprovided, both in the discovery and invocation mechanisms. In addition,it included how you could interact with the discovery and invocationmechanisms at runtime.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Infavor of UDDI to provide the foundation for Web Services registries,therefore, it had to serve two primary roles within the Web Servicesmodel such as Service publication and service discovery. </span></p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;">Describing Web Services</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">We justtalk about WSDL, now we will discuss describing Web Services as anintroduction. We will not go deeply issues in this article, becausethis article already considering you have minimum more than beginnerinformation.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">DescribingWeb Services needs a language such as WSDL. Since SOAP?s conception,the designers planned for it to support a type system the one theychose was XML Schema. The SOAP specification enables you to describetype information in one of two manners. The first way relies on the useof the xsi: type attribute within your SOAP messages. In this manner,each message can be self-describing so that the receiving endunderstands how to interpret the message parameters and theirassociated types. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Thesecond manner enables the sender and receive</p>
<p>r to rely on some from ofschema to be referenced from an external but unspecified source. Inthis manner, the sender and the receiver are interacting based on awell-defined contract of types.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">An XMLschema alone does not inform all the information that we needconcerning a Web Services. However, SOAP serialization is troubled, andXML schema datatype is sufficient. On the other hand, other feature toWeb Services need to be addressed therefore, WSDL was created.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">WSDL isan XML language, which uses several layers of abstraction to describeWeb Services in a modular technique. Furthermore, WSDL has a vocabularythat enables us to create independent datatype definitions, abstractmessage definitions, and service definitions. After they are defined,the abstractions can be bund to concrete message formats, transportprotocols, and endpoints to complete the overall package.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Essentially,WSDL defines an XML grammar that describes Web Services as collectionsof communications endpoints that are able to exchange messages witheach other. However, the Microsoft implementation requires another fileto map the invoked Web Service operations to COM object method calls.This additional file is expressed in the Web Services Markup Language(WSML), which is Microsoft?s proprietary language for this particularpurpose. Besides, the Microsoft SOAP Toolkit generates WSML filesautomatically.</span></p>
<p class="H3" style="margin:0in 0in 0pt;"><span class="smallblack"><strong><span style="font-size:x-small;">Publishing Web Services</span></strong></span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Whatdoes mean publishing Web Services? UDDI uses WSDL as a descriptionlanguage. WSDL documents can be organized as service implementation andservice interface documents. The service implementation document mapsto the UDDI businessService element, while the service interfacedocument maps to the tModel elements. The first step in publishing aWSDL description in a UDDI registry is publishing the service interfaceas a tModel in registry.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;o:p&gt;&lt;/o:p&gt;</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">TheUDDI registry is not only run by Microsoft also IBM and Ariba are alsocontrolling repositories. This means that if we post information withone, then it is replicated on all databases held by those companies.Each of the independent repositories have the same interface to giveany outside organization or individual the opportunity to postinformation to UDDI using the UDDI Publish Web Service and search UDDIusing the UDDI Inquire Web Service.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Oncethe tModel has been published, businesses that wish to provide servicesas defined in the tModel implement Web Services based on the WSDLdefinition. These services are accessible through a URL, and businessesthen publish this information in the UDDI registry ? the service URL iscontained in the Binding Template of the service that the businesspublishes.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">ThePublishing allows several activities such as registration of newbusiness and services, deletion of existing services of businesses andmanagement of security on the business data. The Publisher API isintended for software programmers or Independent Software Vendors whowould like to publish their web services to a UDDI node. </span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">UDDIdata structure has two functions that they named save and delete. Thesefunctions from the Publication API that allows the user to modifyexisting entries in the registry and create new ones by using the savefunctions. The delete functions completely remove the given datastructure. This API is used primarily as a means of creating andupdating business and service information that the end user isauthorized to modify.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Althoughthe UDDI registry allows you to access all the functionally ofpublishing and finding services programmatically through XML and SOAP,IBM and Microsoft supply a Web Interface as well so that you can accessall this functionality from a Web browser.</span></p>
<p class="BT" style="margin:6pt 0in;"><span class="smallblack">Thisarticle only intends to give you a sophisticated overview of WebServices, WSDL, UDDI and related objects to help you to understandfuture articles. You learned how to work a Web Service. You alsoreceived a high-level overview of Web Services Architecture. On theother hand, you had some introduce information about describing andpublishing Web Services. </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csharphelp.com/2006/12/web-services-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Consuming a Web Service in C#</title>
		<link>http://www.csharphelp.com/2006/10/consuming-a-web-service-in-c/</link>
		<comments>http://www.csharphelp.com/2006/10/consuming-a-web-service-in-c/#comments</comments>
		<pubDate>Tue, 24 Oct 2006 04:01:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C# Language]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.csharphelp.com.php5-3.dfw1-2.websitetestlink.com/?p=341</guid>
		<description><![CDATA[&#160; This tutorial teaches you how to &#8220;consume&#8221; a simple web service, Circle24_WorldTime, that allows you to find the time in major cities around the world using C#. This tutorial is for beginners to the C# language, .NET and XML web services and therefore will not go into great detail nor explain in depth how [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:xx-small;"><b><br /></b></span><span class="smallblack"><a href="mailto:bestworldweb@yahoo.co.nz"></a></span></p>
<p>&nbsp;</p>
<p><span class="smallblack">This tutorial teaches you how to &ldquo;consume&rdquo; a simple web service, Circle24_WorldTime, that allows you to find the time in major cities around the world using C#. </span></p>
<p><span class="smallblack">This tutorial is for beginners to the C# language, .NET and XML web services and therefore will not go into great detail nor explain in depth how XML web services work. This also assumes that you do not have Visual Studio.NET. </span></p>
<p><span class="smallblack">Download <a href="http://www.csharphelp.com/archives2/files/archive356/WorldTime.zip">WorldTime.zip</a></span></p>
<p><span class="smallblack">What you need:</span></p>
<p><span class="smallblack">.NET SDK (get it here).</span></p>
<p><span class="smallblack">A text editor (I am using Notepad).</span></p>
<p><span class="smallblack">In this tutorial we will be creating a program that asks the user for the name of a city and then gets the time and date for that city. Here is the output of the completed program:</span></p>
<p><span class="smallblack"><strong>Enter City: New York<br /> 07:01 PM Friday, Jul 12 2002<br /> Press any key to continue . . .</strong></span></p>
<p><span class="smallblack">We will be using a web service called Circle24_WorldTime. The web service has one method called GetTime(string City) of which you pass a string containing the name of a city. If will return the current date and time of that city.</span></p>
<p><span class="smallblack">The fist step is to create a web service proxy. The proxy acts as a &ldquo;mediator&rdquo; between your program and the web service. The proxy is create using a tool called wsdl.exe. This program generates C# code for the WSDL of the web service. First you have to understand what WSDL is.<br /> Here is the official (W3C) explanation:</span></p>
<p><span class="smallblack">&ldquo;WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services). -W3C</span></p>
<p><span class="smallblack">Basically, the WSDL describes the methods that the web service supports and how to access them, hence its name Web Service Description Language</span></p>
<p><span class="smallblack">The address of the WSDL for Circle24_WorldTime is located at http://upload.eraserver.net/circle24/worldtime/worldtime.asmx?WSDL</span></p>
<p><span class="smallblack">To generate the code for the proxy type this into the command line: </span></p>
<p><span class="smallblack"><strong>wsdl http://upload.eraserver.net/circle24/worldtime/worldtime.asmx?WSDL</strong></span></p>
<p><span class="smallblack">if done correctly this should be displayed:</span></p>
<p><span class="smallblack"><img src="http://www.csharphelp.com/archives2/files/archive356/screenshot.gif" width="666" height="330" alt="" /></span></p>
<p><span class="smallblack">Now you need to compile it. Type this into the command line:</span></p>
<p><span class="smallblack"><strong>csc /t:library WorldTime.cs.</strong></span></p>
<p><span class="smallblack">This will create a DLL called WorldTime.dll.</span></p>
<p><span class="smallblack">Now we will start programming. Create a file called Time.cs and add the following code. <br /> NOTE: Time.cs MUST be in the same directory as WorldTime.dll.</span></p>
<p><span class="smallblack">The code:</span></p>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tbody>
<tr>
<td bgcolor="#ffffff" valign="top" width="100%">
<p>&lt;nobr /&gt;</p>
<p>&lt;nobr&gt;<span style="color:#0000ff;">using</span> <span style="color:#000000;">System</span><span style="color:#0000b8;">;</span><br /> <span style="color:#0000b8;"><br /> </span><span style="color:#0000ff;">class</span> <span style="color:#000000;">Time</span><br /> <span style="color:#0000b8;">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">public static void</span> <span style="color:#000000;">Main</span><span style="color:#0000b8;">(</span><span style="color:#0000ff;">string</span><span style="color:#0000b8;">[]</span> <span style="color:#000000;">args</span><span style="color:#0000b8;">)</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000b8;">{</span></p>
<p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#cc9900;"><i>//Create instace of the WorldTime.dll</i></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">WorldTime Time</span><span style="color:#0000b8;">=</span> <span style="color:#0000ff;">new</span> <span style="color:#000000;">WorldTime</span><span style="color:#0000b8;">();</span></p>
<p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#cc9900;"><i>//get input from user</i></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">Console</span><span style="color:#0000b8;">.</span><span style="color:#000000;">Write</span><span style="color:#0000b8;">(</span><span style="color:#000000;"><b>&quot;Enter City: &quot;</b></span><span style="color:#0000b8;">);</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">string</span> <span style="color:#000000;">City</span><span style="color:#0000b8;">=</span><span style="color:#000000;">Console</span><span style="color:#0000b8;">.</span><span style="color:#000000;">ReadLine</span><span style="color:#0000b8;">();</span></p>
<p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#cc9900;"><i>//gets date and time</i></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">string</span> <span style="color:#000000;">DateTime</span><span style="color:#0000b8;">=</span><span style="color:#000000;">Time</span><span style="color:#0000b8;">.</span><span style="color:#000000;">GetTime</span><span style="color:#0000b8;">(</span><span style="color:#000000;">City</span><span style="color:#0000b8;">);</span></p>
<p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#cc9900;"><i>//write the citys time and date</i></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">Console</span><span style="color:#0000b8;">.</span><span style="color:#000000;">WriteLine</span><span style="color:#0000b8;">(</span><span style="color:#000000;">DateTime</span><span style="color:#0000b8;">);</span></p>
<p> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000b8;">}</span><br /> <span style="color:#0000b8;">}</span><br /> &lt;/nobr&gt;</p>
<p>&lt;nobr /&gt;</p>
</td>
</tr>
<tr>
<td align="right" height="29">
<div align="left"><span style="font-size:xx-small;">Code was coloured using csharpindex.com/colorCode</span></div>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack"><br /> You must now compile Time.cs. In the command time type:</span></p>
<p><span class="smallblack"><strong>csc /r:WorldTime.dll Time.cs</strong></span></p>
<p><span class="smallblack">My output was as follows:</span></p>
<p><span class="smallblack"><strong>C:\Programming\csharp\WorldTime&gt;csc /r:WorldTime.dll Time.cs<br /> Microsoft (R) Visual C# .NET Compiler version 7.00.9466<br /> for Microsoft (R) .NET Framework version 1.0.3705<br /> Copyright (C) Microsoft Corporation 2001. All rights reserved.</strong></span></p>
<p><span class="smallblack">This will generate Time.exe.</span></p>
<p><span class="smallblack">The result from running Time.exe on my computer</span></p>
<p><span class="smallblack"><strong>C:\Programming\csharp\WorldTime&gt;Time.exe<br /> Enter City: Auckland<br /> 02:20 PM Saturday, Jul 13 2002</strong></span></p>
<p><span class="smallblack">Well done, you have consumed your first web service. Now you can integrate the many free web services that are avalible on the net within you apps. </span></p>
<p><span class=</p>
<p>"smallbl<br />
ack">I hope this tutorial was informative and easy. Please email me with comments, corrections or help relating to this article or ideas for other articles.</span></p>
<p><span class="smallblack">Written by Paul William</span></p>
<p><span class="smallblack">References: </span></p>
<p><span class="smallblack">Circle24_WorldTime documentation: <a target="_new" href="http://upload.eraserver.net/circle24/worldtime/worldtime.asmx">http://upload.eraserver.net/circle24/worldtime/worldtime.asmx</a></span></p>
<p><span class="smallblack">W3C WSDL: <a target="_new" href="http://www.w3.org/TR/wsdl">http://www.w3.org/TR/wsdl</a></span></p>
<p><span class="smallblack">Thanks to Cander for help.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csharphelp.com/2006/10/consuming-a-web-service-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating The Simplest, Shortest Web Service In C#</title>
		<link>http://www.csharphelp.com/2006/08/creating-the-simplest-shortest-web-service-in-c/</link>
		<comments>http://www.csharphelp.com/2006/08/creating-the-simplest-shortest-web-service-in-c/#comments</comments>
		<pubDate>Mon, 14 Aug 2006 04:01:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.csharphelp.com.php5-3.dfw1-2.websitetestlink.com/?p=270</guid>
		<description><![CDATA[Since trying to work on a web-service seemsdifficult to new users and inexperienced programmers, this articlepresents a step-by-step method to form a simplest and shortestweb-service in C#. We&#39;ll start off with a web-service in C#. 1.On the start page, click on the New Project button. After that you&#39;ll see the following dialoguebox. Choose Visual C# [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:xx-small;"><b><br /></b></span><span class="smallblack"><a href="mailto:fajaz_sajida@yahoo.com"></a></span></p>
<p><span class="smallblack">Since trying to work on a web-service seemsdifficult to new users and inexperienced programmers, this articlepresents a step-by-step method to form a simplest and shortestweb-service in C#. </span></p>
<p><span class="smallblack">We&#39;ll start off with a web-service in C#.</span></p>
<p><span class="smallblack">1.On the start page, click on the New Project button.</span></p>
<p><span class="smallblack"><img src="http://www.csharphelp.com/archives/files/archive283/pic1.jpg" alt="" /></span></p>
<p><span class="smallblack">After that you&#39;ll see the following dialoguebox. Choose Visual C# Project as Project Type, and ASP.NET Web Serviceas Template. If it is your first Web Service, the name would do justfine. But you can name it anyway you want. Then, click OK.</span></p>
<p><span class="smallblack"><img src="http://www.csharphelp.com/archives/files/archive283/pic2.jpg" alt="" /></span></p>
<p><span class="smallblack">Next you&#39;ll see a dialogue box with title Creating New Project.</span></p>
<p><span class="smallblack"><img src="http://www.csharphelp.com/archives/files/archive283/pic3.jpg" alt="" /></span></p>
<p><span class="smallblack">It&#39;ll take a while to create folders of the web service, so there is no rush.</span></p>
<p><span class="smallblack">In case if you don&#39;t see this dialogue box,there is no need to panic. The next screen is where you ultimately haveto reach, either directly, or through the above dialogue box.</span></p>
<p><span class="smallblack">Click on the marked link in the snapshot below.</span></p>
<p><span class="smallblack"><img src="http://www.csharphelp.com/archives/files/archive283/pic4.jpg" alt="" /></span></p>
<p><span class="smallblack">Now you&#39;ll come across some real code. Puttingcuriosity aside, forget about the rest of the code and concentrate onmaking a simple, shortest web service. To do that, scroll down towardsthe end of the code. There you&#39;ll see a chunk of code commented, asshown below.</span></p>
<p><span class="smallblack"><img src="http://www.csharphelp.com/archives/files/archive283/pic5.jpg" alt="" /></span></p>
<p><span class="smallblack">Remove the double slashes (single line comments in C#) from all the enclosed lines.Your code would look like this.</span></p>
<p><span class="smallblack"><img src="http://www.csharphelp.com/archives/files/archive283/pic6.jpg" alt="" /></span></p>
<p><span class="smallblack">That&#39;s all for the coding stuff. Now to compile it, Press F5.</span></p>
<p><span class="smallblack">If you&#39;ve been an obedient reader, the next Window appeared &quot;is&quot; a web service. It would look something like below.</span></p>
<p><span class="smallblack"><img src="http://www.csharphelp.com/archives/files/archive283/pic7.jpg" alt="" /></span></p>
<p><span class="smallblack">So you see, creating a web service isn&#39;t so difficult after all. Hope this would give you some hope to work on Web Services.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csharphelp.com/2006/08/creating-the-simplest-shortest-web-service-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Access through Web Services, Stored Procedures and SQL Query</title>
		<link>http://www.csharphelp.com/2006/07/data-access-through-web-services-stored-procedures-and-sql-query/</link>
		<comments>http://www.csharphelp.com/2006/07/data-access-through-web-services-stored-procedures-and-sql-query/#comments</comments>
		<pubDate>Sat, 15 Jul 2006 04:01:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Data Access]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.csharphelp.com.php5-3.dfw1-2.websitetestlink.com/?p=240</guid>
		<description><![CDATA[&#160; INTRODUCTION Web Services has been the most revolutionaryaspect of the .NET framework developed by Microsoft. This articlepresents the three different modes through which data can be accessedviz. through web services, stored procedures and SQL Query using thepower of ADO.NET and XML. Accessing Data through Stored Procedures/SQL Queries Case: Displaying Data in a Data Grid [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><span style="font-size:xx-small;"><b><br /></b></span><span class="smallblack"><a href="mailto:tush_raj@rediffmail.com"></a></span></p>
<p><span class="smallblack">INTRODUCTION</span></p>
<p><span class="smallblack"> Web Services has been the most revolutionaryaspect of the .NET framework developed by Microsoft. This articlepresents the three different modes through which data can be accessedviz. through web services, stored procedures and SQL Query using thepower of ADO.NET and XML.</span></p>
<p><span class="smallblack">Accessing Data through Stored Procedures/SQL Queries</span></p>
<p><span class="smallblack">Case: Displaying Data in a Data Grid through SQL Query involves the following main steps:	</span></p>
<p><span class="smallblack"> Step 1: //Open the connection object to connect to the Data Base</span></p>
<p><span class="smallblack">SqlConnection sqlConn = new SqlConnection(&quot;Database=****;Server=****; uid = **; pwd=***&quot;); <br />//***- Pass the required details</span></p>
<p><span class="smallblack">	 sqlConn.Open (); </span></p>
<p><span class="smallblack"> Step 2: </span></p>
<p>&nbsp;</p>
<p><span class="smallestblack"><span class="smallblack">//Create the sqlcommand object and set the command<br />//type<br />SqlCommand	sc	= new SqlCommand ();<br />sc.Connection	= sqlConn;<br />sc.CommandType = CommandType.Text;<br />//Change this to CommandType.StoredProcedure to <br />//access thru Stored procedure<br /></span>
<p><span class="smallblack">Step 3:</span></p>
<p><span class="smallestblack"><span class="smallblack"> //set the command text<br />sc.CommandText		= &quot;Pass the SQL Query or STOREDPROCEDURE NAME&quot;;<br /> /* For ex- &quot;SELECT FunctionalAreaMaster.vFunctionalArea,nMinimumExperience,nMaximumExperience<br /> FROM FunctionalArea Or Test_StoredProcedure in case of Stored Procderues */<br /></span>
<p><span class="smallblack"> Step 4:</span></p>
<p><span class="smallestblack"><span class="smallblack">	<br />	//create the data set and data adapter object<br /> DataSet ds = new DataSet();<br />	SqlDataAdapter myReader = new SqlDataAdapter(sc); <br />//fill the data adapter object with the data set<br />	myReader.Fill(ds);</p>
<p>	//set the grid data source as the data table<br />	dgdFunctionArea.DataSource = dtblFunctionalArea;<br />	//fill the data grid with details<br />	for(int i =0;i &lt; ds.Tables[0].Rows.Count;i++)<br />	{<br />		dtblFunctionalArea.LoadDataRow(arrstrFunctionalArea,true);<br />		dgdFunctionArea[i,0]	= ds.Tables[0].Rows[i].ItemArray[0].ToString();<br />		dgdFunctionArea[i,1]	= ds.Tables[0].Rows[i].ItemArray[1].ToString();<br />		dgdFunctionArea[i,2]	= ds.Tables[0].Rows[i].ItemArray[2].ToString();<br />	}<br /></span>
<p><span class="smallblack">	Refer FillDataThruSpOrSQlQuery.cs for source code</span></p>
<p><span class="smallblack"><b>Case:</b> Displaying Data in a Data Grid through Web Service involves the following main steps: </span></p>
<p><span class="smallestblack"><span class="smallblack"> 	//create the web service object to access web method<br />MaintainData.DataFill obj	= new MaintainData.DataFill();</p>
<p>//Call the web method thru the above created object(say GetDetails here) and pass the <br />//required xml string and collect the result in the form of xml in a string variable </p>
<p>string strViewResult	= obj.GetDetails(&quot;PasstheXMLString&quot;); <br />//For ex- //&lt;A&gt;&lt;B&gt;BE&lt;/B&gt;&lt;B&gt;MBA&lt;/B&gt;&lt;/A&gt;<br />	obj					= null;</p>
<p>//here pass the above string to the method which will parse the xml from the string <br />//passed and returns a xml element object<br /> 	XmlElement XmlElementViewResult	= GetDocumentElement(strViewResult);</p>
<p>//xmlelement returned will have Records tag if there are records else some other tag(this<br />//depends on the tag returned from the data tier)<br /> 	if(XmlElementViewResult.GetElementsByTagName(&quot;Records&quot;).Count &gt; 0)<br />	{<br />	//now fill the rows in data grid by running the loop number of times there are childnodes <br />	for (int intRow=0;intRow &lt; XmlElementViewResult.ChildNodes.Count;intRow++)<br />	//row<br />	{<br />	//first fill the data table and then the respective cell in the data grid<br />	dtblFunctionalArea.LoadDataRow(arrstrGeneral,true);<br />dgdGeneral[intRow,0] = XmlElementViewResult.GetElementsByTagName(&quot;SpecialisedArea&quot;).Item(intRow).InnerText;<br />dgdGeneral[intRow,1] = XmlElementViewResult.GetElementsByTagName(&quot;MinExperience&quot;).Item(intRow).InnerText;<br />dgdGeneral[intRow,2] = XmlElementViewResult.GetElementsByTagName(&quot;MaxExperience&quot;).Item(intRow).InnerText;<br />	}<br />	}<br />	</span>
<p><span class="smallblack">	Refer FillDataThruWebService.cs for complete source code</span></p>
<p><span class="smallblack">Note:	</span></p>
<p><span class="smallblack">To run the above files include these files ina project (create a new one or add to the existing one)and then buildthe solution , then debug and run in VS.NET.</span></p>
<p><span class="smallblack"><a href="mailto:tush_raj@rediffmail.com"></a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csharphelp.com/2006/07/data-access-through-web-services-stored-procedures-and-sql-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebServices with Language Interoperability</title>
		<link>http://www.csharphelp.com/2006/04/webservices-with-language-interoperability/</link>
		<comments>http://www.csharphelp.com/2006/04/webservices-with-language-interoperability/#comments</comments>
		<pubDate>Mon, 17 Apr 2006 04:01:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C# Language]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.csharphelp.com.php5-3.dfw1-2.websitetestlink.com/?p=151</guid>
		<description><![CDATA[x]]></description>
			<content:encoded><![CDATA[<p>x</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csharphelp.com/2006/04/webservices-with-language-interoperability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Services between .NET, Java and MS SOAP Toolkit &#8211; Part II</title>
		<link>http://www.csharphelp.com/2006/02/web-services-between-net-java-and-ms-soap-toolkit-part-ii/</link>
		<comments>http://www.csharphelp.com/2006/02/web-services-between-net-java-and-ms-soap-toolkit-part-ii/#comments</comments>
		<pubDate>Wed, 15 Feb 2006 04:01:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C# Language]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.csharphelp.com.php5-3.dfw1-2.websitetestlink.com/?p=90</guid>
		<description><![CDATA[This second article in this series dedicated to Web services comes as asequel to the first one in which I started to tell you how you couldbuild different kind of clients and services using MS SOAP Toolkit,Apache SOAP for Java and .NET Framework. In the last article I mentioned something about the incompatibilitybetween a MS [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:xx-small;"><b><br /></b></span><span class="smallblack"><a href="http://www.csharphelp.com/bio/mtomescu.html"></a></span></p>
<p>
<table width="550">
<tbody>
<tr>
<td class="smallblack">This second article in this series dedicated to Web services comes as asequel to the first one in which I started to tell you how you couldbuild different kind of clients and services using MS SOAP Toolkit,Apache SOAP for Java and .NET Framework.
<p>In the last article I mentioned something about the incompatibilitybetween a MS SOAP client and an Apache SOAP server (the infamousxsi:type). As far as I know the version 2.2 didn&#39;t solve this problem,which is Apache SOAP Server is still expecting all parameters to have atype specified. But, the good news is that there is a work around tothis problem. Many of you sent me e-mails asking how to do this. Wellit is fairly simply.</p>
<p>Apache SOAP Server and clients</p>
<p>Do you remember the Apache SOAP server we wrote last time? Wellanother good news is that you don&#39;t have to change anything inside theserver. You only need to change the deployment descriptor.</p>
<p>Let me tell you more about the workaround before writinganything. The major difference between MS implementation of SOAP andApache for Java&#39;s is that the former relies on WSDL files to fullydescribe the service when the latter doesn&#39;t. This is why in theinitial implementation of the Apache SOAP for Java the type is requiredto be specified for each parameter. The server has no other mean toknow the type of the parameters unless is specified in the call. In theMS implementation the WSDL file has enough information and the servercan figure out even if the call tells nothing about this.</p>
<p>Now, the solution to our problem is: when you deploy yourservice you can specify the type mapping of each parameter in yourmethods. The Java service uses this whenever there isn&#39;t enoughinformation in the method call.</p>
<p>So you must add a mappings section to your deployment script. I modified the deployment descriptor for our service. </p>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack">&lt;isd:service xmlns:isd=&quot;http://xml.apache.org/xml-soap/deployment&quot; <br />id=&quot;urn:MyService &quot;&gt;<br />?<br />&lt;isd:mappings&gt;<br />&lt;isd:map encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;<br /> 	 xmlns:x=&quot;&quot; qname=&quot;x:num1&quot;<br /> xml2JavaClassName=&quot;org.apache.soap.encoding.soapenc.DoubleDeserializer&quot;/&gt; <br />&lt;isd:map encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;<br />xmlns:x=&quot;&quot; qname=&quot;x:num2&quot; xml2JavaClassName=&quot;org.apache.soap.encoding.soapenc.DoubleDeserializer&quot;/&gt;<br />&lt;/isd:mappings&gt;<br />?<br />&lt;/isd:service&gt;<br /></span><br />
<table width="550">
<tbody>
<tr>
<td class="smallblack">That&#39;s all.Believe it or not that&#39;s all you have to change. The MS STK clientdoesn&#39;t need any change either. The same mention for the .NET client,don&#39;t change anything.
<p>This will complete our incursion to building clients and services(simple ones) using the three major frameworks available. I mustmention here that there are other frameworks for building SOAP serversand clients so don&#39;t be shy and publish source code and information sowe can all learn about them. I remember seeing among people on SOAPBuilders discussion group another name: Glue. They were at beta versionlast time a checked their web site but I&#39;m sure they will quickly bereleasing their product.</p>
<p>Generic client for Web Services</p>
<p>Ok so now we know hot to build a web service when we have enoughinformation about the service itself: we are either the developers ofthe service or good friends with the developer, so we can get the?signature? of the service at the time we write the client.</p>
<p>Now, suppose you want to build a client that is able to call a serviceknowing only the name of the methods or something similar. My examplewill try to add two numbers searching a Math service and calling themethods. A more practical example could be a stock checker or somethingsimilar.</p>
<p>The steps I follow are:<br />- search the UDDI and findbusinesses which can help me solve my problem. The way we find thebusiness is not standardized since there isn&#39;t a set of categories withbusinesses. For example we&#39;ll make the convention that Math businesseswill be stored under Math category. Next we&#39;ll query for the URL wherethe web service stores the WSDL file.<br />This is the first step to finalize our solution. I&#39;ll skip the code forthis section since UDDI and related APIs are the subject of a futurearticle.<br />- Once we have the WSDL file we&#39;ll parse this file and find outinformation about the web service. Based on this information we&#39;llbuild a SOAP request. To build a soap request I used the low level APIin STK since we don&#39;t know from the beginning how many parameters theservice will call.</p>
<p>And here is the code:</p>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack">Option Explicit</p>
<p>Function BuildOperation( _<br /> ByVal WSDLFileName As String, _<br /> ByVal WSMLFileName As String, _<br /> sOperation As String) As CWSDLOperation</p>
<p> Dim Reader As WSDLReader<br /> Dim EnumService As EnumWSDLService<br /> Dim Service As WSDLService<br /> Dim EnumPort As EnumWSDLPorts<br /> Dim Port As WSDLPort<br /> Dim EnumOperation As EnumWSDLOperations<br /> Dim Operation As WSDLOperation<br /> Dim EnumMapper As EnumSoapMappers<br /> Dim Mapper As SoapMapper<br /> Dim Fetched As Long</p>
<p> Dim objWSDLOperation As CWSDLOperation<br /> Dim objOperationPart As COperationPart<br /> Dim bAddParts As Boolean</p>
<p> Set objWSDLOperation = New CWSDLOperation</p>
<p> Set Reader = New WSDLReader<br /> Reader.Load WSDLFileName, WSMLFileName</p>
<p> Reader.GetSoapServices EnumService</p>
<p> EnumService.Next 1, Service, Fetched<br /> Do While Fetched = 1</p>
<p> Service.GetSoapPorts EnumPort</p>
<p> EnumPort.Next 1, Port, Fetched<br /> Do While Fetched = 1</p>
<p> Port.GetSoapOperations EnumOperation</p>
<p> EnumOperation.Next 1, Operation, Fetched<br /> Do While Fetched = 1</p>
<p> //check to see if the operation is here<br /> bAddParts = False<br /> If InStr(1, Operation.soapAction, &quot;.&quot; + sOperation) &gt; 0 Then<br /> With objWSDLOperation<br /> Set .m_Parts = New Collection<br /> .m_PortAddress = Port.address<br /> .m_SoapAction = Operation.soapAction<br /> End With<br /> bAddParts = True</p>
<p> Operation.GetOperationParts EnumMapper</p>
<p> EnumMapper.Next 1, Mapper, Fetched<br /> Do While Fetched = 1</p>
<p> If bAddParts Then<br /> Set objOperationPart = New COperationPart<br /> objOperationPart.m_Name = Mapper.partName<br /> Call objWSDLOperation.m_Parts.Add(objOperationPart)<br /> End If</p>
<p> EnumMapper.Next 1, Mapper, Fetched<br /> Loop</p>
<p> End If</p>
<p> EnumOperation.Next 1, Operation, Fetched<br /> Loop</p>
<p> EnumPort.Next 1, Port, Fetched<br /> Loop</p>
<p> EnumService.Next 1, Service, Fetched<br /> Loop<br /> Set BuildOperation = objWSDLOperation</p>
<p>End Function<br /></span><br />
<table width="550">
<tbody>
<tr>
<td class="smallblack">Function buildBuildOperation() parses the WSDL file and gathers information about theservice: name, parameters, namespaces used, etc and finally returns aCWSDLOperation object.
<p>With this information we can move next to build the SOAP requestand invoke the web service. The service is invoked by calling Executemethod on CWSDLOperation object. In my example the Execute method willsimply print the result of the add operation.</p>
<p>In my example the rule I applied for finding the right methodand passing the parameter is pretty simple but in a real applicationyou can implement more sophisticated mechanisms or assume there are fewpatterns for each method naming.</p>
<p>Here is the code for the CWSDLOperation class.</p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack">Option Explicit</p>
<p>Private Cons</p>
<p>t WRAPPE<br />
R_ELEMENT_NAMESPACE = &quot;&quot;</p>
<p>Public m_PortAddress As String<br />Public m_SoapAction As String<br />Public m_Parts As Collection</p>
<p>Public Sub Execute()<br /> If m_SoapAction &lt;&gt; vbNullString Then<br /> On Error GoTo ErrorHandler</p>
<p> Dim Serializer As SoapSerializer<br /> Dim Reader As SoapReader<br /> Dim Connector As SoapConnector</p>
<p> Dim part As COperationPart<br /> Dim sMethod As String, sNamespace As String</p>
<p> Set Connector = New HttpConnector<br /> Connector.Property(&quot;EndPointURL&quot;) = m_PortAddress <br /> Connector.Property(&quot;SoapAction&quot;) = m_SoapAction<br /> Connector.BeginMessage</p>
<p> Set Serializer = New SoapSerializer<br /> Serializer.Init Connector.InputStream</p>
<p> sMethod = Mid$(m_SoapAction, InStrRev(m_SoapAction, &quot;.&quot;) + 1)<br /> sNamespace = Left$(m_SoapAction, InStr(m_SoapAction, &quot;/action&quot;) &#8211; 1)</p>
<p> Serializer.startEnvelope<br /> Serializer.startBody<br /> Serializer.startElement sMethod, sNamespace + &quot;/message/&quot;, , &quot;m&quot;</p>
<p> For Each part In m_Parts<br /> Serializer.startElement part.m_Name<br /> Serializer.writeString &quot;20&quot;<br /> Serializer.endElement<br /> Next</p>
<p> Serializer.endElement<br /> Serializer.endBody<br /> Serializer.endEnvelope</p>
<p> Connector.EndMessage</p>
<p> Set Reader = New SoapReader<br /> Reader.Load Connector.OutputStream</p>
<p> If Not Reader.Fault Is Nothing Then<br /> MsgBox Reader.faultstring.Text, vbExclamation<br /> Else<br /> Debug.Print Reader.RPCResult.Text<br /> End If<br /> End If</p>
<p> Exit Sub</p>
<p>ErrorHandler:<br /> MsgBox &quot;ERROR: &quot; &amp; Err.Description, vbExclamation<br /> Err.Clear<br /> Exit Sub<br />End Sub</p>
<p>COperationPart class is very simply:</p>
<p>Option Explicit</p>
<p>Public m_Name As String<br /></span><br />
<table width="550">
<tbody>
<tr>
<td class="smallblack">If you want tosimplify the code you can substitute the COperationPart class with aString variable. There are more fields that can be added to theCOperationPart class but I removed them for simplicity of the code. Theother information available in the WSDL file for a OperationPart are:
<p>-	elementName<br />-	callIndex <br />-	elementType <br />-	messageName <br />-	isInput <br />-	partName <br />-	xmlNameSpace<br />-	comValue <br />-	parameterOrder</p>
<p>To test the sample application you need to build 2 simple Web serviceswith STK MathLib1 and MathLib2. MathLib1 implements add method andMathLib2 implements addNumbers method. Both methods accept 2 parametersas double values.</p>
<p>After you create these two web services change the namespace inone of them so something else than default, so you replicate a realsituation.</p>
<p>Create a VB project, add the two classes, than add a form, onthe form add a button and insert the following code in his click event.</p>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack">Private Sub cmdCallServices_Click()<br /> Call BuildOperation(&quot;C:\work\xarea\soap\MathLib\MathLib1\MathLib1.WSDL&quot;, _<br /> &quot;C:\work\soap\MathLib\MathLib1\MathLib1.WSML&quot;, &quot;add&quot;).Execute<br /> Call BuildOperation(&quot;C:\work\xarea\soap\MathLib\MathLib2\MathLib2.WSDL&quot;, _<br /> &quot;C:\work\soap\MathLib\MathLib2\MathLib2.WSML&quot;, &quot;add&quot;).Execute<br />End Sub<br /></span>
<p><span class="smallblack">Compile and you are ready to go!</span></p>
<p><span class="smallblack">I hope this article will help better understand web services and SOAP. </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csharphelp.com/2006/02/web-services-between-net-java-and-ms-soap-toolkit-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create And Deploy A WebService Using C#</title>
		<link>http://www.csharphelp.com/2006/02/create-and-deploy-a-webservice-using-c/</link>
		<comments>http://www.csharphelp.com/2006/02/create-and-deploy-a-webservice-using-c/#comments</comments>
		<pubDate>Tue, 07 Feb 2006 04:01:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C# Language]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.csharphelp.com.php5-3.dfw1-2.websitetestlink.com/?p=82</guid>
		<description><![CDATA[First, let&#39;s start off by creating a very simple webservice. Creating A Webservice 1.Create a folder named Webservice under wwwroot 2. Create a File &#60;%@ WebService Language=&#34;c#&#34; Class=&#34;AddNumbers&#34;%&#62; using System;using System.Web.Services;public class AddNumbers : WebService{ [WebMethod] public int Add(int a, int b){ int sum; sum = a + b; return sum; }} 3.Save this file [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:xx-small;"><b><br /></b></span><span class="smallblack"><a href="http://www.csharphelp.com/bio/praja.html"></a></span></p>
<p><span class="smallblack">First, let&#39;s start off by creating a very simple webservice.</span></p>
<p><span class="smallblack"><span style="text-decoration:underline;">Creating A Webservice</span></span></p>
<p><span class="smallblack">1.Create a folder named Webservice under wwwroot</span></p>
<p><span class="smallblack">2. Create a File</span></p>
<p><span class="smallblack">&lt;%@ WebService Language=&quot;c#&quot; Class=&quot;AddNumbers&quot;%&gt;</p>
<p>using System;<br />using System.Web.Services;<br />public class AddNumbers : WebService<br />{<br /> [WebMethod]<br /> public int Add(int a, int b){<br /> int sum;<br /> sum = a + b;<br /> return sum;<br /> }<br />}<br /></span>
<p><span class="smallblack">3.Save this file as AddService.asmx [asmx-&gt; file extension]</span></p>
<p><span class="smallblack">4.Now the webservice is created and ready for the clients to use it.</span></p>
<p><span class="smallblack">5. Now we can call this webservice using</span></p>
<p><span class="smallblack">http://ip address/Webservice/Addservice.asmx/Add?a=10&amp;b=5</span></p>
<p><span class="smallblack">This will return the result in XML format</span></p>
<p><span class="smallblack"><span style="text-decoration:underline;">Deploying the Webservice in the Client Machine</span></span></p>
<p><span class="smallblack">1.At the command prompt:</span></p>
<p><span class="smallblack">WSDL http://ip address ofthe site/WebService/MathService.asmx /n:NameSp /out:FileName.cs]<br />-This will create a file called FileNmame.cs .</span></p>
<p><span class="smallblack">WSDL -&gt; WebServices Description Language (This is an application available at C:\Program </span></p>
<p><span class="smallblack">Files\Microsoft.NET\FrameworkSDK\Bin)</span></p>
<p><span class="smallblack">NameSp -&gt; Name of the NameSpace which will be used in client code for deploying the webservice.</span></p>
<p><span class="smallblack">2.Compilation</span></p>
<p><span class="smallblack">CSC /t:library /r:system.web.dll /r:system.xml.dll CreatedFile.cs </span></p>
<p><span class="smallblack">This will create a dll with the name of the public class of the asmx file.( In our case, it is &quot;AddNumbers.dll&quot; )</span></p>
<p><span class="smallblack">CSC is an application available at C:\WINNT\Microsoft.NET\Framework\v1.0.2914</span></p>
<p><span class="smallblack">3.Put the dll file inside WWWRooT\BIN [Create a BIN Folder in WWWRoot]</span></p>
<p><span class="smallblack"><span style="text-decoration:underline;">Making use of WebService in client asp/aspx page</span></span></p>
<p>&nbsp;</p>
<p><span class="smallblack">&lt;%@ import Namespace = &quot;NameSp&quot; %&gt;<br />&lt;script language = &quot;c#&quot; runat = &quot;server&quot;&gt;<br />public void Page_Load(object o, EventArgs e){<br /> int x = 10;<br /> int y = 5;<br /> int sum;<br /> //Instantiating the public class of the webservice<br /> AddNumbers AN = new AddNumbers();<br /> sum = AN.Add(x,y);<br /> string str = sum.ToString();<br /> response.writeline(str);<br />}<br />&lt;/script&gt;<br /></span>
<p><span class="smallblack"><span style="text-decoration:underline;">Note</span></span></p>
<p><span class="smallblack">It is advisable to</span></p>
<p><span class="smallblack">1. Copy the .asmx file to the foldercontaining WSDL aplication (C:\ProgramFiles\Microsoft.NET\FrameworkSDK\Bin) before creating cs file.</span></p>
<p><span class="smallblack">2. Copy the created .cs file to the folder containing CSC application </span></p>
<p><span class="smallblack">(C:\WINNT\Microsoft.NET\Framework\v1.0.2914) before compliling it.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csharphelp.com/2006/02/create-and-deploy-a-webservice-using-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Services between .NET, Java and MS SOAP Toolkit</title>
		<link>http://www.csharphelp.com/2006/01/web-services-between-net-java-and-ms-soap-toolkit/</link>
		<comments>http://www.csharphelp.com/2006/01/web-services-between-net-java-and-ms-soap-toolkit/#comments</comments>
		<pubDate>Tue, 10 Jan 2006 04:01:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C# Language]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.csharphelp.com.php5-3.dfw1-2.websitetestlink.com/?p=54</guid>
		<description><![CDATA[&#160; This article will try to explain the how you can build web servicesand/or clients with any of the three languages: .NET, MS SOAP Toolkitand Java. But the real point of the article is to show you how you canbuild clients for web services from any of above-mentioned languages. Not long ago .NET was released [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;<span class="smallblack"><a href="http://www.csharphelp.com/bio/mtomescu.html"><br /></a></span></p>
<p>
<table width="600">
<tbody>
<tr>
<td><span class="smallblack">This article will try to explain the how you can build web servicesand/or clients with any of the three languages: .NET, MS SOAP Toolkitand Java. But the real point of the article is to show you how you canbuild clients for web services from any of above-mentioned languages.</span>
<p><span class="smallblack">Not long ago .NET was released and many of usjumped on to write ASP.NET web sites, C# programs or Web Services. Iwas really amazed by the relatively easy way someone can write a webservice with .NET. I previously had written some web services with MSSOAP Toolkit and Apache SOAP for Java. And then someone asked me towrite clients using different languages for those web services. Itproved to be not trivial. Although SOAP is now a standard, differentimplementations of web services are using it in ways that sometimemakes the interoperability with other SOAPs hard if not impossible.</span></p>
<p><span class="smallblack">My sample application is a very simple webservice with one method: addNumbers. As you already deducted it willadd two numbers and return the result. The name of the application isHello2 and the source files are attached to this message.</span></p>
<p><span class="smallblack"><b>STK Service and Clients</b><br />First let?s write the Web Service using the MS SOAP Toolkit with an ASP listener and an ISAPI listener as well.</span></p>
<p><span class="smallblack">The addNumbers method in the Visual Basic class is:</span></p>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack">Public Function addNumbers(ByVal NumberOne As Double, ByVal NumberTwo As Double) As Double<br /> addNumbers = NumberOne + NumberTwo<br />End Function<br /></span><br />
<table width="600">
<tbody>
<tr>
<td><span class="smallblack">Using the WSDLGen.exe wizard you can generate the ISAPI listener, theASP listener or both (not at the same time, of course). I choosed togenerate both the ASP and the ISAPI listener, so I named my WSDL filesHello2ASP.WSDL respectively Hello2Isapi.WSDL.</span>
<p><span class="smallblack">Now let?s write some clients for this Hello2 web service.</span></p>
<p><span class="smallblack"><b>STK Client</b><br />The first client is aVisual Basic client using high level API in SOAP Toolkit. Create a VBproject add a form and then a button. The code bellow is executed whenthe button is hit.</span></p>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack">Private Sub cmdDoTest_Click()<br /> Const WS_URL = &quot;http://localhost/Hello2/Hello2Isapi.WSDL&quot;</p>
<p> Dim objHello2ISapi As SoapClient<br /> Dim nResult As Double, NumberOne As Double, NumberTwo As Double</p>
<p> On Error GoTo catch_err<br /> Set objHello2ISapi = New SoapClient<br /> Call objHello2ISapi.mssoapinit(WS_URL)</p>
<p> NumberOne = 10<br /> NumberTwo = 25<br /> nResult = objHello2ISapi.addNumbers(NumberOne, NumberTwo)<br /> MsgBox nResult</p>
<p>cleanup:<br /> Set objHello2ISapi = Nothing<br /> Exit Sub</p>
<p>catch_err:<br /> MsgBox Err.Description<br /> Resume cleanup<br />End Sub<br /></span><br />
<table width="600">
<tbody>
<tr>
<td><span class="smallblack">As you cansee the client is pretty simple and there are no problems. All thedetails like building the SOAP request message and parsing the resultSOAP message is hidden from the programmer.WS_URL is the URL of the service. The high level API in SOAP Toolkitneeds a WSDL file so this URL points to one of the WSDL files. At thispoint it doesn?t matter which one you provide. Though, the performanceis better with the ISAPI listener.</span>
<p><span class="smallblack"><b>Java Client</b><br />The second client we?ll write for our Hello2 server is a Java client. Iused for this the Apache SOAP 2.1. You can download it for free fromhttp://xml.apache.org/soap/index.html.</span></p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack">The Java class file for the ASP listener is listed bellow.</span></p>
<p><span class="smallblack">import java.io.*;<br />import java.util.*;<br />import java.net.*;<br />import org.w3c.dom.*;<br />import org.apache.soap.util.xml.*;<br />import org.apache.soap.*;<br />import org.apache.soap.encoding.*;<br />import org.apache.soap.encoding.soapenc.*;<br />import org.apache.soap.rpc.*;<br />import org.apache.soap.transport.http.SOAPHTTPConnection;</p>
<p>public class testClient {</p>
<p>	public static void main(String[] args) throws Exception {</p>
<p>		URL url = new URL (&quot;http://localhost/Hello2/Hello2.asp&quot;);</p>
<p>		SOAPMappingRegistry smr = new SOAPMappingRegistry ();<br />		StringDeserializer sd = new StringDeserializer ();<br />		smr.mapTypes (Constants.NS_URI_SOAP_ENC, new QName (&quot;&quot;, &quot;Result&quot;), null, null, sd);</p>
<p>		// create the transport and set parameters<br />		SOAPHTTPConnection st = new SOAPHTTPConnection();</p>
<p>		// build the call.<br />		Call call = new Call ();<br />		call.setSOAPTransport(st);<br />		call.setSOAPMappingRegistry (smr);</p>
<p>		call.setTargetObjectURI (&quot;http://tempuri.org/message/&quot;);<br />		call.setMethodName(&quot;addNumbers&quot;);<br />		call.setEncodingStyleURI (&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;);</p>
<p>		Vector params = new Vector();<br />		params.addElement(new Parameter(&quot;NumberOne&quot;, Double.class, &quot;10&quot;, null));<br />		params.addElement(new Parameter(&quot;NumberTwo&quot;, Double.class, &quot;25&quot;, null));<br />		call.setParams(params);</p>
<p>		Response resp = null;<br />		try {<br />		 resp = call.invoke (url, &quot;http://tempuri.org/action/Hello2.addNumbers&quot;);<br />		}<br />		catch (SOAPException e) {<br />			System.err.println(&quot;Caught SOAPException (&quot; + e.getFaultCode () + &quot;): &quot; + e.getMessage ());<br />			return;<br />		}</p>
<p>		// check response<br />		if (resp != null &amp;&amp; !resp.generatedFault()) {<br />		 Parameter ret = resp.getReturnValue();<br />		 Object value = ret.getValue();</p>
<p>		 System.out.println (&quot;Answer&#8211;&gt; &quot; + value);<br />		}<br />		else {<br />			Fault fault = resp.getFault ();<br />			System.err.println (&quot;Generated fault: &quot;);<br />			System.out.println (&quot; Fault Code = &quot; + fault.getFaultCode());<br />			System.out.println (&quot; Fault String = &quot; + fault.getFaultString());<br />		}<br />	}<br />}<br /></span><br />
<table width="600">
<tbody>
<tr>
<td><span class="smallblack">As you cansee the url variable points to the ASP listener. To point the Javaclient to the ISAPI listener make the following change:</span>
<p><span class="smallblack">URL url = new URL (&quot;http://localhost/Hello2/Hello2Isapi.wsdl&quot;);</span></p>
<p><span class="smallblack"><b>.NET Client</b><br />Now it is time to writea .NET client for our Hello2 Web service. Using the WSDL.exe tool from.NET Framework Beta 2 you must generate a proxy class for our service.Execute following command.</span></p>
<p><span class="smallblack">wsdl http://localhost/Hello2/Hello2Isapi.wsdl</span></p>
<p><span class="smallblack">This will generate Hello2Isapi.cs file. Thisis the .NET proxy class using C# (this is the default language used).Check out the params for wsdl.exe to generate the proxy using VB.NET oranother language.Now compile the proxy using</span></p>
<p><span class="smallblack">csc.exe /t:library Hello2Isapi.cs</span></p>
<p><span class="smallblack">It?s time to write the .NET client, which usesthe proxy class to access the Hello2 web service. Here is the code forthe C# client.</span></p>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack">using System;</p>
<p>public class Hello2ISapiClient {<br /> public static void Main() {<br /> Hello2Isapi srv = new Hello2Isapi();<br /> double res = 0, num1 = 10, num2 = 25;</p>
<p> res = srv.addNumbers(num1, num2);</p>
<p> Console.WriteLine(&quot;{0}+{1}={2}&quot;, num1, num2, res);<br /> }<br />}<br /></span><br />
<table width="600">
<tbody>
<tr>
<td><span class="smallblack">Compile the client using Hello2IsapiClient.cs /refere</p>
<p>nce:Hell<br />
o2Isapi.dll and run it with Hello2IsapiClient.</span>
<p><span class="smallblack">At this point we have a MS SOAP Toolkit web service and three clients written with: SOAP Toolkit, Java respectively .NET </span></p>
<p><span class="smallblack"><b>Apache SOAP for Java Service and Clients</b><br />Let?s move on now and write the same service using Apache SOAP for Java. Here is the service:</span></p>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack">package samples.MyService;</p>
<p>import java.util.*;<br />import org.w3c.dom.*;<br />import org.apache.soap.util.xml.*;</p>
<p>public class MyService {<br />	public double addNumbers(double num1, double num2) {<br />		return num1+num2;<br />	}<br />}</p>
<p></span><br />
<table width="600">
<tbody>
<tr>
<td><span class="smallblack">I used thename MyService for my service and I added it to the samples package.This way you don?t need to add a context into the Tomcat server. Justdeploy the service into SOAP using the following deployment descriptorfile:</span></td>
</tr>
</tbody>
</table>
<p><span class="smallblack">&lt;isd:service xmlns:isd=&quot;http://xml.apache.org/xml-soap/deployment&quot; id=&quot;urn:myservice-service&quot; checkMustUnderstands=&quot;false&quot;&gt;<br /> &lt;isd:provider type=&quot;java&quot; scope=&quot;Application&quot; methods=&quot;addNumbers&quot;&gt;<br /> &lt;isd:java class=&quot;samples.MyService.MyService&quot; static=&quot;false&quot;/&gt;<br /> &lt;/isd:provider&gt;<br />&lt;/isd:service&gt;<br /></span><br />
<table width="600">
<tbody>
<tr>
<td><span class="smallblack">I won?t explain here how to set up Apache SOAP into Tomcat since there is enough guidance in the Apache SOAP documentation.</span>
<p><span class="smallblack"><b>Apache SOAP Client</b><br />It?s time to write the clients for this service. The first one is written using Java. Here is the code:</span></p>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack">package samples.MyService;</p>
<p>import java.io.*;<br />import java.util.*;<br />import java.net.*;<br />import org.w3c.dom.*;<br />import org.apache.soap.util.xml.*;<br />import org.apache.soap.*;<br />import org.apache.soap.encoding.*;<br />import org.apache.soap.encoding.soapenc.*;<br />import org.apache.soap.rpc.*;</p>
<p>public class client {<br /> public static void main(String[] args) throws Exception {<br /> if (args.length != 3<br /> &amp;&amp; (args.length != 4 || !args[0].startsWith(&quot;-&quot;)))<br /> {<br /> System.err.println(&quot;Usage:&quot;);<br /> System.err.println(&quot; java &quot; + client.class.getName() +<br /> &quot; [-encodingStyleURI] SOAP-router-URL nameToLookup&quot;);<br /> System.exit (1);<br /> }</p>
<p> // Process the arguments.<br /> int offset = 4 &#8211; args.length;<br /> String encodingStyleURI = args.length == 4<br /> ? args[0].substring(1)<br /> : Constants.NS_URI_SOAP_ENC;<br /> URL url = new URL(args[1 - offset]);<br /> Double 	num1 = new Double(args[2 - offset]),<br /> 		num2 = new Double(args[3 - offset]);</p>
<p> SOAPMappingRegistry smr = new SOAPMappingRegistry();<br /> BeanSerializer beanSer = new BeanSerializer();</p>
<p>	System.out.println(encodingStyleURI);<br />	System.out.println(url);<br />	System.out.println(num1);<br />	System.out.println(num2);</p>
<p> // Build the call.<br /> Call call = new Call();</p>
<p> call.setSOAPMappingRegistry(smr);<br /> call.setTargetObjectURI(&quot;urn:MyService&quot;);<br /> call.setMethodName(&quot;addNumbers&quot;);<br /> call.setEncodingStyleURI(encodingStyleURI);</p>
<p> Vector params = new Vector();</p>
<p> params.addElement(new Parameter(&quot;num1&quot;, Double.class, num1, null));<br /> params.addElement(new Parameter(&quot;num2&quot;, Double.class, num2, null));<br /> call.setParams(params);</p>
<p> // Invoke the call.<br /> Response resp;</p>
<p>	long nErrors = 0;<br />	Calendar cal = Calendar.getInstance();<br />	Date startTime = cal.getTime(), endTime;</p>
<p>		try {<br />		 resp = call.invoke(url, &quot;&quot;);<br />		}<br />		catch (SOAPException e) {<br />			System.out.println(&quot;i=&quot; + i);<br />		 System.err.println(&quot;Caught SOAPException (&quot; +<br />							 e.getFaultCode() + &quot;): &quot; +<br />							 e.getMessage());<br />		 return;<br />		}</p>
<p>		// Check the response.<br />		if (!resp.generatedFault()) {<br />		 Parameter ret = resp.getReturnValue();<br />		 Object value = ret.getValue();</p>
<p>		 //System.out.println(value != null ? &quot;\n&quot; + value : &quot;I don&#39;t know.&quot;);<br />		}<br />		else {<br />		 Fault fault = resp.getFault();</p>
<p>		 System.err.println(&quot;Generated fault: &quot;);<br />		 System.out.println (&quot; Fault Code = &quot; + fault.getFaultCode());<br />		 System.out.println (&quot; Fault String = &quot; + fault.getFaultString());<br />		}</p>
<p>	cal = Calendar.getInstance();<br />	endTime = cal.getTime();<br />	System.out.println(&quot;Start time=&quot;+startTime);<br />	System.out.println(&quot;End time=&quot;+endTime);<br />	System.out.println (&quot;Errors=&quot; + nErrors);</p>
<p> }<br />}<br /></span><br />
<table width="600">
<tbody>
<tr>
<td><span class="smallblack">As you can see the code is pretty straightforward. No problems expected since the same SOAP library is used.The code for a STK client is bellow:</span>
<p><span class="smallblack"><b>STK Client</b><br />There are errors in both high level and low level clients because xsi:type is required in Apache SOAP for Java.</span></p>
<p><span class="smallblack"><b>.NET Client</b><br />Due to the same issue a .NET client won?t work either.</span></p>
<p><span class="smallblack"><b>.NET Service and Clients</b><br />.NETFramework Beta 2 is the newest technology and changes are expected tohappen from Beta 2 to the final release. Major changes already havebeen made when Beta 2 was released. This is no surprise since Microsofthad warned developers that might happen.</span></p>
<p><span class="smallblack">Writing a web service with .NET is very simpleand can be done in several ways. I choose to write my web service in C#using a ASMX file. Here is the content of the file.</span></p>
</td>
</tr>
</tbody>
</table>
<p><span class="smallblack">&lt;%@ WebService Language=&quot;C#&quot; Class=&quot;MyService&quot; %&gt;</p>
<p>using System;<br />using System.Web.Services;</p>
<p>[WebService(Namespace=&quot;http://www.catalin.com/webservices/&quot;)]<br />public class MyService: WebService {<br /> [ WebMethod(Description=&quot;return the sum of two numbers&quot;)]<br /> [System.Web.Services.Protocols.SoapRpcMethodAttribute(<br /> 	&quot;http://www.catalin.com/webservices/addNumbers&quot;, <br /> 	RequestNamespace=&quot;http://www.catalin.com/webservices/&quot;, <br /> 	ResponseNamespace=&quot;http://www.catalin.com/webservices/&quot;)]<br /> public double addNumbers(double numberOne, double numberTwo) {<br /> 	return numberOne + numberTwo;<br /> }<br />}<br /></span>
<p><span class="smallblack">Theadvantage of using a ASMX file is that no compilation is needed so ahot deployment can be done.Place the file into a virtual directory under IIS. You can test theservice with your IE with http://localhost/testdotnetws/myservice.asmx<b>.NET Client</b><br />Writing a client for this service is similarwith the .NET client we write earlier. When generating the proxy filespecify the WSDL file withhttp://localhost/testdotnetws/myservice.asmx?WSDL. This is the way .NETframework creates the WSDL file on-demand.</span></p>
<p><span class="smallblack"><b>STK Client</b><br />Using the high level APIwould be a faster solution but there are some issues there and Icouldn?t solve them out so I used the low level API. The client code isnot difficult. The only trick is to enable the .NET service for RPCtype of calls. Thanks to Christian Weyer who helped me with this issue.Look at the web service code and notice theSystem.Web.Services.Protocols.SoapRpcMethodAttribute attribute for ourmethod. Without this attribute the default type of conversation in .NETis ?message?.</span></p>
<p><span class="smallblack"><b>Java Client</b><br />In the java client you?ll have to modify the url as follows:</span></p>
<p><</p>
<p>p><span class="smallblack">URL url = new URL (&quot;http://localhost/aspnet_test/myservice/myservice.asmx&quot;);</span></p>
<p><span class="smallblack">Compile and run.</span></p>
<p><span class="smallblack">I hope this short trip to the web service world was helpful for those of you who are involved in web services development.</span></p>
<p><span class="smallblack">Happy SOAP-ing!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csharphelp.com/2006/01/web-services-between-net-java-and-ms-soap-toolkit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

