• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

WCF Issue

Hi Experts,

  I've a WCF service where the [DataContrat] is used as attribute. It works perfectly. Sometime we return byte[] as one of the response object. This slows down. Hece [MessageContract] is used for SOME response objects to return STREAM.

  I tested a simple WCF service with [MessageContract]  alone and it works well.

  But while integrating with my application, as it contains [DataContract] and [MessageContract] in same WCF service there are some error throws. It changes the singnature of the methods who has [DataContract].

   How to resolve the above issue?  Please do guide me.

   Thanks.
0
Easwaran Paramasivam
Asked:
Easwaran Paramasivam
  • 3
  • 2
1 Solution
 
n_vijayCommented:
What is the error ur getting and pin the code with it.
0
 
Easwaran ParamasivamAuthor Commented:
We have done 2 things in our application.

1. Changed the trasfermode from Buffered to Streamed in web.config file
2. Changed [DataContract] to [MessageContract] for some classes.

I noticed one point that MessageContract class contains few members as [MessageHeader] attribute. But actually the member is [DataContract].

Ex:

[MessageContract]
pubic class MyClass
{

  ......

[ MessageHeader]

public AnotherClass anotherclass;


 
}


[DataContract]
pubic class AnotherClass
{


}

Will the above scenario creates any issue?

Below are some sample errors we get

Argument 1: cannot convert from 'int' to 'Namespace.SomeClass'
No overload for method 'AdvanceContentSearch' takes 2 arguments.

But all those methods were working fine previously I mean all classes were [DataContract] .

Please let me know if you want any more details to resolve the same.
0
 
n_vijayCommented:
post the method  AdvanceContentSearch code:

i.e. the method which is getting exposed, in that you have passing wrong arguments.

0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
Easwaran ParamasivamAuthor Commented:
Please do clarify below question.

We have done 2 things in our application.

1. Changed the trasfermode from Buffered to Streamed in web.config file
2. Changed [DataContract] to [MessageContract] for some classes.

I noticed one point that MessageContract class contains few members as [MessageHeader] attribute. But actually the member is [DataContract].

Ex:

[MessageContract]
pubic class MyClass
{

  ......

[ MessageHeader]

public AnotherClass anotherclass;


 
}


[DataContract]
pubic class AnotherClass
{


}

Will the above scenario creates any issue?
0
 
Easwaran ParamasivamAuthor Commented:
Thanks for participation.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now