WCF: The server method 'MyMethod' failed - wcf

The WCF service is deployed on different machine.
Im able to get the http://MyServer/MYService.svc/jsdebug file by giving
<identity>
<dns value="ServerName and the portnumber"/>
And I'm able to invoke the service method using javascript.
After invoking the MyMethod.
I get this error in the javascript --> The server method 'MyMethod' failed, status 404 (in failedCallback)
MyMethod returns a Boolean value in svc.cs file after performing a datacheck.
These are the errors came up when I used Firefox Firebug:
When I call the same service using VS2008 in my development environment it works fine.
I found that following are the files which are not loading while using Ajax enabled VS2005
1) MicrosoftAjax.debug.js(3.5)
2) MicrosoftAjaxWebForms.debug.js(3.5) During runtime
Its obvious that 3.5 debug files doesn't load but, 1.0.6 debug files should load without the errors displayed below.
invokeCalledTwice":"Cannot call invoke more than once.",
11"webServiceFailed":"The server method \u0027{0}\u0027 failed with the following error: {1}",
12"argumentType":"Object cannot be converted to the required type.",
13"argumentNull":"Value cannot be null.",
14"controlCantSetId":"The id property can\u0027t be set on a control.",
15"formatBadFormatSpecifier":"Format specifier was invalid.",
16"webServiceFailedNoMsg":"The server method \u0027{0}\u0027 failed.",
17"argumentDomElement":"Value must be a DOM element.",
18"invalidExecutorType":"Could not create a valid Sys.Net.WebRequestExecutor from: {0}.",
19"cannotCallBeforeResponse":"Cannot call {0} when responseAvailable is false.",
20"actualValue":"Actual value was {0}.",
21"enumInvalidValue":"\u0027{0}\u0027 is not a valid value for enum {1}.",
22"scriptLoadFailed":"The script \u0027{0}\u0027 could not be loaded.",
23"parameterCount":"Parameter count mismatch.",
24"cannotDeserializeEmptyString":"Cannot deserialize empty string.",
25"formatInvalidString":"Input string was not in a correct format.",
26"invalidTimeout":"Value must be greater than or equal to zero.",
27"cannotAbortBeforeStart":"Cannot abort when executor has not started.",
28"argument":"Value does not fall within the expected range.",
29"cannotDeserializeInvalidJson":"Cannot deserialize. The data does not correspond to valid JSON.",
30"invalidHttpVerb":"httpVerb cannot be set to an empty or null string.",
31"nullWebRequest":"Cannot call executeRequest with a null webRequest.",
32"eventHandlerInvalid":"Handler was not added through the Sys.UI.DomEvent.addHandler method.",
33"cannotSerializeNonFiniteNumbers":"Cannot serialize non finite numbers.",
34"argumentUndefined":"Value cannot be undefined.",
35"webServiceInvalidReturnType":"The server method \u0027{0}\u0027 returned an invalid type. Expected type: {1}",
36"servicePathNotSet":"The path to the web service has not been set.",
37"argumentTypeWithTypes":"Object of type \u0027{0}\u0027 cannot be converted to type \u0027{1}\u0027.",
38"cannotCallOnceStarted":"Cannot call {0} once started.",
39"badBaseUrl1":"Base URL does not contain ://.",
40"badBaseUrl2":"Base URL does not contain another /.",
41"badBaseUrl3":"Cannot find last / in base URL.",
42"setExecutorAfterActive":"Cannot set executor after it has become active.",
43"paramName":"Parameter name: {0}",
44"cannotCallOutsideHandler":"Cannot call {0} outside of a completed event handler.",
45"format":"One of the identified items was in an invalid format.",
46"assertFailedCaller":"Assertion Failed: {0}\r\nat {1}",
47"argumentOutOfRange":"Specified argument was out of the range of valid values.",
48"webServiceTimedOut":"The server method \u0027{0}\u0027 timed out.",
49"notImplemented":"The method or operation is not implemented.",
50"assertFailed":"Assertion Failed: {0}",
51"invalidOperation":"Operation is not valid due to the current state of the object.",
52"breakIntoDebugger":"{0}\r\n\r\nBreak into debugger?"
Appreciate your inputs.

Seeing as you have Firebug installed, you can use it to check the HTTP request and response to see if they contain more information about what went wrong.

