LCJ
LCJ

Reputation: 22652

Changing name of Message Part element

I have a WCF service as shown below. It generates the following WSDL.

Based on the naming conventions in the organization, I need the element name to be "tns:GetDataUsingDataContractInput" instead of ="tns:GetDataUsingDataContract" (i.e, the word “Input” need to be appended. )

How can we do it using C# Code? Also, the corresponding xsd generated should reflect this change.

[ServiceContract]
public interface IService1
{
    [OperationContract]
    CompositeType GetDataUsingDataContract(CompositeType composite);
}

WSDL

enter image description here

REFERENCE

  1. Understanding WSDL http://msdn.microsoft.com/en-us/library/ms996486.aspx

Upvotes: 1

Views: 1773

Answers (1)

MisterIsaak
MisterIsaak

Reputation: 3922

I'm not entirely sure I understand your question but could it be as simple as doing:

[ServiceContract]
public interface IService1
{
    [OperationContract(Name="GetDataUsingDataContractInput")]   
    CompositeType GetDataUsingDataContract(CompositeType composite);
}

Upvotes: 1

Related Questions