views:

49

answers:

4

Here's my call:

CallMfttService("ServiceLayer/FieldingManager.asmx/GetUICs",null, SetUicValues);

Here's the WebMethod:

[WebMethod]
    [ScriptMethod]
    public List<string> GetUICs()
    {
        UserManager user = new UserManager();
        var currentUser = user.GetUser(Security.FieldingToolPrincipal.Current.Identity.Name);
        List<string> uics = new List<string>();
        uics = Data.FieldingManager.SelectUicByJpm(currentUser.Organization);

        return uics;
    }

I'm not exactly sure what the problem is.. I know it obviously doesn't like sending no paramters..I really don't know though.

+1  A: 

try replacing null with new object[0] in your call

CallMfttService("ServiceLayer/FieldingManager.asmx/GetUICs",new object[0], SetUicValues);

JDMX
That didn't work either. That just causes my page layout to get all funky. The javascript error is "Object Expected". Since my web method doesn't takes parameters how does sending a new object as a parameter help?
Avien
A: 

Have you got a Stack Trace?

pms1969
+1  A: 

The problem is most likely this:

Data.FieldingManager.SelectUicByJpm(currentUser.Organization);

The object you're returning, "uics", probably doesn't have a blank constructor. That is, a new with no parameters:

new UicObject();

Giving it one should fix your problem.

jvenema
+2  A: 

I found out the I need to send an empty parameter to the method.

CallMfttService("ServiceLayer/FieldingManager.asmx/GetUICs", "{}", SetUicValues);

the "{}" fixed the issue.. thanks for the replies

Avien