These are the errors came up when I used Firefox Firebug:
When I call the same service using VS2008 in my development environment it works fine.
I found that following are the files which are not loading while using Ajax enabled VS2005
1) MicrosoftAjax.debug.js(3.5)
2) MicrosoftAjaxWebForms.debug.js(3.5) During runtime
Its obvious that 3.5 debug files doesn't load but, 1.0.6 debug files should load without the errors displayed below.
invokeCalledTwice":"Cannot call invoke more than once.",
11"webServiceFailed":"The server method \u0027{0}\u0027 failed with the following error: {1}",
12"argumentType":"Object cannot be converted to the required type.",
13"argumentNull":"Value cannot be null.",
14"controlCantSetId":"The id property can\u0027t be set on a control.",
15"formatBadFormatSpecifier":"Format specifier was invalid.",
16"webServiceFailedNoMsg":"The server method \u0027{0}\u0027 failed.",
17"argumentDomElement":"Value must be a DOM element.",
18"invalidExecutorType":"Could not create a valid Sys.Net.WebRequestExecutor from: {0}.",
19"cannotCallBeforeResponse":"Cannot call {0} when responseAvailable is false.",
20"actualValue":"Actual value was {0}.",
21"enumInvalidValue":"\u0027{0}\u0027 is not a valid value for enum {1}.",
22"scriptLoadFailed":"The script \u0027{0}\u0027 could not be loaded.",
23"parameterCount":"Parameter count mismatch.",
24"cannotDeserializeEmptyString":"Cannot deserialize empty string.",
25"formatInvalidString":"Input string was not in a correct format.",
26"invalidTimeout":"Value must be greater than or equal to zero.",
27"cannotAbortBeforeStart":"Cannot abort when executor has not started.",
28"argument":"Value does not fall within the expected range.",
29"cannotDeserializeInvalidJson":"Cannot deserialize. The data does not correspond to valid JSON.",
30"invalidHttpVerb":"httpVerb cannot be set to an empty or null string.",
31"nullWebRequest":"Cannot call executeRequest with a null webRequest.",
32"eventHandlerInvalid":"Handler was not added through the Sys.UI.DomEvent.addHandler method.",
33"cannotSerializeNonFiniteNumbers":"Cannot serialize non finite numbers.",
34"argumentUndefined":"Value cannot be undefined.",
35"webServiceInvalidReturnType":"The server method \u0027{0}\u0027 returned an invalid type. Expected type: {1}",
36"servicePathNotSet":"The path to the web service has not been set.",
37"argumentTypeWithTypes":"Object of type \u0027{0}\u0027 cannot be converted to type \u0027{1}\u0027.",
38"cannotCallOnceStarted":"Cannot call {0} once started.",
39"badBaseUrl1":"Base URL does not contain ://.",
40"badBaseUrl2":"Base URL does not contain another /.",
41"badBaseUrl3":"Cannot find last / in base URL.",
42"setExecutorAfterActive":"Cannot set executor after it has become active.",
43"paramName":"Parameter name: {0}",
44"cannotCallOutsideHandler":"Cannot call {0} outside of a completed event handler.",
45"format":"One of the identified items was in an invalid format.",
46"assertFailedCaller":"Assertion Failed: {0}\r\nat {1}",
47"argumentOutOfRange":"Specified argument was out of the range of valid values.",
48"webServiceTimedOut":"The server method \u0027{0}\u0027 timed out.",
49"notImplemented":"The method or operation is not implemented.",
50"assertFailed":"Assertion Failed: {0}",
51"invalidOperation":"Operation is not valid due to the current state of the object.",
52"breakIntoDebugger":"{0}\r\n\r\nBreak into debugger?"

Related

Spring RestController response mixed with PrometheusMeterRegistry error message

Env: Springboot-2.0.7.RELEASE (embedded tomcat-8.5.35), JDK-1.8.0_181, micrometer-registry-prometheus-1.0.8
Desc: using #Timed on controller method and WebMvcMetricsFilter with custom WebMvcTagsProvider.
Demo project: https://github.com/kenix/resp-mix
If PrometheusMeterRegistry already created a meter with a set of tags, it won't create another meter with same name and a set of different tags. It throws IllegalArgumentException with the aforementioned reason. This happens after the normal processing of request, which is successful (response now has the converted JSON). The exception isn't caught in spring's WebMvcMetricsFilter (i.e. catch the exception in its catch-clause. BTW, ControllerAdvice doesn't help), but is caught by tomcat's StandardHostValve, which renders his own error message (it cannot know where this exception is from) into response too. This leads to an illegal JSON as the rendered result.
Question 1: should WebMvcMetricsFilter catch and handle this Exception thrown by PrometheusMeterRegistry and not throw it further up?
Question 2: have seen that exception in filter chain before hitting the actual processing is handled as expected. What about exception after a successful actual processing? Any references?
To trigger this case:
curl -i localhost:8080/hi/foo/there
curl -i localhost:8080/hi/blah/there
Question 1: No, WebMvcTagsProvider handles HTTP Exceptions.
Question 2: Try using ControllerAdvice and catch the IllegalArgumentException there.

