Print Page | Close Window

Remote Service Method Calls

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2318
Printed Date: 17-Oct-2025 at 4:56pm


Topic: Remote Service Method Calls
Posted By: BillG
Subject: Remote Service Method Calls
Date Posted: 18-Nov-2010 at 10:19pm
In my webapp I created a folder called Services. In the folder I created a class called AvailableStepTypesBuilder.
 
In the class I have a method called RetrieveAvailableSteps() defined as follows:
 

public class AvailableStepTypesBuilder : IKnownType

{

[AllowRpc]

public static ObservableCollection<EventStepType> RetrieveAvailableSteps(Event e)

{

}

}
 
Now I want to call this from my client side. I am unsure what to use for the type name.
 

public void FetchAvailableSteps()

{

string typeName = ???????????;

string methodName = "RetrieveAvailableSteps";

return (ObservableCollection<EventStepType>) Mgr.InvokeServerMethodAsync(typeName, methodName, currentEvent);

}

 



Replies:
Posted By: sbelini
Date Posted: 19-Nov-2010 at 9:41am
Hi BillG,
 
TypeName is the assembly-qualified type name.
i.e.
 
TopNamespace.SubNameSpace.ContainingClass+NestedClass, MyAssembly
 
in your case, it should be something like:
 
"MyProject.AvailableStepTypesBuilder, MyProjectWeb"
 
sbelini
 


Posted By: BillG
Date Posted: 19-Nov-2010 at 10:11am
Do you mean like this?
 

string typeName = "LaborWare2011.Services.AvailableStepTypesBuilder, LaborWare2011Web";

string methodName = "RetrieveAvailableSteps";

Do I place the class AvailableStepTypesBuilder in the Web project or the Silverlight project?
 


Posted By: sbelini
Date Posted: 19-Nov-2010 at 10:42am
It looks about right.
 
Place your AvailableStepTypesBuilder class in the Web project (i.e. Server)


Posted By: BillG
Date Posted: 19-Nov-2010 at 12:18pm

Can one remote service method call another remote service method synchronously instead of asynchronously?

Bill


Posted By: sbelini
Date Posted: 19-Nov-2010 at 12:24pm
?
 
Not sure I understand. Can you clarify?
 
The 1st remote service is in the server. Who would it be calling remotelly?
 


Posted By: BillG
Date Posted: 19-Nov-2010 at 12:27pm
Sorry, can it call a method in the same remote class synchronously?


Posted By: sbelini
Date Posted: 19-Nov-2010 at 4:24pm
You should be able to do that.



Print Page | Close Window