Question : Help with Web Service configuration please

I cannot for the life of me get my Silverlight 2 project to see my web service. I'm sure it's something I'm doing wrong with the configuration. I have the web service sitting at wwwroot/Services/FileReceiver.svc - I constantly get a "not found" error. Also, when I try to add a service reference to the web service, it keeps adding the address as http://localhost:54834/Services/FileReceiver.svc/mex . If I remove the /mex and click ok, I get a "configuration error" and it won't allow me to save the change. Can anyone see what I'm doing wrong?? This is the first time I've tried to create a web service. (if you need to see any additional code please let me know)

This is what I have in my web.config.


aspNetCompatibilityEnabled="true" />







ults="false"/>


iors>
 







maxBytesPerRead="4096" maxNameTableCharCount="16384" />


realm="">










maxSessionSize="2147483647" />
>nsport>









name="AMS_SL3_new.Web.Services.FileReceiver">
contract="AMS_SL3_new.Web.Services.IFileReceiver">













This is what I have in my ServiceReference.ClientConfig (the port is correct)









maxReceivedMessageSize="2147483647">














http://localhost:54834/Services/FileReceiver.svc"

binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFileReceiver"

contract="FileReceiver.IFileReceiver" name="BasicHttpBinding_IFileReceiver" />





This is my Web Service markup

<%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory, System.Data.Services, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Service="AMS_SL3_new.Web.Services.FileReceiver" %>

This is my Web Service

using System;

using System.Collections.Generic;

using System.Linq;

using System.Runtime.Serialization;

using System.ServiceModel;

using System.Text;

using System.IO;

using System.ServiceModel.Activation;

using System.Web;

namespace AMS_SL3_new.Web.Services
{

 

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
// NOTE: If you change the class name "FileReceiver" here, you must also update the reference to "FileReceiver" in Web.config.

public class FileReceiver : IFileReceiver

{

#region IFileReceiver Memberspublic UploadResponse BeginUpload(ChunkUploadRequest request)
{

UploadResponse resp = new UploadResponse();

try

{

//you could validate credentials here.

//request.Credentials

UploadProcessor proc = new UploadProcessor(); //sets up destination and initializes the file.

if (proc.ProcessChunk(request.Chunk, request.Hash))
{

resp.Token = proc.Token;

resp.Status = Enums.ResponsStatus.Success; //continue uploading.

}

else

{

resp.Status = Enums.ResponsStatus.Fail;resp.Message = "Couldn't handle chunk.";
}

}

catch (Exception ex)
{

resp.Status = Enums.ResponsStatus.Fail;
resp.Message = ex.Message;

}

return resp;
}

public UploadResponse ContinueUpload(ChunkUploadRequest request)
{

UploadResponse resp = new UploadResponse();
try

{

UploadProcessor proc = new UploadProcessor(request.Token);if (proc.ProcessChunk(request.Chunk, request.Hash))
{

resp.Status = Enums.ResponsStatus.Success;
resp.Token = proc.Token;

}

else

{

resp.Status = Enums.ResponsStatus.Fail;resp.Message = "failed chunk send.";
}

}

catch (Exception ex)
{

resp.Status = Enums.ResponsStatus.Fail;
resp.Message = ex.Message;

}

return resp;
}

public FinishResponse FinishUpload(FinishRequest request)
{

FinishResponse resp = new FinishResponse();
try

{

UploadProcessor proc = new UploadProcessor(request.Token);if (proc.Finish(request.FullHash, request.Extension))
{

resp.Status = Enums.ResponsStatus.Success;
resp.NewFilename = proc.Filename;

}

else

{

resp.Status = Enums.ResponsStatus.FailFullHashCheck;resp.Message = "Failed wrap-up procress.";
}

}

catch (Exception ex)
{

resp.Status = Enums.ResponsStatus.Fail;
resp.Message = ex.Message;

}

return resp;
}

#endregion

}

}

Answer : Help with Web Service configuration please

Disregard my previous post "Do not set the buffer in web.config of asp.net web application which host the wcf."

Take higher values from my last post and use those in Binding.  And follow the code in Web.config and ServiceReferece.ClientConfig as much as possible.

HTH
Ashok
Random Solutions  
 
programming4us programming4us