WCF SOAP Service

I am working on a WCF SOAP service, and I noticed something weird.

I have the following code in my service contract

[ServiceContract]
public interface IService
{
   [OperationContract]
   int MethodA(int a, int b);

   [OperationContract]
   string MethodB(int a, int b);
}

I am not going to give the implemented service class because the implemented MethodA and MethodB are trivial and could do anything.

When I chose to "Add Web Reference" and create a proxy reference in an ASP.NET application that I am using to consume the services, I noticed that the two methods have different arguments on their signature.

For example:

MethodA has the following signature options

MethodA(int a,bool aSpecified,int b,bool bSpecified)

and MethodB only has the following signature

MethodB(int a,bool aSpecified,int b,bool bSpecified,out int MethodBResult,bool methodBResultSpecified)

Why would they have different options for signatures?

I need MethodB signature to be the same as MethodA.

what would I need to provide for the last two parameters?

Answers


If you're consuming a WCF service, you should use the "Add Service Reference" (instead of "Add Web Reference" to create a proxy to the service. Those *specified parameters are added for the "old-style" proxies because you could prevent the parameters from being sent to the service (see some answers at the post What are these extra parameters in my ASMX Proxy Methods? for more information)


Need Your Help

What is the best way to get a content object's position in the parent? Plone 4

indexing position plone catalog plone-4.x

I am traversing folders with content items within them. I use the portal_catalog to get brains searched on certain paths. The brains have access to metadata, and brain.getObject() will return the

Search within list c++?

c++ search element stdlist

Thanks for looking at my question in advance.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.