svcutil, WSDL, and the generated interfaces not being sufficient for implementation
- by chtmd
I have a WSDL file defining a service that I have to implement in WCF. I had read that I could generate the proxy using svcutil from the WSDL file, and that I could then use the generated interfaces to implement the service.
Unfortunately, I can't quite seem to find a way to have the interfaces contain the correct attributes to expose the contracts.
All operations have the "OperationContractAttribute" attribute, but it appears as though for the service to be exposed, I require the "OperationContract" for each one. Same thing with "ServiceContractAttribute" and "ServiceContract", and I imagine DataContract, but I haven't gotten that far.
I could manually make these changes, but I would much prefer a technique where the existing code could be easily used, or better code could be generated for my uses. Is there some way that this can be done?
Thanks.
EDIT:
Command used: svcutil ObjectManagerService.wsdl /n:*,Sample /o:ObjectManagerServiceProxy.cs /nologo
Code sample:
public interface ObjectManagerSyncPortType
{
// CODEGEN: Generating message contract since the operation createObject is neither RPC nor document wrapped.
[System.ServiceModel.OperationContractAttribute(Action="http://www.sample.com/createObject", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
Sample.createObjectResponse1 createObject(Sample.createObjectRequest1 request);
As best as I can tell/see the WSDL file is entirely self-contained and requires no additional XSD files.