private void BufferGeometry(IMessage reqMsg, IMessage respMsg) { IXMLSerializeData reqParams = reqMsg.Parameters; //get Geometry int idx = reqParams.Find("Geometry"); //name of the xml element in the wsdl for this parameter if (idx == -1) { throw new ArgumentNullException("Geometry"); } IGeometry geom = (IGeometry)reqParams.GetObject(idx, c_ns_esri, "Geometry"); //get Distance idx = reqParams.Find("Distance"); //name of the xml element in the wsdl for this parameter if (idx == -1) { throw new ArgumentNullException("Distance"); } double distance = reqParams.GetDouble(idx); //execute IPolygon buffer = BufferGeometry(geom, distance); //fill response respMsg.Name = "BufferGeometryResponse"; //this is the name of the xml element for the SOAP response. It must match the wsdl. respMsg.NamespaceURI = c_ns_soe; //the response message uses your namespace (not ESRI's) respMsg.Parameters.AddObject("Result", buffer); //the name of the xml element for the output parameter is Result. This must match the wsdl. }
private void FindNearFeatures(IMessage reqMsg, IMessage respMsg) { IXMLSerializeData reqParams = reqMsg.Parameters; int layerID = reqParams.GetInteger(FindParam("LayerID", reqParams)); IPoint location = (IPoint)reqParams.GetObject(FindParam("Location", reqParams), Constants.ESRINamespaceURI, "PointN"); double distance = reqParams.GetDouble(FindParam("Distance", reqParams)); IRecordSet recordSet = FindNearFeatures(layerID, location, distance); respMsg.Name = "FindNearFeaturesResponse"; respMsg.NamespaceURI = Constants.SOENamespaceURI; respMsg.Parameters.AddObject("Result", recordSet); }