简体   繁体   中英

Error after publishing Silverlight application

Hello everybody today i published silverlight application.

When its starts it gives such errors: What you think does it connection string problem or not?

在此处输入图片说明

This is what Fiddler says

Request Count:  3
Bytes Sent:     1,224    (headers:1224; body:0)
Bytes Received: 16,890    (headers:792; body:16098)

URLS:

/client/ClientBin/RoadTrans-Web-DataDomainService.svc/binary/GetTransFul

Statistics:

Request Count:  1
Bytes Sent:     403    (headers:403; body:0)
Bytes Received: 5,630    (headers:264; body:5366)

ACTUAL PERFORMANCE
--------------
ClientConnected:    06:22:36.697
ClientBeginRequest:    06:22:37.428
GotRequestHeaders:    06:22:37.428
ClientDoneRequest:    06:22:37.428
Determine Gateway:    0ms
DNS Lookup:         0ms
TCP/IP Connect:    0ms
HTTPS Handshake:    0ms
ServerConnected:    06:21:35.848
FiddlerBeginRequest:    06:22:37.428
ServerGotRequest:    06:22:37.428
ServerBeginResponse:    06:22:37.443
GotResponseHeaders:    06:22:37.443
ServerDoneResponse:    06:22:37.443
ClientBeginResponse:    06:22:37.443
ClientDoneResponse:    06:22:37.443

    Overall Elapsed:    00:00:00.0150009

RESPONSE CODES
--------------
HTTP/500:     1

RESPONSE BYTES (by Content-Type)
--------------
text/html:    5,366
~headers~:    264

URL:

/client/ClientBin/RoadTrans-Web-DataDomainService.svc/binary/GetPaymentWithCustomer

Statistics:

Request Count:  1
Bytes Sent:     414    (headers:414; body:0)
Bytes Received: 5,630    (headers:264; body:5366)

ACTUAL PERFORMANCE
--------------
ClientConnected:    06:22:37.443
ClientBeginRequest:    06:22:38.834
GotRequestHeaders:    06:22:38.834
ClientDoneRequest:    06:22:38.834
Determine Gateway:    0ms
DNS Lookup:         0ms
TCP/IP Connect:    0ms
HTTPS Handshake:    0ms
ServerConnected:    06:21:35.848
FiddlerBeginRequest:    06:22:38.834
ServerGotRequest:    06:22:38.834
ServerBeginResponse:    06:22:38.846
GotResponseHeaders:    06:22:38.846
ServerDoneResponse:    06:22:38.846
ClientBeginResponse:    06:22:38.846
ClientDoneResponse:    06:22:38.846

    Overall Elapsed:    00:00:00.0120006

RESPONSE CODES
--------------
HTTP/500:     1

RESPONSE BYTES (by Content-Type)
--------------
text/html:    5,366
~headers~:    264

ESTIMATED WORLDWIDE PERFORMANCE

URL:

/client/ClientBin/RoadTrans-Web-DataDomainService.svc/binary/GetCreditorFull

Statistics:

Request Count:  1
Bytes Sent:     407    (headers:407; body:0)
Bytes Received: 5,630    (headers:264; body:5366)

ACTUAL PERFORMANCE
--------------
ClientConnected:    06:22:09.870
ClientBeginRequest:    06:22:38.834
GotRequestHeaders:    06:22:38.834
ClientDoneRequest:    06:22:38.834
Determine Gateway:    0ms
DNS Lookup:         0ms
TCP/IP Connect:    2ms
HTTPS Handshake:    0ms
ServerConnected:    06:22:38.838
FiddlerBeginRequest:    06:22:38.838
ServerGotRequest:    06:22:38.838
ServerBeginResponse:    06:22:38.863
GotResponseHeaders:    06:22:38.863
ServerDoneResponse:    06:22:38.863
ClientBeginResponse:    06:22:38.863
ClientDoneResponse:    06:22:38.864

    Overall Elapsed:    00:00:00.0300017

RESPONSE CODES
--------------
HTTP/500:     1

RESPONSE BYTES (by Content-Type)
--------------
text/html:    5,366
~headers~:    264

ESTIMATED WORLDWIDE PERFORMANCE

I have seen something similar occur because the data sent across the wire was too large for WCF. Can you distill the first call to a hello world method?

BTW if one highlights a message box window and does a CTRL-C, usually the system can copy the erorr text into the clipboard and then later one can paste it into a document without having to do a screen shot. I advise all my test users to do that instead of the screen shot.

Based on the error message, it could be that the WCF Service was not found at the URL specified in the Silverlight client. It could also mean that something failed within the WCF service.

There are two primary ways to troubleshoot WCF issues like this:

1) Use Fiddler to track the traffic between the silverlight client and WCF service. This will often show more detailed information such as the exact URL that is used and IIS responses that otherwise appear to the WCF client as invalid responses.

2) Enable detailed WCF tracing by adding the following block to you web.config's configuration section:

  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="traceListener"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData="c:\log\WebTrace.svclog"  />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

After reproducing the error, double-clicking on the file name specified will show the WCF log viewing application, which you can use to drill into the specific errors that occur. This is particularly helpful when dealing with serialization issues.

Update

Based on the fiddler output (http response 500), the WCF service is throwing an exception. Here is some information from Microsoft on faults in WCF services and how to handle them.

Your next step should be to enable the WCF tracing as shown in item 2 above, then examine the output. You could also check the windows event logs for issues, but I suspect you won't see any.

I also strongly recommend wrapping the body of every WCF service method in a try/catch statement so that you can catch and report bugs in your code intelligently rather than trying to propagate them back to the WCF client, at least until you get the kinks worked out.

If you do want faults propagated back to the WCF client, you should decorate the interface methods with the FaultContract attribute, ie

[FaultContract(typeof(WCFException))]

What would happen when you open (you site)/client/ClientBin/RoadTrans-Web-DataDomainService.svc in broser?

Try open it on server, or enable shown error to all clients (in web.config).

See this video to more tips in WCF Debugging

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM