Showing posts with label service. Show all posts
Showing posts with label service. Show all posts

Wednesday, March 28, 2012

Difficulty in calling web service

Hi all,

The web service which am trying to call takes two string and three array as parameters.am able to call the web service through ajaxpro.dll, but through ajax framework1.0 its not coming. the service returns response class object..pls help me out.

In .aspx page

--------------------

<asp:ScriptManagerID="ScriptManager1"runat="server">

<Services>

<asp:ServiceReferencePath="http://localhost/progressTrack21/ManageProgressTracking.asmx"/>

</Services>

<Scripts>

<asp:ScriptReferencePath="trackingScript.js"/>

</Scripts>

</asp:ScriptManager>

<inputid="Button1"type="button"value="Click here"onclick="funProgress();return false;"/>

In trackingscript.js file

----------------

function funProgress()

{

debugger;

Sys.Net.WebServiceProxy.invoke("http://localhost/progressTrack21/ManageProgressTracking.asmx","Update",false,{"UserId1":"1","PlanId1":"1","SCOId1":scoid,"ElementName1":EleName,"Value1":EleName},SucceededCallback);

}

function SucceededCallback(result, eventArgs)

{

var RsltElem = document.getElementById("Results1");

alert(result);

}

Are you getting any javascript error ??, because in your function you are directly accessing the results elements

function SucceededCallback(result, eventArgs)

{

var RsltElem = document.getElementById('<%=Results1.ClientID%>');

alert(result);

}


Hi, You do not have to call the WebServiceProxy.invoke. Instead the Ajax Framework generates a JavaScript Proxy class which represents the Server Side Web Service.

For Example if Your WebService Name is DataService and if it contains a method FetchData(), then the JavaScript class will also contain a DataService class with the FetchData Method. You can find the more info from the following links:

http://ajax.asp.net/docs/tutorials/ConsumingWebServicesWithAJAXTutorial.aspx
http://ajax.asp.net/docs/tutorials/ExposingWebServicesToAJAXTutorial.aspx


It is giving internal server error(500)....I tried in all possible ways...


Thank u Kazi,,,,

Saturday, March 24, 2012

Deploying ATLAS to a remote server

Hello everyone. I have downloaded and installed the Beta 1 version of ASP.NET AJax. I would like to be able to use it on a remote hosting service. I would add a reference to the .dll file that uses AJAX, and then update the web.config file to complete the support for AJAX, but I can't seem to fine the .dll file after I have installed it.

Does anyone know where I can find the .dll file so I can use it on a remote hosting server?

Thanks.

I am pretty sure this is what you are looking for:

C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025


Also, you will need to make sure that ASP.NET Ajax dll is installed on the
remote server.

Wally

wrote in message news:1445631@.forums.asp.net...
> Hello everyone. I have downloaded and installed the Beta 1 version of
> ASP.NET AJax. I would like to be able to use it on a remote hosting
> service. I would add a reference to the .dll file that uses AJAX, and then
> update the web.config file to complete the support for AJAX, but I can't
> seem to fine the .dll file after I have installed it.
>
>
>
> Does anyone know where I can find the .dll file so I can use it on a
> remote hosting server?
>
> Thanks.
>


Listen to the ASP.NET Podcast @.http://www.aspnetpodcast.com/
Thank you for your help. I got it to work :)

Wednesday, March 21, 2012

Delayed GridView Loading

I have a GridView that is loading data from a web service. For each item in the table a call must be made to the web service and they are averaging around a half second per call. So for a GridView with 83 rows it takes around 41 seconds to load the page the first time. After the page is initially loaded the data is cached so it doesn't take nearly as long. What I'm wondering is if there is a way that I could show the user the rest of the page and then load the GridView via Atlas once the rest of the page loads so that the user can at least see the page is loading and doing something? Icing on the cake would be to be able to display a loading gif while the GridView is loading.

Thanks,

Eric

Hello, I think using an UpdatePanel control will make things better.

A.

Default value in child CascadingDropDown

I'm using the standard technique for setting the default option in the Web service: result.Add(newCascadingDropDownNameValue(name, code, BLOCKED EXPRESSION

(expression is true only for the default option)

