Announcement Announcement Module
Collapse
No announcement yet.
proxy object in Webservice Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • proxy object in Webservice

    What the different phase/steps of acquiring a proxy object in Webservice ?



    new york apartments for sale

  • #2
    Are you referring to a proxy object like they use in .NET?

    Comment


    • #3
      Hello,

      I m trying to pass in an array of objects into a web service. the web service calls two stored procedure, one to create a purchase order, and another to create purchase order line items. the array consists of the line item variables because there will be multiple line items per purchase order. I m writing my GUI in flex and have it so it adds a new purchase order, but doesn't add line items...

      Regards,
      long island windows

      Comment


      • #4
        There are many ways to consume Web Services.


        1. The first way is to use a SOAP Proxy Client Object generated by the WSDL utility, and it provides programmers with their familiar object model that they can use to call methods provided by the generated Proxy Interface.

        2. The second way is to use HTTP-POST and HTTP-GET protocols.

        3. The third way is to use a SOAP standard Request message that parses SOAP response messages with the help of the XMLHTTP COM object that is installed by the Microsoft XML Parser.




        WSDL: Web Services Description Language (WSDL) is an XML based protocol for information exchange in decentralized and distributed environments. A WSDL document defines services as collections of network endpoints, or ports. A WSDL document uses the following elements in the definition of network services:

        Types – a container for data type definitions using some type system (such as XSD).
        Message – an abstract, typed definition of the data being communicated.

        Operation – an abstract description of an action supported by the service.

        Port Type –an abstract set of operations supported by one or more endpoints.

        Binding – a concrete protocol and data format specification for a particular port type.

        Port – a single endpoint defined as a combination of a binding and a network address.

        Service – a collection of related endpoints.




        Proxy Class: This proxy class serves as an intermediate between the ASP.NET Web page and the Web service

        Comment


        • #5
          There are many ways to consume Web Services.


          1. The first way is to use a SOAP Proxy Client Object generated by the WSDL utility, and it provides programmers with their familiar object model that they can use to call methods provided by the generated Proxy Interface.

          2. The second way is to use HTTP-POST and HTTP-GET protocols.

          3. The third way is to use a SOAP standard Request message that parses SOAP response messages with the help of the XMLHTTP COM object that is installed by the Microsoft XML Parser.
          WSDL: Web Services Description Language (WSDL) is an XML based protocol for information exchange in decentralized and distributed environments. A WSDL document defines services as collections of network endpoints, or ports. A WSDL document uses the following elements in the definition of network services:


          * Types – a container for data type definitions using some type system (such as XSD).

          * Message – an abstract, typed definition of the data being communicated.

          * Operation – an abstract description of an action supported by the service.

          * Port Type –an abstract set of operations supported by one or more endpoints.

          * Binding – a concrete protocol and data format specification for a particular port type.

          * Port – a single endpoint defined as a combination of a binding and a network address.

          * Service – a collection of related endpoints.




          Proxy Class: This proxy class serves as an intermediate between the ASP.NET Web page and the Web service
          Consuming Web Service object:




          1. The Asp.Net page instantiates an instance of the proxy class. For e.g. ProxyClassName objproxy = new ProxyClassName();

          2. Once the object is instantiated, then with the help of proxy object, this will make a call to the web service method. For e.g. objproxy.WebMethodName(any Parameter that has to send);

          3. The proxy class marshals the parameter list and makes an HTTP request to the Web service sitting on Web Server 2.

          4. The Web service unmarshals the incoming parameters, runs the method, and marshals the output parameters. These are sent back in an HTTP response.

          5. The proxy class unmarshals the return parameters and passes back the result to the ASP.NET Web page.


          Creating a Proxy Class:



          Creating a Proxy class involves three steps:

          C# Tutorial Home

          * Introduction
          o Introduction to C#
          o Control Statement: Selection Statement in C#
          o Control Statements: Loops Statement
          o Methods
          o Namespaces
          o Introduction to Classes:
          o Inheritance:
          o Polymorphism
          o Properties
          o Indexers
          o Structs
          o Interfaces
          o Delegates:
          o Exception Handling:
          o Attributes
          o Enums
          o Encapsulation
          o Parameter Passing in C#
          o Method Overloading
          o Database Interaction Using C#
          o Operator Overloading in C# -1
          o Operator Overloading in C# -2
          o Operator Overloading in C# -2
          o Sockets
          o DNS [Domain Name System]
          o Working with Files
          o Generating Help File in C#
          o Code Access Security
          o Multi-Threading
          o Globalization and Localization -1
          o Working with Registry in C#
          o Globalization and Localization -2
          o Windows Service
          o Web Service
          o Consuming Web Services
          o Creating Proxy Object of Web Service
          o Creating an XML document
          o Reading XML document in C#
          o Using XMLWriter class to Write XML document in C#
          o Assembly Information : Getting Permission set of the assembly
          o Creating your own Permission Set
          o Using C# Socket

          C# Home

          * Members (2503)
          * Member Articles ( 15 )
          * Discussion (8)
          * Q & A ( 7 )
          * - Ask Question
          * - Questions
          * - Unanswered Questions

          C# Resources

          * Source Code (35)
          * Articles (77)
          * Blogs (105)
          * Jobs (0)
          * Components (7)
          * Books (3)
          * Websites (25)
          * News (18)

          Community

          *
          o Join VisualBuilder
          o Authors
          o People
          o Discussions

          Site

          *
          o About Us
          o Site Map
          o Search
          o Contact Us
          o Feedback
          o Tell a Friend
          o Advertise

          You are Here: Home >C#> Tutorial > Creating Proxy Object of Web Service
          Creating Proxy Object of Web Service
          text zoom
          Previous: Consuming Web Services Creating an XML document :Next

          There are many ways to consume Web Services.


          1. The first way is to use a SOAP Proxy Client Object generated by the WSDL utility, and it provides programmers with their familiar object model that they can use to call methods provided by the generated Proxy Interface.

          2. The second way is to use HTTP-POST and HTTP-GET protocols.

          3. The third way is to use a SOAP standard Request message that parses SOAP response messages with the help of the XMLHTTP COM object that is installed by the Microsoft XML Parser.

          WSDL: Web Services Description Language (WSDL) is an XML based protocol for information exchange in decentralized and distributed environments. A WSDL document defines services as collections of network endpoints, or ports. A WSDL document uses the following elements in the definition of network services:


          * Types – a container for data type definitions using some type system (such as XSD).

          * Message – an abstract, typed definition of the data being communicated.

          * Operation – an abstract description of an action supported by the service.

          * Port Type –an abstract set of operations supported by one or more endpoints.

          * Binding – a concrete protocol and data format specification for a particular port type.

          * Port – a single endpoint defined as a combination of a binding and a network address.

          * Service – a collection of related endpoints.
          Proxy Class: This proxy class serves as an intermediate between the ASP.NET Web page and the Web service
          Consuming Web Service object
          1. The Asp.Net page instantiates an instance of the proxy class. For e.g. ProxyClassName objproxy = new ProxyClassName();

          2. Once the object is instantiated, then with the help of proxy object, this will make a call to the web service method. For e.g. objproxy.WebMethodName(any Parameter that has to send);

          3. The proxy class marshals the parameter list and makes an HTTP request to the Web service sitting on Web Server 2.

          4. The Web service unmarshals the incoming parameters, runs the method, and marshals the output parameters. These are sent back in an HTTP response.

          5. The proxy class unmarshals the return parameters and passes back the result to the ASP.NET Web page.
          Creating a Proxy Class:
          Creating a Proxy class involves three steps:
          Step 1:- First create the proxy class of the web service using the WSDL tool.

          wsdl.exe:-Utility to generate code for xml web service clients and xml web services using ASP.NET from WSDL contract files, XSD schemas and discomap discovery documents. This tool can be used in conjunction with disco.exe.

          Run this from the Command Prompt:

          C:\Program Files\Microsoft Visual Studio 8\VC> wsdl http://localhost:1508/WebService_New/MyWebService.asmx

          Microsoft (R) Web Services Description Language Utility

          [Microsoft (R) .NET Framework, Version 2.0.50727.42]

          Copyright (C) Microsoft Corporation. All rights reserved.

          Writing file 'C:\Program Files\Microsoft Visual Studio

          8\VC\Service.cs'.
          Step 2:- This will create the “Service.cs” file on the specified location. After this compile this Proxy Class to generate the compiled proxy

          Class i.e. “Service.dll” Run this from the command Prompt:

          C:\Program Files\Microsoft Visual Studio 8\VC> csc /t:library Service.cs

          Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42

          for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727

          Copyright (C) Microsoft Corporation 2001-2005. All rights Reserved.
          Step 3:-Place this compiled proxy class in the dll of the Web Site from where you want to access the Web Service.
          WSDL.EXE:

          • Wsdl.exe contains only one required parameter, a URL or path to the WSDL for the Web service. The following optional parameters can be specified:

          • /language: language – specifies what language the Proxy class should be created in (vb/cs/js).

          • /protocol: protocol – specifies the payload protocol to be used (SOAP, HttpGet, HttpPost)

          • /namespace: namespace – the namespace of the generated Proxy class.

          • /out: filename – the filename of the Proxy class.
          Proxy Class inclusion

          1. Add the proxy class to the newly created Web Site

          2. Go to Solution Explorer; right click on that solution à click on “Add Reference”. Below pop-up window appears

          1. Clicking “Ok” will include the proxy class to the solution under “Bin folder”.

          2. Now we can use this proxy class and the methods that are there in the web services.


          Note: A proxy class is a class containing all of the methods and objects exposed by the Web service. These methods handle the marshalling of the parameters into SOAP, sending the SOAP request over HTTP, receiving the response from the Web service, and unmarshalling the return value. The proxy class allows the client program to call a Web service as if the Web service was a local component.

          Once you create a proxy class using the .NET command-line tool wsdl.exe , a Web service client may invoke proxy class methods, which communicate with a Web service over the network by processing the SOAP messages sent to and from the Web service.

          Comment

          Working...
          X