简体   繁体   中英

How to use existing in memory WSDL in order to create WCF service?

1) I know that WSDL file is generated on client side when we want to use existing WCF service. This is in case we use "Add Service Reference..." option in Visual Studio. What I don't understand is - at what moment exactly WSDL file is used when we use the client proxy to invoke WCF service?

2) I don't know how to use or connect or attach existing in memory WSDL in the process of creation WCF service. I mean what should I write? Something like:

Uri mexAddress = new Uri("http://localhost:2240/Service1.svc?wsdl");

or:

Uri mexAddress = new Uri("http://localhost:2240/Service1.svc?" + SomeName.wsdl);

or:

?

Thank you in advance.

Goran

1) I know that WSDL file is generated on client side when we want to use existing WCF service. This is in case we use "Add Service Reference..." option in Visual Studio. What I don't understand is - at what moment exactly WSDL file is used when we use the client proxy to invoke WCF service?

No, the wsdl is generated at server-side. It is the XML based document that describes a Service. It specifies the location of the service and the operation or methods the service exposes. When adding a service reference, Visual Studio (or svcutil) save a copy of this wsdl only for generating a client proxy. The wsdl will never be used after that generation and is not embedded in ressources. You can also create a client proxy without a wsdl.

2) I don't know how to use or connect or attach existing in memory WSDL in the process of creation WCF service. I mean what should I write?

Unclear. What do you mean ? On server-side, WCF will automatically manage the WSDL creation (it is also extensible) when you activate the expostion of metadata .

The WSDL is not used on the client side at run-time to invoke the service. It is only used at design time to generate the client side proxy code to call the service.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM