Converting a WSDL created client to a pure code one
-
I'm writing a COM component that needs to consume a WCF web service. I was given a WSDL file from the supplier and so my C# project as a Service References component in it. I overlooked the fact that it'd created settings in the config file (I've already added a
RegistrySettingsProvider
component for the other settings I'd needed), so when I came to deploy the DLL onto the server I found I couldn't create the type library. Now I've done some searching and it looks like I can move the config to a code, and useChannelFactory<>
in some form, but I'm not sure what I actually need to do? Do I take the code generated by svcutil and start from there? If someone could give some pointers as to what I'm needing to create I should be able work out the other parts. Could I use the fact I've created aRegistrySettingsProvider
and just move the config file stuff in there somehow? In my code I'm just using the webservice like any other object, once I change to the code based config is this still the case? I.e. will I have to change my existing code at all? Thanks -
I'm writing a COM component that needs to consume a WCF web service. I was given a WSDL file from the supplier and so my C# project as a Service References component in it. I overlooked the fact that it'd created settings in the config file (I've already added a
RegistrySettingsProvider
component for the other settings I'd needed), so when I came to deploy the DLL onto the server I found I couldn't create the type library. Now I've done some searching and it looks like I can move the config to a code, and useChannelFactory<>
in some form, but I'm not sure what I actually need to do? Do I take the code generated by svcutil and start from there? If someone could give some pointers as to what I'm needing to create I should be able work out the other parts. Could I use the fact I've created aRegistrySettingsProvider
and just move the config file stuff in there somehow? In my code I'm just using the webservice like any other object, once I change to the code based config is this still the case? I.e. will I have to change my existing code at all? ThanksStarting with the code generate by svcUtil is generally ok. However, if you are consuming axis web services, more often than not, issues can arise that need some form of customization in the channel, message encoding etc. Consuming a WCF service should be more straightforward and easier,
WP Apps - Color Search | Arctic | XKCD | Sound Meter | Speed Dial