Hi
I am running asp.net ajax (vs 2008)
I have the following webservice listed below.
However, i have no idea how to call this from javascript.
Originally, before i started using the BeginXXX and EndXXX as per
http://msdn2.microsoft.com/en-us/library/aa480516.aspx
I could easily call the webmethod via in this case
"WebService_spe ech.GenerateSpe echDataForText"
but now im not sure how to call it.
Any ideas?
Thx for any help here...greatly appreciated
matt
WebService(Name space = "http://tempuri.org/")]
[WebServiceBindi ng(ConformsTo = WsiProfiles.Bas icProfile1_1)]
[System.Web.Scri pt.Services.Scr iptService]
public class WebService_spee ch : System.Web.Serv ices.WebService
{
public System.Speech.S ynthesis.Speech Synthesizer TtsVoice;
public WebService_spee ch()
{
//Uncomment the following line if using designed components
//InitializeCompo nent();
}
public delegate string GenerateSpeechD ataForTextAsync Stub(string
text);
//meat of the method (heavy lifting done here)
//where the actual speech data is extracted from the text
public SpeechData GenerateSpeechD ataForText(stri ng text)
{
//do speech stuff here
//i removed the processing code
return SpeechData_;
}
//state monitor for the GenerateSpeechD ataForText service
public class MyState
{
public object previousState;
public GenerateSpeechD ataForTextAsync Stub asyncStub;
}
//start the GenerateSpeechD ataForText method
[WebMethod]
public IAsyncResult BeginGenerateSp eechDataForText (string text,
AsyncCallback cb, object s)
{
GenerateSpeechD ataForTextAsync Stub stub = new
GenerateSpeechD ataForTextAsync Stub(GenerateSp eechDataForText );
MyState ms = new MyState();
ms.previousStat e = s;
ms.asyncStub = stub;
return stub.BeginInvok e(text, cb, ms);
}
//end the GenerateSpeechD ataForText method
[WebMethod]
public SpeechData EndGenerateSpee chDataForText(I AsyncResult call)
{
MyState ms = (MyState)call.A syncState;
return ms.asyncStub.En dInvoke(call);
}
}