Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WCF ASP.NET4.0
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 8:24am
Edited 6-Feb-13 5:31am
v7
Comments
Jameel Moideen at 5-Feb-13 13:36pm
   
what's the error showing when browsing the url in server?
Sergey Alexandrovich Kryukov at 5-Feb-13 13:40pm
   
"It does not work" is not informative.
—SA
richcb at 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 at 5-Feb-13 16:44pm
   
.svc file is in the web folder. in the console appl, just have the exe and config files
thatraja at 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
0 OriginalGriff 215
1 George Jonsson 175
2 Kornfeld Eliyahu Peter 159
3 PIEBALDconsult 110
4 Richard MacCutchan 85
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 6 Feb 2013
Copyright © CodeProject, 1999-2014
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