This technique ony works for the parent list, and doesn't do anything for the child list. In other words, when the selection on the parent list changes, and the child list gets populated via its Web service, setting the default option via the above technique doesn't actually do anything (the first option of the child element is always selected by default). What am I doing wrong?

Hi Tomers,

My understanding of your case is that you want to set a default value for DropDownList ,which is associated with a CascadingDropDown.

As far as I know, the returned value will add to it's child list instead of parent list. Here is the code section in CascadingDropDownNameValue.cs.

public CascadingDropDownNameValue(string name, string value, bool defaultValue)
{
this.name = name;
this.value = value;
this.isDefaultValue = defaultValue;
}

I have made a sample and it works fine on my local machine. Please see my sample which is using oledb:

[WebMethod]public CascadingDropDownNameValue[] GetCities(string knownCategoryValues,string category) { StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);int stateID;if (!kv.ContainsKey("State") || !Int32.TryParse(kv["State"],out stateID)) {return null; } List myList =new List(); strSql ="SELECT * FROM tb_City WHERE StateID=" + stateID.ToString(); GetDr(strSql);while (myReader.Read()) {if (myReader["CityName"].ToString() =="Shanghai") { myList.Add(new CascadingDropDownNameValue(myReader["CityName"].ToString(), myReader["CityID"].ToString(),true)); }else { myList.Add(new CascadingDropDownNameValue(myReader["CityName"].ToString(), myReader["CityID"].ToString(),false)); } } myReader.Close();return myList.ToArray(); }

In your case, I think you should check your code and debug it step-by-step if necessary.

Best Regards,

Jonathan

Declarative timer and web service

I am trying to use a declarative script to timer on tick -> web service on complete -> update label.

No problems with updating the label but is there anyway to invoke a service method without resorting to javascript (i.e. pure xml-script)? I imagine I can do something like tick="Sys.Net.ServiceMethod.invoke(..." but it kinda kills the purpose.

Any ideas?

Alex

hello.

i think you're after the servicemethodrequest class.

here's an example of it's declaration:

<serviceMethod id="myService" url="webservice.asmx" methodName="Test">
<completed>
<!--invoke your binding from here-->
</completed>
</serviceMethod>

btw, you can invoke the previous service by using the invokeMethod action (invoke is the name of the method exposed by servicemethod that let's you start the web service method execution).


Luis - yes I am after theServiceMethodRequest class except I would like to invoke the ws via a timer control (w/o resorting to using JS) on tick event:

<timer id="timer" interval="1000" enabled="true" tick="INVOKE WS"/
<serviceMethod id="svc..." url="service.asmx" methodName="GetSomething">
<completed> ...</completed>
</serviceMethod>

While I can write a JS function to invoke the method (and I have done this) I would like to create a version (more elegant) w/o any JS using declarative script. No point for me to use a combination of declarative script to do the binding and ws calls if I still have to write a JS function to call the ws on Tick, might as well do the bindings manually. Right now this is what I do but would be great if I can use the tick event to invoke a ws as well. Any ideas?

AO


hello.

how about something like this;

<timer ...>
<tick>
<invokeMethod target="svc..." method="invoke" />
</tick>
</timer>

if you need parameters, then add them as child element of the invokemethod element...


Thanks that was easy... wish there was an easy way to browse the Atlas library by class with Visual Studio. The documentation didn't make any mention of this (as far as I remember) and from briefly looking in the code I didn't find it.

Luis, thanks again!

Debugging Web Service/Atlas

Hello,

I'm trying to debug a problem with a biz layer class that gets called from my web service. I rtied doing System.Diagnostic.Debug.writeline but nothing gets written and also tried doing breakpoints but those don't work either. Is there anything I can do to get debug info?

Thanks,

Clank

PS - I don't the search function works for the forums either.

Yeah, debugging Ajax style applications is tough. Basically you have to put a debug line at the start of your web service and make sure it even gets there. If not, start with "alerts" in the JavaScript before your web service is called.

You can attach a debugger to both the server-side and the client-side (provided you unchecked the two relevant checkboxes in IE advanced settings).

You can also use debug.dump and debug.trace from the client-side.

You can also use Nikhil's browser helper to monitor the network traffic and get client-side stack traces:http://www.nikhilk.net/Project.WebDevHelper.aspx