wsdl /sharetypes

B

Boni

Hi,
I tried to use this command to share the tpyes beetwen webservice and
clients but I found only examples where the command is used to share types
beetwen two webservices.

I can do this changing the proxy generated by VS but I'm looking for a way
to do it automatically.

Example
namespaceC
class Result
namespaceWS
funtcion X that return namespaceC.Result
namespaceCL
client that call X function using the namespaceC.Result returned object

thank's to everyone
il.Boni
 
J

John Saunders

Boni said:
Hi,
I tried to use this command to share the tpyes beetwen webservice and
clients but I found only examples where the command is used to share types
beetwen two webservices.

I can do this changing the proxy generated by VS but I'm looking for a way
to do it automatically.

Example
namespaceC
class Result
namespaceWS
funtcion X that return namespaceC.Result
namespaceCL
client that call X function using the namespaceC.Result returned
object

You can't really do what you're trying to do, not in general.

The types on the client are not meant to be the same as those on the server.
Consider the case where the client and server are on different platforms. A
Java client could not share types with a .NET service.

The client types are proxy types. They are simply a convenience for working
with the XML messages that are what is actually exchanged between the client
and the server. They are not the same type. This is because the proxy types
are created from the WSDL, and the WSDL only has enough information in it to
describe the XML that will be exchanged - it has no information on the
server types that are being serialized into the XML, so could not recreate
those types on the client.

WCF permits something like this when you add a service reference. In the
Advanced tab, it allows you to reuse certain types. I do not know exactly
how this works. I presume that what it does is to allow XML from the server
to be deserialized into types that already exist on the client, assuming
those types are compatible.

Even in this case, these are not exactly the same type. The client has one
copy of the type and the server has another. They may even be different
versions of the same type. They are compatible types, but not necessarily
the same.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top