svcutil, WSDL, and the generated interfaces not being sufficient for implementation

Posted by chtmd on Stack Overflow See other posts from Stack Overflow or by chtmd
Published on 2010-03-31T19:37:51Z Indexed on 2010/03/31 19:53 UTC
Read the original article Hit count: 490

Filed under:
|
|
|
|

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.

© Stack Overflow or respective owner

Related posts about svcutil

Related posts about wcf