1

Does anybody know how to dynamically invoke WCF service using existing wsdl file? Thus, I don't need to use "Add Service Reference...". Everything should be done dynamically.

I've searched the internet and haven't found anything that is similar to:

EndpointAddress address = new EndpointAddress("http://localhost:3929/Service1.svc?wsdl");

I use VS2008 (.NET 3.5).

Thank you in advance.

Goran

tesicg
  • 3,971
  • 16
  • 62
  • 121

1 Answers1

-1

If you take a look at the Channel Factory this should be what you need.

David Martin
  • 11,764
  • 1
  • 61
  • 74
  • -1 This answer is not useful in it's current form. To use channelfactory you first require knowledge of the types exposed on the service operations. It is clear from OP's question that he don't have this knowledge except that what is available via the wsdl definition. The OP is asking primarily about how to infer types from WSDL, and secondarily about how to call the service. – tom redfern Oct 01 '12 at 08:03
  • Yes. You're right. Actually, we only have XSD files (types) and WSDL file (operations ant other stuff). At this moment I only need to see working code sample how to invoke WCF service based on WSDL file. – tesicg Oct 01 '12 at 10:12
  • I see what @hugh is saying, fair point. Could you just clarify what you need, if you have both the wsdl and associated xsd then you can build a proxy class using svcutil, but then I don't see how the dynamic issue comes about? – David Martin Oct 02 '12 at 12:33