Referencing web service complex data type within a second web service (like a delegate)

Discussion in 'ASP .Net Web Services' started by Mike Dearman, Jun 21, 2004.

  1. Mike Dearman

    Mike Dearman Guest

    Hi,
    I am trying to figure out if ASP.NET XML Web Services and the WSDL
    standard can handle this type of scenario:

    I have two web services, and one consumer client application. Lets
    call web service 1 "basews", and web service 2 "custom", and the
    client app "client".

    I want basews to define a delegate of sorts (where the delegate
    signature contains complex data types as arguments and return types),
    and then custom ws would conform to the basews delegate signatures, so
    that within client, I can call them similar to how delegates actually
    work in .NET (with the obvious overhead of SOAP, etc).


    If basews has the following pseudo-structure (VB'ish) :

    -----------------
    Class basews
    <WebMethod()> Public Function getComplexDataType(byval req as
    MyRequest) as MyDataType
    ...
    End Class

    Public Class MyDataType
    Public field as String
    ...
    End Class

    Public class MyRequest
    Public field as Integer
    ...
    End Class
    -----------------

    where MyDataType and MyRequest (really can be more complex) are added
    to basews WSDL automatically by .NET.


    Can I create "custom" ws like this:

    -----------------
    Class custom
    <WebMethod()> Public Function customGetComplexDataType(byval req as
    basews.MyRequest) as basews.MyDataType
    ...
    End Class
    -----------------


    such that within "client", it treats the return type of both web
    service's methods as the same type? Or if this is not possible, is
    there a way of at least being able to treat
    basews.MyDataType/MyRequest and custom.MyDataType/MyRequest the same
    so that I only have to write one routine to populate/read MyDataType
    and MyRequest within "client"?

    This is going to be used with dynamic web service binding techniques
    so that I can take an arbitrary WSDL and method names that conform to
    certain signatures (like delegates) and be able to call them
    appropriately.

    Thanks for the replies. Also, if you could copy me at 'mdearman
    NOSPAM at libera.com' I would be grateful so I don't accidently miss
    any replies.
    Mike Dearman, Jun 21, 2004
    #1
    1. Advertising

  2. Mike Dearman

    Mike Dearman Guest

    OK, I found an article in MSDN discussing how to "share types" between
    web services by manually modifying the ASP.NET web service
    Reference.vb. However, this is not very flexible, as it really
    hinders updating any web references without manual editing. Our
    customers will not want to do this manually.

    Does anyone know of any tools or features of VS.NET 2003 to help with
    this problem? Or anyone willing to share experiences of using this
    approach?

    Thanks,
    Mike


    (Mike Dearman) wrote in message news:<>...
    > Hi,
    > I am trying to figure out if ASP.NET XML Web Services and the WSDL
    > standard can handle this type of scenario:
    >
    > I have two web services, and one consumer client application. Lets
    > call web service 1 "basews", and web service 2 "custom", and the
    > client app "client".
    >
    > I want basews to define a delegate of sorts (where the delegate
    > signature contains complex data types as arguments and return types),
    > and then custom ws would conform to the basews delegate signatures, so
    > that within client, I can call them similar to how delegates actually
    > work in .NET (with the obvious overhead of SOAP, etc).
    >
    >
    > If basews has the following pseudo-structure (VB'ish) :
    >
    > -----------------
    > Class basews
    > <WebMethod()> Public Function getComplexDataType(byval req as
    > MyRequest) as MyDataType
    > ...
    > End Class
    >
    > Public Class MyDataType
    > Public field as String
    > ...
    > End Class
    >
    > Public class MyRequest
    > Public field as Integer
    > ...
    > End Class
    > -----------------
    >
    > where MyDataType and MyRequest (really can be more complex) are added
    > to basews WSDL automatically by .NET.
    >
    >
    > Can I create "custom" ws like this:
    >
    > -----------------
    > Class custom
    > <WebMethod()> Public Function customGetComplexDataType(byval req as
    > basews.MyRequest) as basews.MyDataType
    > ...
    > End Class
    > -----------------
    >
    >
    > such that within "client", it treats the return type of both web
    > service's methods as the same type? Or if this is not possible, is
    > there a way of at least being able to treat
    > basews.MyDataType/MyRequest and custom.MyDataType/MyRequest the same
    > so that I only have to write one routine to populate/read MyDataType
    > and MyRequest within "client"?
    >
    > This is going to be used with dynamic web service binding techniques
    > so that I can take an arbitrary WSDL and method names that conform to
    > certain signatures (like delegates) and be able to call them
    > appropriately.
    >
    > Thanks for the replies. Also, if you could copy me at 'mdearman
    > NOSPAM at libera.com' I would be grateful so I don't accidently miss
    > any replies.
    Mike Dearman, Jun 23, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stanimir Stamenkov
    Replies:
    2
    Views:
    734
    Stanimir Stamenkov
    Oct 25, 2005
  2. Daniel Frey
    Replies:
    1
    Views:
    371
    Joe Kesselman
    Feb 10, 2006
  3. Robert Mark Bram
    Replies:
    0
    Views:
    673
    Robert Mark Bram
    Feb 4, 2007
  4. yelipolok
    Replies:
    4
    Views:
    244
    John W. Krahn
    Jan 27, 2010
  5. RWC
    Replies:
    2
    Views:
    77
Loading...

Share This Page