Get a 'clear' error message in Lua

I am using the error function in quite a few of my functions and would like to propagate the error messages to the user. However, I obviously don't want to include information about where the error occured exactly; this information should only go to the log files.
For example, I have a class that manages the connection to a server. If the connection times out, it calls
error("Connection timed out!")
The error message is then caught by the calling code via pcall. However, the message contains not only the message I passed, but also the name of the file that caused the error and the line number:
common/net/enetclient.lua:21: Connection timed out!
The question is: Is there any way to only retrieve the error message itself, or do I have to do this manually like following:
local status, msg = pcall(someFunctionThatThrowsErrors)
if not status then
local file, msg = msg:match("(.-:%d+): (.+)")
print("Error: " .. msg)
end
Cheers,
From the documentation of the error function:
error (message [, level])
Terminates the last protected function called and returns message as the error message. Function error never returns.
Usually, error adds some information about the error position at the beginning of the message, if the message is a string. The level argument specifies how to get the error position. With level 1 (the default), the error position is where the error function was called. Level 2 points the error to where the function that called error was called; and so on. Passing a level 0 avoids the addition of error position information to the message.
From what is stated in the second paragraph, adding a level of 0 to the error call will result in the desired output:
error("Connection timed out!", 0)

Yodlee executeUserSearchRequest error

I try to get information from Yodlee API.
I have a test user where I've implemented adding an account and I got refresh OK from the site:
{ siteRefreshStatus: {
siteRefreshStatusId: 8
siteRefreshStatus: "REFRESH_COMPLETED_WITH_UNCERTAIN_ACCOUNT"
}
- siteRefreshMode: {
refreshModeId: 2
refreshMode: "NORMAL"
}
- updateInitTime: 0
nextUpdate: 1391603301
code: 403
noOfRetry: 0
}
}
Now when I try to perform search and get the actual transactions I get this error:
{
errorOccured: "true"
exceptionType: "com.yodlee.core.IllegalArgumentValueException"
refrenceCode: "_57c250a9-71e8-4d4b-830d-0f51a4811516"
message: "Invalid argument value: Container type cannot be null"
}
The problem is that I have container type!
Check out the parameters I send:
cobSessionToken=08062013_2%3Ad02590d4474591e507129bf6baaa58e81cd9eaacb5753e9441cd0b1ca3b8bd00a3e6b6a943956e947458307c1bb94b505e2eb4398f890040a3db8c98606c0392&userSessionToken=08062013_0%3A8e8ef9dd4f294e0f16dedf98c1794b96bf33f2e1f2686eda2f35dfe4901dd3a871eed6d08ce52c99a74deb004c025ebf4bf94c7b17baf8ba18aacb331588f5f5&transactionSearchRequest.containerType=bank&transactionSearchRequest.higherFetchLimit=1000&transactionSearchRequest.lowerFetchLimit=1&transactionSearchRequest.resultRange.endNumber=500&transactionSearchRequest.resultRange.startNumber=1&transactionSearchRequest.searchClients.clientId=1&transactionSearchRequest.searchClients.clientName=DataSearchService&transactionSearchRequest.ignoreUserInput=true&transactionSearchRequest.searchFilter.currencyCode=USD&transactionSearchRequest.searchFilter.postDateRange.fromDate=01-01-2014&transactionSearchRequest.searchFilter.postDateRange.toDate=01-31-2014&transactionSearchRequest.searchFilter+.transactionSplitType=ALL_TRANSACTION&transactionSearchRequest.searchFilter.itemAccountId+.identifier=10008425&transactionSearchRequest.searchClients=DEFAULT_SERVICE_CLIENT
There is an error occurred while adding the account, which can be interpreted by this parameter code: 403 and hence you will not be seeing that account when you call the getItemSummary API. An account is successfully linked if the code has zero as value. E.g.code:0 . 403 is an error which is show if Yodlee's data agent has encountered an unhandled use case. Hence for any such error you should file a service request using Yodlee customer care tool.
To know more about error codes please visit -
https://developer.yodlee.com/FAQs/Error_Codes
The status is show as completedsiteRefreshStatus: "REFRESH_COMPLETED_WITH_UNCERTAIN_ACCOUNT"because addition of any account is followed by a refresh in which Yodlee's data agent logs into the websites of FIs and try scraping data. Hence completion of this activity is denoted as REFRESH_COMPLETED even when there is an error occurred.
TranasctionSearch issue -
I can see two of the parameters with a "+" sign. Since transactionSlipttype and containerType are dependent on each other the error is thrown.
&transactionSearchRequest.searchFilter+.transactionSplitType=ALL_TRANSACTION
&transactionSearchRequest.searchFilter.itemAccountId+.identifier=10008425
The right parameters are -
&transactionSearchRequest.searchFilter.transactionSplitType=ALL_TRANSACTION
&transactionSearchRequest.searchFilter.itemAccountId.identifier=10008425

