AGS SOE’s without the SOAP

By Bill Thorp

Vish recently wrote about calling AGS SOEs via SOAP instead of DCOM.  He doesn’t mention that AGS doesn’t make you use SOAP, nor XML for that matter. This low-tech JSON-RPC invoker shows the proof-of-concept:

public string HandleStringRequest(string Capabilities, string request){
  MethodCall mc = JavaScriptConvert.DeserializeObject<MethodCall>(request);
  object result = this.GetType().GetMethod(mc.name).Invoke(this, mc.parameters);
  return JavaScriptConvert.SerializeObject(result);
}

public string test(string str1, string str2){
  return str1 + str2;
} 

class MethodCall{
  public string name;
  public object[] parameters;
}

 Here’s an action shot…

fiddler

2 Responses to “AGS SOE’s without the SOAP”

  1. Fast unknown method invocation for loose coupling « MapWrecker 2.0 Says:

    [...] previously shown using reflection to allow loosely-coupled method invocation in ArcGIS Server Object Extensions, but reflection is wicked slow.  I knew that people were writing ORM binding using IL op-codes, [...]

  2. abhi Says:

    Hi,

    Great post.

    What is the better way to handle internet resource at the SOE level.

    How would SOE work, if we publish as a SOAP?

    Do we have any example for that besides http://rexdotnet.blogspot.com/ ?

    Thanks,

    Abhi.

Leave a Reply