the server method 'GetMyStuff' failed

J

John Kotuby

Hi guys,

Ok, I am trying to set up my first simple page method in VS2008.
I am getting immediately from the onFailure function "The Srver Method
'GetMyStuff' Failed" with no error number or description.

I studied the BOL and watched a video about how to set it up with both a
simple PageMethods call (EnablePageMethods="true" in the ScriptManager) and
also the Sys.Net.WebServiceProxy.invoke call (EnablePageMethods="false" in
the ScriptManager).
Here is the declared WebMehod in the same ASPX page that holds the calling
javascript.

<WebMethod()> Public Shared Function GetMyStuff() As String()
Dim myArray As String() = {}
myArray(0) = "11111"
myArray(1) = "listname"
myArray(2) = "origid"
myArray(3) = "P"
Return myArray
End Function

And the javascript:

//call the service
function GetFromOrigId() {
PageMethods.GetMyStuff(GetFromOrigIdSucceededHandler,
GetFromOrigIdFailedHandler);
/*
Sys.Net.WebServiceProxy.invoke(
"http://localhost/Custom/CustomCategories.aspx",
"GetMyStuff",
false,
null,
GetFromOrigIdSucceededHandler,
GetFromOrigIdFailedHandler, null, 3000);
*/
}

In either case the program goes right into the failure routine and Web Dev
Helper does not show that ANY response was received from the server. When
run in debug mode the processing doesn't even halt at the breakpoint I
placed at the called function.

Thre are no js errors and the pages compile just fine.

Can anybody help with this?

Thanks
 
J

John Kotuby

Well, I moved the WebMethod to a Web Service file ASMX and now it works just
fine. I was hoping that I could just add a Page Method to an existing ASPX
because the method is particular to that page. I still wish I knew what I am
missing to allow the WebMethod to be called from the aspx page, because that
is a very easy way to add lightweight AJAX request-response.

I realize that I should have included the New constructor in my Array
definition in the example below, but if my call to the method actually
reached it on the server I would get back a more complete error message
about the array not being instantiated.

Hey, am I getting blackballed on this Group? Nobody has responded to any of
my questions in the past month.
Maybe I should post with a title like I see in this group 5 messages above
mine "! Live Naked Pot smoking".
Anybody read that one yet???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top