Click here to Skip to main content
12,953,007 members (36,374 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
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
Posted 5-Feb-13 7:24am
Updated 6-Feb-13 4:31am
v7
Comments
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.
—SA
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?

1 solution

Rate this: bad
 
good
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
 
<system.diagnostics>
    <sources>
      <source name="System.ServiceModel">
              switchValue="Information, ActivityTracing"
              propagateActivity="true" >
        <listeners>
             <add name="xml" />
        </listeners>
      </source>
      <source name="System.ServiceModel.MessageLogging">
        <listeners>
            <add name="xml" />
        </listeners>
      </source>
      <source name="myUserTraceSource">
              switchValue="Information, ActivityTracing">
        <listeners>
            <add name="xml" />
        </listeners>
      </source>
    </sources>
    <sharedlisteners>
        <add name="xml">
             type="System.Diagnostics.XmlWriterTraceListener"
             initializeData="Error.svclog" />
    </add></sharedlisteners>
  </system.diagnostics>
  Permalink  

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
OriginalGriff 6,389
CHill60 3,490
Maciej Los 3,103
Jochen Arndt 1,975
ppolymorphe 1,920


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 6 Feb 2013
Copyright © CodeProject, 1999-2017
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