Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts

Wednesday, March 28, 2012

Calling a Web service method that returns an XmlDocument object

I'm calling a webservice method that returns an XmlDocument object. I'm getting the result back object back, but in my SuccededCallback function I'm having trouble navigating through the object with JavaScript. I'm trying to use methods on the object like .selectsinglenode and .selectnodes etc, but I keep getting a script error; "Object doesn't support this property or method. Any ideas? I'll post some of the code i'm trying to work with below.

Here is how i call the method from the client ...

Navegate.Services.GeneralTasks.GetSelectedPartyNumber(guid, id, SucceededCallback, FailedCallback);

Here is the web method ...

<WebMethod()> _

<ScriptMethod(ResponseFormat:=ResponseFormat.Xml)> _

PublicFunction GetSelectedPartyNumber(ByVal sessionguidAsString,ByVal idAsInteger)As XmlDocumentDim oXmlDocumentAs XmlDocument

oXmlDocument =

New XmlDocumentWith oXmlDocument

.LoadXml(

"<DocumentPacket><Company><Number>12345</Number></Company></DocumentPacket>")EndWithReturn oXmlDocument

EndFunction

And here is how i handle the response from the webservice method but get an error on .selectsinglenode ...

function

SucceededCallback(result)

{

alert(result.selectsinglenode(

"DocumentPacket/Company/Number").text);

}

Umm... Since it took five hours for this to post i was able to find the solution elsewhere.

I worked after I user .selectSingleNode instead of .selectsinglenode.

Monday, March 26, 2012

Callback returns wrong SQL results!

I have a page that has buttons to change values in a few tables. When I use Postbacks it works fine, when I AJAXify it it shows the same results as it did before. Here's the strange bit, if I make a second change it shows the expected results from the first change and so on. It seems to always be one change behind.

I'm going to make a very small version of the page and post it here if it still happens.

It is only happening on one table. It is a very large table but I shouldn't think that would matter if the original Postback method works fine.

Does your AJAX.NET enabled page use a full Web Service? If so you install WSE 3.0 and turn on the trace utiliy. This should show what is being sent and recieve.

Wednesday, March 21, 2012

CalendarExtender returns date in wrong format

Hi, i'm using the CalendarExtender control within my web forms. However it keeps returning my dates in the format mm/dd/yyyy but i need it in the format dd/mm/yyyy. I was wondering if someone could tell me how this could be done. ThanksUse the Format property of the CalendarExtender.