Worklight 5.0.6 Documentation - Open Questions: "WL.FailResponse", "standard response object", "heartbeat in designated cases"

We are using WL 5.0.6.1 and we did not find all the information in the docs.
At
http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m6/topic/com.ibm.worklight.help.doc/apiref/r_wl_client_connect.html
does the onSuccess(??) receive any parameter/object as input? If so what type/JSON structure?
the onFailure receives a WL.FailResponse input object - is there any type/JSON-Structure definition available?
At:
http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m6/topic/com.ibm.worklight.help.doc/apiref/r_wl_client_invokeprocedure.html
it says: "the failure handler receives a standard response object." ... is there a type definition for a "standard response object"?
At:
http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m6/topic/com.ibm.worklight.help.doc/apiref/r_wl_client_setheartbeatinterval.html
in the WorkingOffline PDF: http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v600/05_04_Working_offline.pdf it says: " Both WL.Events.WORKLIGHT_IS_CONNECTED and
WL.Events.WORKLIGHT_IS_DISCONNECTED events can be fired
by heartbeat in designated cases"
What are these "designated cases"?
when the heartbeat fails to connect to the server for the first time (or every time) will the event WL.Events.WORKLIGHT_IS_DISCONNECTED be fired?
will the heartbeat continue to run/try once the WL.Events.WORKLIGHT_IS_DISCONNECTED was fired, or does it need to be reset/restarted manually?
if it does continue to run, will the event WL.Events.WORKLIGHT_IS_CONNECTED be fired once the heartbeat has it's first successful connection to the server again?
The object that comes in on the onSuccess can be any (JSON) object you return from the back-end wrapped in an invocationResult together with an isSuccessful and errors attributes:
An object that contains the data that is returned by the invoked procedure, and the invocation status. Its format is as follows:
**invocationResult = {
isSuccessful: Boolean,
errors : "Error Message"
// Procedure results go here
}**
Where:
isSuccessful – Contains true if the procedure invocation succeeded, false otherwise. If the invocation failed, the failure handler for the request is called.
errors – An optional array of strings containing error messages.
And for the failure:
The procedure was called but failed. In this case, the invocationResult property is added to the response received by the failure handler. This property has the same structure as the invocationResult property returned to the success handler, but the value of the isSuccessful attribute is false. For the structure of the invocationResult property, see invocationResult.

Windows Service Fails on Launch

I'm trying to write a windows service. It installs fine, but fails when I run it with the following exception. I've searched for the string "MyNewProgramService", but I can't find any conversions that would throw this error. I've also added try/catch blocks to a bunch of code with custom exception handling without finding where this exception is occuring. I'm thinking it's somewhere in the auto-generated configuartion/setup code. Any ideas?
Event Type: Error
Event Source: MyNewProgram Event
Category: None Event
ID: 0
Date: 4/15/2010
Time: 12:48:34 PM
User: N/A
Computer: 20F7KF1
Description: Service cannot be started. System.InvalidCastException:
Conversion from string "MyNewProgramService" to type 'Integer' is not valid. --->
System.FormatException: Input string was not in a correct format.
at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value,
NumberFormatInfo NumberFormat)
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
--- End of inner exception stack trace ---
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
at TaskManagerFailureHandlerService.MyNewProgramService.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
it falls in method MyNewProgramService.OnStart, there Conversions.ToInteger is called somewhere. Just search for it in method. Then check parameter. It might come from config or something, thats why you don't see string in text.
Check your configuration file.
You might also check the account the service is running as. Just as a test go to the login tab in the services list and have it login under your own account. If the problem vanishes it's a permissions problem.