|
POST
|
,
{ "typeName": "NetApplyWatermarkSOI",
"capabilities": "",
"enabled": "true",
"maxUploadFileSize": 0,
"allowedUploadFileTypes": "",
"properties":
{ "supportsREST": "false",
"supportsSOAP": "false",
"supportsInterceptor": "true" }
}
],
"frameworkProperties": {"interceptorOrderList": "NetSimpleLoggerSOI,NetApplyWatermarkSOI"},
"datasets": []
}
yes and in interceptorOrderList you put the order of chain if you have a chain see your json definition of service ../admin/services//FOLDER/SERVICE_NAME.MapServer?f=pjson
... View more
06-26-2020
12:24 PM
|
1
|
0
|
1510
|
|
POST
|
public byte[] HandleRESTRequest(string Capabilities, string resourceName, string operationName,
string operationInput, string outputFormat, string requestProperties, out string responseProperties)
{
try
{
responseProperties = null;
_serverLog.LogMessage(ServerLogger.msgType.infoStandard, _soiName + ".HandleRESTRequest()",
200, "Request received in Server Object Interceptor for handleRESTRequest");
try
{
IServerEnvironmentEx se4 = _restSOIHelper.ServerEnvironment as IServerEnvironmentEx;
IEnumServerDirectoryInfo dirInfos = se4.GetServerDirectoryInfos() as IEnumServerDirectoryInfo;
dirInfos.Reset();
IServerDirectoryInfo2 dirInfo = dirInfos.Next() as IServerDirectoryInfo2;
string _PathSystem = null;
while (dirInfo != null)
{
var dinfo2 = dirInfo as IServerDirectoryInfo2;
if (null != dinfo2 && dinfo2.Type == esriServerDirectoryType.esriSDTypeSystem)
{
_PathSystem = dinfo2.Path;
break;
}
dirInfo = dirInfos.Next() as IServerDirectoryInfo2;
}
}
catch { }
// Find the correct delegate to forward the request too
IRESTRequestHandler restRequestHandler = _restSOIHelper.FindRequestHandlerDelegate<IRESTRequestHandler>();
if (restRequestHandler == null)
throw new RestErrorException("Service handler not found");
var a = restRequestHandler.HandleRESTRequest(
Capabilities, resourceName, operationName, operationInput,
outputFormat, requestProperties, out responseProperties);
//"{\"error\":{\"code\":500,\"message\":\"Unable to complete operation.\",\"details\":[\"No edits ('adds', 'updates', 'deletes', or 'attachment edits') were specified.\"]}}";
string json = System.Text.Encoding.UTF8.GetString(a);
if (errorinjson)
{
// here if you have error change 'message' in json string
return System.Text.Encoding.UTF8.GetBytes(json);
}
else
return restRequestHandler.HandleRESTRequest(
Capabilities, resourceName, operationName, operationInput,
outputFormat, requestProperties, out responseProperties);
}
catch (RestErrorException e)
{
responseProperties = "{\"Content-Type\":\"text/plain;charset=utf-8\"}";
return System.Text.Encoding.UTF8.GetBytes(e.Message);
}
} you can write similar code for filter requests interested you see also operationname == 'applyEdits' , capabilites == 'Create,Query,Update,Delete,Uploads...', resourceName == 'layers/xxx' ect...
... View more
06-25-2020
03:31 AM
|
0
|
2
|
1970
|
|
POST
|
If the same trace done in arcgis desktop takes 2 minutes the soe cannot improve the response. what's the dbms ? Have you tried tuning on dbms ? In soe you can use costruct event to inizialize something to prepare your trace RAM or CPUs to the server depends if your server when you use service of soe use actual ram / cpu in % ( http://www.wiki.gis.com/wiki/index.php/Platform_Performance ) Can you give further details ?
... View more
06-25-2020
01:57 AM
|
0
|
5
|
1824
|
|
POST
|
soe and soi can be added in extension rest ( ..instance/admin/services/types/extensions ) here an example Debugging Server Object Extensions (SOEs) in Style · Josh Werts
... View more
06-25-2020
12:52 AM
|
1
|
3
|
1510
|
|
POST
|
04-27-2020
05:00 AM
|
0
|
0
|
584
|
|
POST
|
Try with RestSharp ( https://restsharp.dev/getting-started/ ) RestRequest r = new RestRequest("https://...../sharing/rest/oauth2/token/");
r.AddParameter("client_id","ewrwerwerwerwewer");
r.AddParameter("client_secret","assfwerwerwerwerewrwerwerfgfg");
r.AddParameter("grant_type","client_credentials");
r.Method = RestSharp.Method.POST;
r.RequestFormat = DataFormat.Json;
RestClient c = new RestClient();
IRestResponse rs = c.Execute(r);
JsonDeserializer a = new JsonDeserializer();
Dictionary<string, string> d = a.Deserialize<Dictionary<string, string>>(rs);
d["access_token"];
... View more
04-17-2020
08:08 AM
|
0
|
0
|
1987
|
|
POST
|
This is a problem certificates. You need check self certificates and CN then if you need change admin url you can do in https://mymachine.domain.com/portal/sharing/rest/portals/0123456789ABCDEF/servers. In portal check portal properties https://mymachine.domain.com:6443/arcgis/admin/security/config
... View more
03-12-2020
04:18 AM
|
1
|
0
|
5247
|
|
POST
|
private RestResource CreateRestSchema()
{
RestResource rootRes = new RestResource(soe_name, false, RootResHandler);
RestOperation sampleOper = new RestOperation("sampleOperation",
new string[] { "Location" },
new string[] { "json" },
SampleOperHandler);
rootRes.operations.Add(sampleOper);
return rootRes;
} JsonObject parm1Value;
bool found = operationInput.TryGetJsonObject("Location", out parm1Value);
if (!found)
throw new ArgumentNullException("Location");
IPoint location = Conversion.ToGeometry(parm1Value,
esriGeometryType.esriGeometryPoint) as IPoint; when you call soe you an write similar code: void Main()
{
Location location = new Location() { x = 100.3d, y = 500.9d };
JavaScriptSerializer js = new JavaScriptSerializer();
string jsonData = js.Serialize(location);
Dictionary<string, string> dictionary = new Dictionary<string, string>();
dictionary.Add("f", "json");
dictionary.Add("Location", jsonData);
Request.HttpPost("http://...../MapServer/exts/TestSOE/sampleOperation", dictionary);
}
internal class Location
{
public double x;
public double y;
}
/// <summary>
/// class request rest
/// </summary>
internal static class Request
{
/// <summary>
/// method http get
/// </summary>
/// <typeparam name="T">object T</typeparam>
/// <param name="url">url for get</param>
/// <returns>return object T</returns>
public static T HttpGet<T>(string url)
{
string result = Request.HttpGet(url);
var serializer = new JavaScriptSerializer();
var deserializedResult = serializer.Deserialize<T>(result);
return deserializedResult;
}
/// <summary>
/// method http get
/// </summary>
/// <param name="url">url for get</param>
/// <returns>return response</returns>
public static string HttpGet(string url)
{
HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest;
req.Method = WebRequestMethods.Http.Get;
string result = null;
using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(resp.GetResponseStream());
result = reader.ReadToEnd();
}
////Request.CheckError(result);
return result;
}
/// <summary>
/// method http post
/// </summary>
/// <typeparam name="T">object T</typeparam>
/// <param name="url">url for post</param>
/// <param name="parameters">parameters post</param>
/// <returns>return object T</returns>
public static T HttpPost<T>(string url, Dictionary<string, string> parameters)
{
string result = Request.HttpPost(url, parameters);
var serializer = new JavaScriptSerializer();
var deserializedResult = serializer.Deserialize<T>(result);
return deserializedResult;
}
/// <summary>
/// method http post
/// </summary>
/// <param name="url">url for post</param>
/// <param name="parameters">parameters post</param>
/// <returns>return response</returns>
public static string HttpPost(string url, Dictionary<string, string> parameters)
{
HttpWebRequest req = WebRequest.Create(new Uri(url)) as HttpWebRequest;
req.Method = WebRequestMethods.Http.Post;
req.ContentType = "application/x-www-form-urlencoded";
string queryString = string.Join("&", parameters.Select(x => x.Key + "=" + HttpUtility.UrlEncode(x.Value)));
// Encode the parameters as form data:
byte[] formData = UTF8Encoding.UTF8.GetBytes(queryString);
req.ContentLength = formData.Length;
// Send the request:
using (Stream post = req.GetRequestStream())
{
post.Write(formData, 0, formData.Length);
}
// Pick up the response:
string result = null;
using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(resp.GetResponseStream());
result = reader.ReadToEnd();
}
////Request.CheckError(result);
return result;
}
/// <summary>
/// verifica se il result ha un messaggio di errore. Nel caso getta un'eccezione
/// </summary>
/// <param name="result">result da analizzare</param>
////private static void CheckError(string result)
////{
//// ErrorRest.ErrorRest error = JsonConvert.DeserializeObject<ErrorRest.ErrorRest>(result);
//// if (error.error != null)
//// {
//// string details = string.Join(",", error.error.details);
//// throw new Exception(string.Format("Error code: {0} - Messaggio: {1}{2}", error.error.code, error.error.message, string.IsNullOrEmpty(details) ? string.Empty : string.Format("- Dettagli: {0}", details)));
//// }
////}
}
... View more
09-24-2019
03:18 AM
|
1
|
1
|
3276
|
|
POST
|
From 10.7 you can use shared instances Introducing shared instances in ArcGIS Server 10.7
... View more
09-17-2019
03:25 AM
|
3
|
0
|
593
|
|
POST
|
I have tested with 10.7. 10.3.1 is retired december 2020
... View more
08-28-2019
08:27 AM
|
0
|
1
|
1165
|
|
POST
|
Hi Alessandro, p return 50 k return 3 IMapDocument mapDocument = new MapDocumentClass();
mapDocument.Open(@"C:\Temp\Scratch\testanno.mxd");
IMap b = mapDocument.get_Map(0);
ILayerExtensions c = b.get_Layer(0) as ILayerExtensions;
var p = (c.get_Extension(0) as IServerLayerExtension).ServerProperties.GetProperty("ServicelayerID");
var k = (((b.get_Layer(0) as ICompositeLayer2).get_Layer(0) as ILayerExtensions).get_Extension(0) as IServerLayerExtension).ServerProperties.GetProperty("ServicelayerID");
... View more
08-28-2019
06:04 AM
|
0
|
3
|
1165
|
|
POST
|
Also from help 10.7.1 it's same. For now both with arcobjects sdk and with sdk enterprise (arcigis pro) it is not possible to set servicetype = geocode If you need intercept you can (for now) force calls through a proxy and modify / log for your purposes
... View more
07-26-2019
03:58 AM
|
1
|
0
|
1048
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-20-2024 11:20 AM | |
| 1 | 05-25-2017 10:11 AM | |
| 1 | 06-20-2023 12:09 AM | |
| 1 | 10-14-2022 05:14 AM | |
| 1 | 06-14-2023 02:00 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|