Red Swan
Red Swan

Reputation: 15553

WCF web service not performing serialization properly

i have the WCF web service within my solution. service has interface which implemeted in service class. i added few new methods in interface as well as implemented in service class. i can access if i use the sevice dll reference to my asp.net mvc 3 application. but after deployment and adding the service reference of service i am unable to get the newly added methods. by creating the client object . why should this happening? I deployed service at remote server.

I checked in wsdl also, but could not found metadata about the newly added methods.

Edited: Well well well... I don't know what happened and somehow i got the serialized objects what i expected now. but when i am performing any operation with these objects I am getting problem that unable to connect to service.

    "An error occurred while receiving the HTTP response to http://MyServer/MyAdminService.svc.
 This could be due to the service endpoint binding not using the HTTP protocol.
 This could also be due to an HTTP request context being aborted by the server 
(possibly due to the service shutting down). See server logs for more details."

Inner Exception: 

"The underlying connection was closed: An unexpected error occurred on a receive"

why should this? what are the necessary attributes int he web.config need to establish the connection between clent and server objects ?

Resolved: http://lalitcdhake.blogspot.com/2011/10/serialization-with-entity-framework-4.html

Cheers

Upvotes: 0

Views: 861

Answers (3)

Kenneth Ito
Kenneth Ito

Reputation: 5261

I think you have a deployment issue. Some things to try.

  1. Confirm your methods are available in your local wsdl. If the methods are available locally your problem has nothing to do with serialization.
  2. Confirm the remote server you deployed to is in fact what you are looking at when you check the remote wsdl. There are many ways to do this but a simple one would be to introduce an error into web config and confirm the app goes down (if this is a dev server and taking down the app is not harmful).

Upvotes: 0

Giedrius
Giedrius

Reputation: 8550

Have you marked new methods with OperationContract attribute? Sample from msdn:

[ServiceContract(Namespace="Microsoft.WCF.Documentation")]
  public interface ISampleService{
    // This operation specifies an explicit protection level requirement.
    [OperationContract]
    string SampleMethod(string msg);
  }

  class SampleService : ISampleService
  {
  #region ISampleService Members

  public string  SampleMethod(string msg)
  {
    Console.WriteLine("Called with: {0}", msg);
      return "The service greets you: " + msg;
  }

  #endregion
  }

Upvotes: 0

Related Questions