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.
LVL 16
Easwaran ParamasivamAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Easwaran ParamasivamAuthor Commented:
Thanks for participation.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.