Click here to Skip to main content
13,401,175 members (50,406 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have a c# 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
   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"));

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
Posted 5-Feb-13 8:24am
Updated 6-Feb-13 5:31am
Jameel Moideen 5-Feb-13 13:36pm
what's the error showing when browsing the url in server?
"It does not work" is not informative.
richcb 5-Feb-13 14:07pm
While your problem is not described well, I still want to ask if you have an SVC File in the folder where your application files live on the live B server?
lmik9898 5-Feb-13 16:44pm
.svc file is in the web folder. in the console appl, just have the exe and config files
thatraja 5-Feb-13 14:31pm
error message?
arnavs 5-Feb-13 22:09pm
I think you are missing some assembly reference deployed to the server.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

After all, I figured it by myself. The problem is that there is table's column name different from the live one. But without tracing I can't find the problem. So I add this to config file
      <source name="System.ServiceModel">
              switchValue="Information, ActivityTracing"
              propagateActivity="true" >
             <add name="xml" />
      <source name="System.ServiceModel.MessageLogging">
            <add name="xml" />
      <source name="myUserTraceSource">
              switchValue="Information, ActivityTracing">
            <add name="xml" />
        <add name="xml">
             initializeData="Error.svclog" />

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180218.2 | Last Updated 6 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100