I have a c# asp.net web application/projct which is working well. Later I added a wcf service as new item to this proj. Then I add a new simple Console application to this solution to consume the wcf. It works fine in my local. (My local server name is A. Using http://A/MyProjName/wcfSendRpt.svc OR http://localhost/MyProjName/wcfSendRpt.svc both Okay).
Then I published my web application( with the wcf service) to live server B. (B just host this only web-application. ) Both http://B/wcfSendRpt.svc OR http://localhost/wcfSendRpt.svc works fine.
Then I deployed my Console application to server B. ( I just copyed the exe and config files to sever B). I changed the endpoint address in config file from "http://A/MyProjName/wcfSendRpt.svc" to "http://B/wcfSendRpt.svc" like below
<endpoint address="http://B/wcfSendRpt.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IwcfSendRpt"
contract="nsSendRpt.IwcfSendRpt" name="BasicHttpBinding_IwcfSendRpt" />
But it doesn't work. The error from event view is like below,
Unhandled Exception: System.ServiceModel.FaultException`1[System.ServiceModel.Ex
ceptionDetail]: An error occurred while executing the command definition. See th
e inner exception for details.
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message
reply, MessageFault fault, String action, MessageVersion version, FaultConverte
r faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRunt
ime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on
eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan tim
eout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCall
Message methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
at CAScheduledService.nsSendRpt.IwcfSendRpt.SendRpt(String statementdate)
at CAScheduledService.Program.Main(String[] args)
My console application is very simple: the code is like below
class Program
{
static void Main(string[] args)
{
nsSendRpt.IwcfSendRptClient ss = new IwcfSendRptClient();
string a = ss.SendRpt(System.DateTime.Now.ToString("yyyyMMdd"));
ss.Close();
}
}
I need your help to solve this. And I am pretty new in wcf. Is this wcf service in my web application is restful?
Thanks a lot