Using User-Defined Data Type

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Serkan DIRIARIN

    Using User-Defined Data Type

    hi! i have created a document class. I have a .net client application and a
    web service. Both of them using same object model and referencing a
    doctypes.dll file. But when i want to run a client application getting
    error InvalidCastExce ption. I deleted class declaration in reference.vb in
    web reference defination and reference my document dll file, altough it is
    still has error... What is the problem..

    thanks....

    Serkan


  • Marvin Smit

    #2
    Re: Using User-Defined Data Type

    Hi Serkan,

    the issue here is you are trying to share a class, not a type.

    By deleting the "generated class based on the type specified by the
    WebService" you essentially invalidate the proxy you created.

    When dealing with WebServices, you (exceptions left alone) generally
    share a WSDL file. NOT the assembly with the dataclasses exposed by
    the WebService.

    The WSDL file is then used on the client for generating "Proxy
    classes" for you. These classes are NOT THE SAME classes as the server
    exposes, but ARE THE SAME TYPES.

    The framework will take care of serializing & deserializing. U can
    just deal with "objects" in your code on both Server & Client side.

    Hope this helps,

    Marvin Smit.


    On Fri, 17 Jun 2005 23:36:32 +0300, "Serkan DIRIARIN"
    <activex@supero nline.com> wrote:
    [color=blue]
    >hi! i have created a document class. I have a .net client application and a
    >web service. Both of them using same object model and referencing a
    >doctypes.dll file. But when i want to run a client application getting
    >error InvalidCastExce ption. I deleted class declaration in reference.vb in
    >web reference defination and reference my document dll file, altough it is
    >still has error... What is the problem..
    >
    >thanks....
    >
    >Serkan
    >[/color]

    Comment

    • Marvin Smit

      #3
      Re: Using User-Defined Data Type

      Hi Serkan,

      the issue here is you are trying to share a class, not a type.

      By deleting the "generated class based on the type specified by the
      WebService" you essentially invalidate the proxy you created.

      When dealing with WebServices, you (exceptions left alone) generally
      share a WSDL file. NOT the assembly with the dataclasses exposed by
      the WebService.

      The WSDL file is then used on the client for generating "Proxy
      classes" for you. These classes are NOT THE SAME classes as the server
      exposes, but ARE THE SAME TYPES.

      The framework will take care of serializing & deserializing. U can
      just deal with "objects" in your code on both Server & Client side.

      Hope this helps,

      Marvin Smit.


      On Fri, 17 Jun 2005 23:36:32 +0300, "Serkan DIRIARIN"
      <activex@supero nline.com> wrote:
      [color=blue]
      >hi! i have created a document class. I have a .net client application and a
      >web service. Both of them using same object model and referencing a
      >doctypes.dll file. But when i want to run a client application getting
      >error InvalidCastExce ption. I deleted class declaration in reference.vb in
      >web reference defination and reference my document dll file, altough it is
      >still has error... What is the problem..
      >
      >thanks....
      >
      >Serkan
      >[/color]

      Comment

      • newbie

        #4
        Re: Using User-Defined Data Type

        I think I am facing the same problem:
        A library defines a type. That type is being returned by a method of a
        webservice and being used by a client of that webservice.
        My issue appears earlier; at compile time; when I receive a "Class1 is an
        ambiguous type" when I try to compile the client app. (Class1 is the type
        defined in my library).

        Is it something I shouldn't be doing?

        "Serkan DIRIARIN" <activex@supero nline.com> wrote in message
        news:%23bx7rx3c FHA.3488@tk2msf tngp13.phx.gbl. ..[color=blue]
        > hi! i have created a document class. I have a .net client application and
        > a web service. Both of them using same object model and referencing a
        > doctypes.dll file. But when i want to run a client application getting
        > error InvalidCastExce ption. I deleted class declaration in reference.vb in
        > web reference defination and reference my document dll file, altough it is
        > still has error... What is the problem..
        >
        > thanks....
        >
        > Serkan
        >[/color]


        Comment

        • newbie

          #5
          Re: Using User-Defined Data Type

          I think I am facing the same problem:
          A library defines a type. That type is being returned by a method of a
          webservice and being used by a client of that webservice.
          My issue appears earlier; at compile time; when I receive a "Class1 is an
          ambiguous type" when I try to compile the client app. (Class1 is the type
          defined in my library).

          Is it something I shouldn't be doing?

          "Serkan DIRIARIN" <activex@supero nline.com> wrote in message
          news:%23bx7rx3c FHA.3488@tk2msf tngp13.phx.gbl. ..[color=blue]
          > hi! i have created a document class. I have a .net client application and
          > a web service. Both of them using same object model and referencing a
          > doctypes.dll file. But when i want to run a client application getting
          > error InvalidCastExce ption. I deleted class declaration in reference.vb in
          > web reference defination and reference my document dll file, altough it is
          > still has error... What is the problem..
          >
          > thanks....
          >
          > Serkan
          >[/color]


          Comment

          • Marvin Smit

            #6
            Re: Using User-Defined Data Type

            Hi,

            The "Class1" is ambiguous issue might also come from, using the
            "Class1" as declerator while multiple namespaces in scope expose a
            "Class1" class.

            So, if you have

            #using Library1;
            #using Library2;

            Class1 myClass1 = new Class1();


            And both Library1 and Library2 contain a class call "Class1", you'll
            get this error.

            Hope this helps,

            Marvin Smit


            On Thu, 23 Jun 2005 12:48:50 -0000, "newbie" <boninf@mtn.co. ug> wrote:
            [color=blue]
            >I think I am facing the same problem:
            >A library defines a type. That type is being returned by a method of a
            >webservice and being used by a client of that webservice.
            >My issue appears earlier; at compile time; when I receive a "Class1 is an
            >ambiguous type" when I try to compile the client app. (Class1 is the type
            >defined in my library).
            >
            >Is it something I shouldn't be doing?
            >
            >"Serkan DIRIARIN" <activex@supero nline.com> wrote in message
            >news:%23bx7rx3 cFHA.3488@tk2ms ftngp13.phx.gbl ...[color=green]
            >> hi! i have created a document class. I have a .net client application and
            >> a web service. Both of them using same object model and referencing a
            >> doctypes.dll file. But when i want to run a client application getting
            >> error InvalidCastExce ption. I deleted class declaration in reference.vb in
            >> web reference defination and reference my document dll file, altough it is
            >> still has error... What is the problem..
            >>
            >> thanks....
            >>
            >> Serkan
            >>[/color]
            >[/color]

            Comment

            • Marvin Smit

              #7
              Re: Using User-Defined Data Type

              Hi,

              The "Class1" is ambiguous issue might also come from, using the
              "Class1" as declerator while multiple namespaces in scope expose a
              "Class1" class.

              So, if you have

              #using Library1;
              #using Library2;

              Class1 myClass1 = new Class1();


              And both Library1 and Library2 contain a class call "Class1", you'll
              get this error.

              Hope this helps,

              Marvin Smit


              On Thu, 23 Jun 2005 12:48:50 -0000, "newbie" <boninf@mtn.co. ug> wrote:
              [color=blue]
              >I think I am facing the same problem:
              >A library defines a type. That type is being returned by a method of a
              >webservice and being used by a client of that webservice.
              >My issue appears earlier; at compile time; when I receive a "Class1 is an
              >ambiguous type" when I try to compile the client app. (Class1 is the type
              >defined in my library).
              >
              >Is it something I shouldn't be doing?
              >
              >"Serkan DIRIARIN" <activex@supero nline.com> wrote in message
              >news:%23bx7rx3 cFHA.3488@tk2ms ftngp13.phx.gbl ...[color=green]
              >> hi! i have created a document class. I have a .net client application and
              >> a web service. Both of them using same object model and referencing a
              >> doctypes.dll file. But when i want to run a client application getting
              >> error InvalidCastExce ption. I deleted class declaration in reference.vb in
              >> web reference defination and reference my document dll file, altough it is
              >> still has error... What is the problem..
              >>
              >> thanks....
              >>
              >> Serkan
              >>[/color]
              >[/color]

              Comment

              Working...