Nous utilisons des cookies pour vous garantir la meilleure expérience sur notre site. Si vous continuez à utiliser ce dernier, nous considèrerons que vous acceptez l'utilisation des cookies. J'ai compris ! ou En savoir plus !.
banniere

Le portail francophone de la géomatique


Toujours pas inscrit ? Mot de passe oublié ?
Nom d'utilisateur    Mot de passe              Toujours pas inscrit ?   Mot de passe oublié ?

#1 Wed 09 April 2014 10:17

zanady
Juste Inscrit !
Date d'inscription: 7 Sep 2013
Messages: 9

error:[RPC Fault faultString="Unable to complete ...] intersect widget

hi everyone,
I am trying to develop a intersection widget using the geoprocessing service.
my geoprocessing service is as follows:
I try to consomer this service in my flex application this is my code:

Code:

<?xml version="1.0" encoding="utf-8"?>
<!--
///////////////////////////////////////////////////////////////////////////
// Copyright (c) 2010-2011 Esri. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////
-->
<viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   xmlns:esri="http://www.esri.com/2008/ags"
                   xmlns:viewer="com.esri.viewer.*"
                   xmlns:components="com.esri.viewer.components.*"
                   creationComplete="init()">
    <fx:Script>
        <![CDATA[
            
            import com.esri.ags.FeatureSet;
            import mx.rpc.events.FaultEvent;
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.managers.CursorManager;
            import com.esri.ags.layers.GraphicsLayer;
            import mx.rpc.AsyncResponder;
            import com.esri.ags.tasks.supportClasses.ExecuteResult;
            import com.esri.ags.tasks.supportClasses.ParameterValue;
            private var intersectLyrLen:int;
            private var msgVisible:Boolean = false;
            
            public var graphiclayer:GraphicsLayer=new GraphicsLayer();
            
            
            private function init():void
            {
                graphiclayer=new GraphicsLayer();
                graphiclayer.symbol= intersectSimpleFill;
                map.addLayer(graphiclayer);
                
            }
            
            
            private function intersectIfOptionsValid():void
            {
                var hasAreaSelected:Boolean = (map.defaultGraphicsLayer.numGraphics > 0);
                var hasSelectedLayersTointersect:Boolean = pointsCheckBox.selected || lignesCheckBox.selected || Mar_adm1CheckBox.selected ||Mar_adm2CheckBox.selected ||Mar_adm3CheckBox.selected ||Mar_adm4CheckBox.selected ;
                
                if (hasAreaSelected && hasSelectedLayersTointersect)
                {
                    intersectdata();
                }
                else
                {
                    showErrorMessage("Select layers to intersect");
                }
            }
            
            private function showErrorMessage(content:String):void
            {
                Alert.show(content, "Geoprocessing Task Error");
                
            }
            
            
            private function intersectdata():void
            {
                var requestObject:Object = createRequestObject();
                gp.execute(requestObject,new AsyncResponder(onResult, onFault));
                
                function onResult(gpResultat:ExecuteResult=null,token:Object=null):void
                {
                    var pv:ParameterValue = gpResultat.results[0];
                    var fs:FeatureSet = pv.value as FeatureSet;
                    graphiclayer.graphicProvider=fs.features;
                    intersectLyrLen = graphiclayer.numGraphics;
                    msgVisible = true;
                    
                }
                
                function onFault(info:Object,token:Object=null):void
                {
                    Alert.show(info.toString());
                    graphiclayer.clear();
                    
                }
                
                
                
            }
            
            private function createRequestObject():Object
            {
                var layers1Tointersect:Array = getLayers1tointersect();
                var layers2Tointersect:Array=getLayers2tointersect();
                
                var requestObject:Object = {
                    "points ": layers1Tointersect,
                    "Mar_adm4": layers2Tointersect
                    
                };
                
                return requestObject;
            }
            
            
            private function getLayers1tointersect():Array
            {
                var layers1Tointersect:Array = [];
                
                if (pointsCheckBox.selected)
                {
                    layers1Tointersect.push(pointsCheckBox.label);
                }
                if (lignesCheckBox.selected)
                {
                    layers1Tointersect.push(lignesCheckBox.label);
                }
                if (Mar_adm1CheckBox.selected)
                {
                    layers1Tointersect.push(Mar_adm1CheckBox.label);
                }
                
                if (Mar_adm2CheckBox.selected)
                {
                    layers1Tointersect.push(Mar_adm2CheckBox.label);
                }
                
                if (Mar_adm3CheckBox.selected)
                {
                    layers1Tointersect.push(Mar_adm3CheckBox.label);
                }
                
                if (Mar_adm4CheckBox.selected)
                {
                    layers1Tointersect.push(Mar_adm4CheckBox.label);
                }
                
                return layers1Tointersect;
            }
            
            private function getLayers2tointersect():Array
            {
                var layers2Tointersect:Array = [];
                
                if (pointsCheckBox.selected)
                {
                    layers2Tointersect.push(pointsCheckBox.label);
                }
                if (lignesCheckBox.selected)
                {
                    layers2Tointersect.push(lignesCheckBox.label);
                }
                if (Mar_adm1CheckBox.selected)
                {
                    layers2Tointersect.push(Mar_adm1CheckBox.label);
                }
                
                if (Mar_adm2CheckBox.selected)
                {
                    layers2Tointersect.push(Mar_adm2CheckBox.label);
                }
                
                if (Mar_adm3CheckBox.selected)
                {
                    layers2Tointersect.push(Mar_adm3CheckBox.label);
                }
                
                if (Mar_adm4CheckBox.selected)
                {
                    layers2Tointersect.push(Mar_adm4CheckBox.label);
                }
                
                return layers2Tointersect;
            }
            
            private function clearintersect():void
            {
                intersectLyrLen = 0;
                graphiclayer.clear();            
            }
            
        ]]>
    </fx:Script>
    
<fx:Declarations>
    
    <esri:SimpleFillSymbol id="intersectSimpleFill"
                           alpha="0.5"
                           color="0xFF0000">
        <esri:SimpleLineSymbol width="1"
                               alpha="0.5"
                               color="0x000000"/>
    </esri:SimpleFillSymbol>
    
    <esri:Geoprocessor id="gp"
                       
                       outSpatialReference="{map.spatialReference}"
                       url="http://localhost:6080/arcgis/rest/services/Geotraitement/intersection/GPServer/intersect"
                       useAMF="false"/>
    
</fx:Declarations>
    
    <viewer:WidgetTemplate id="helloWorld"
                           width="300" height="300">
        <s:Label x="26" y="23" text="Intersection entre deux couches :"/>
        <s:CheckBox id="pointsCheckBox" x="62" y="57" label="points"/>
        <s:CheckBox id="lignesCheckBox" x="62" y="83" label="lignes"/>
        <s:CheckBox id="Mar_adm1CheckBox" x="62" y="109" label="Mar_adm1"/>
        <s:CheckBox id="Mar_adm2CheckBox" x="62" y="135" label="Mar_adm2"/>
        <s:CheckBox id="Mar_adm3CheckBox" x="62" y="161" label="Mar_adm3"/>
        <s:CheckBox id="Mar_adm4CheckBox" x="62" y="187" label="Mar_adm4"/>
        <s:Button x="115" y="233" label="executer" click="intersectdata()"/>
        <s:Button x="202" y="264" label="clear" click="clearintersect()"/>
        

    
    </viewer:WidgetTemplate>
</viewer:BaseWidget>

When I execute the widget an error message appears:"[RPC Fault faultString="Unable to complete operation." faultCode="400" faultDetail="Erreur d’exécution de l’outil."]"

I am beginner can i guide me?


Fichier(s) joint(s) :
Pour accéder aux fichiers vous devez vous inscrire.

Hors ligne

 

#2 Wed 09 April 2014 10:47

zanady
Juste Inscrit !
Date d'inscription: 7 Sep 2013
Messages: 9

Re: error:[RPC Fault faultString="Unable to complete ...] intersect widget

i'm using :flex viewer 3.4, flach builder 4.6 and arcgis 10.1.

Hors ligne

 

#3 Wed 09 April 2014 11:17

ThomasG
Membre
Lieu: Nantes
Date d'inscription: 9 Sep 2005
Messages: 946
Site web

Re: error:[RPC Fault faultString="Unable to complete ...] intersect widget

Hi,

I can't help you directly but I'm not sure you should ask here about this particular problem: it only targets French speaking users.
I advise you to go on http://gis.stackexchange.com or to ask on various ESRI forums http://forums.arcgis.com

Cheers

Thomas Gratier

Hors ligne

 

#4 Sat 12 April 2014 21:55

zanady
Juste Inscrit !
Date d'inscription: 7 Sep 2013
Messages: 9

Re: error:[RPC Fault faultString="Unable to complete ...] intersect widget

Salut ThomasG,
je suis désolé je vais posé la question en français.

Hors ligne

 

#5 Sat 12 April 2014 21:59

zanady
Juste Inscrit !
Date d'inscription: 7 Sep 2013
Messages: 9

Re: error:[RPC Fault faultString="Unable to complete ...] intersect widget

Je suis en train de développer une widget d'intersection à l'aide du service de géotraitement.
mon service de géotraitement est comme suit:

J'essaie de consommer ce service dans mon application flex voila le code:

Code:

// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////
-->
<viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   xmlns:esri="http://www.esri.com/2008/ags"
                   xmlns:viewer="com.esri.viewer.*"
                   xmlns:components="com.esri.viewer.components.*"
                   creationComplete="init()">
    <fx:Script>
        <![CDATA[
            
            import com.esri.ags.FeatureSet;
            import mx.rpc.events.FaultEvent;
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.managers.CursorManager;
            import com.esri.ags.layers.GraphicsLayer;
            import mx.rpc.AsyncResponder;
            import com.esri.ags.tasks.supportClasses.ExecuteResult;
            import com.esri.ags.tasks.supportClasses.ParameterValue;
            private var intersectLyrLen:int;
            private var msgVisible:Boolean = false;
            
            public var graphiclayer:GraphicsLayer=new GraphicsLayer();
            
            
            private function init():void
            {
                graphiclayer=new GraphicsLayer();
                graphiclayer.symbol= intersectSimpleFill;
                map.addLayer(graphiclayer);
                
            }
            
            
            private function intersectIfOptionsValid():void
            {
                var hasAreaSelected:Boolean = (map.defaultGraphicsLayer.numGraphics > 0);
                var hasSelectedLayersTointersect:Boolean = pointsCheckBox.selected || lignesCheckBox.selected || Mar_adm1CheckBox.selected ||Mar_adm2CheckBox.selected ||Mar_adm3CheckBox.selected ||Mar_adm4CheckBox.selected ;
                
                if (hasAreaSelected && hasSelectedLayersTointersect)
                {
                    intersectdata();
                }
                else
                {
                    showErrorMessage("Select layers to intersect");
                }
            }
            
            private function showErrorMessage(content:String):void
            {
                Alert.show(content, "Geoprocessing Task Error");
                
            }
            
            
            private function intersectdata():void
            {
                var requestObject:Object = createRequestObject();
                gp.execute(requestObject,new AsyncResponder(onResult, onFault));
                
                function onResult(gpResultat:ExecuteResult=null,token:Object=null):void
                {
                    var pv:ParameterValue = gpResultat.results[0];
                    var fs:FeatureSet = pv.value as FeatureSet;
                    graphiclayer.graphicProvider=fs.features;
                    intersectLyrLen = graphiclayer.numGraphics;
                    msgVisible = true;
                    
                }
                
                function onFault(info:Object,token:Object=null):void
                {
                    Alert.show(info.toString());
                    graphiclayer.clear();
                    
                }
                
                
                
            }
            
            private function createRequestObject():Object
            {
                var layers1Tointersect:Array = getLayers1tointersect();
                var layers2Tointersect:Array=getLayers2tointersect();
                
                var requestObject:Object = {
                    "points ": layers1Tointersect,
                    "Mar_adm4": layers2Tointersect
                    
                };
                
                return requestObject;
            }
            
            
            private function getLayers1tointersect():Array
            {
                var layers1Tointersect:Array = [];
                
                if (pointsCheckBox.selected)
                {
                    layers1Tointersect.push(pointsCheckBox.label);
                }
                if (lignesCheckBox.selected)
                {
                    layers1Tointersect.push(lignesCheckBox.label);
                }
                if (Mar_adm1CheckBox.selected)
                {
                    layers1Tointersect.push(Mar_adm1CheckBox.label);
                }
                
                if (Mar_adm2CheckBox.selected)
                {
                    layers1Tointersect.push(Mar_adm2CheckBox.label);
                }
                
                if (Mar_adm3CheckBox.selected)
                {
                    layers1Tointersect.push(Mar_adm3CheckBox.label);
                }
                
                if (Mar_adm4CheckBox.selected)
                {
                    layers1Tointersect.push(Mar_adm4CheckBox.label);
                }
                
                return layers1Tointersect;
            }
            
            private function getLayers2tointersect():Array
            {
                var layers2Tointersect:Array = [];
                
                if (pointsCheckBox.selected)
                {
                    layers2Tointersect.push(pointsCheckBox.label);
                }
                if (lignesCheckBox.selected)
                {
                    layers2Tointersect.push(lignesCheckBox.label);
                }
                if (Mar_adm1CheckBox.selected)
                {
                    layers2Tointersect.push(Mar_adm1CheckBox.label);
                }
                
                if (Mar_adm2CheckBox.selected)
                {
                    layers2Tointersect.push(Mar_adm2CheckBox.label);
                }
                
                if (Mar_adm3CheckBox.selected)
                {
                    layers2Tointersect.push(Mar_adm3CheckBox.label);
                }
                
                if (Mar_adm4CheckBox.selected)
                {
                    layers2Tointersect.push(Mar_adm4CheckBox.label);
                }
                
                return layers2Tointersect;
            }
            
            private function clearintersect():void
            {
                intersectLyrLen = 0;
                graphiclayer.clear();            
            }
            
        ]]>
    </fx:Script>
    
<fx:Declarations>
    
    <esri:SimpleFillSymbol id="intersectSimpleFill"
                           alpha="0.5"
                           color="0xFF0000">
        <esri:SimpleLineSymbol width="1"
                               alpha="0.5"
                               color="0x000000"/>
    </esri:SimpleFillSymbol>
    
    <esri:Geoprocessor id="gp"
                       
                       outSpatialReference="{map.spatialReference}"
                       url="http://localhost:6080/arcgis/rest/services/Geotraitement/intersection/GPServer/intersect"
                       useAMF="false"/>
    
</fx:Declarations>
    
    <viewer:WidgetTemplate id="helloWorld"
                           width="300" height="300">
        <s:Label x="26" y="23" text="Intersection entre deux couches :"/>
        <s:CheckBox id="pointsCheckBox" x="62" y="57" label="points"/>
        <s:CheckBox id="lignesCheckBox" x="62" y="83" label="lignes"/>
        <s:CheckBox id="Mar_adm1CheckBox" x="62" y="109" label="Mar_adm1"/>
        <s:CheckBox id="Mar_adm2CheckBox" x="62" y="135" label="Mar_adm2"/>
        <s:CheckBox id="Mar_adm3CheckBox" x="62" y="161" label="Mar_adm3"/>
        <s:CheckBox id="Mar_adm4CheckBox" x="62" y="187" label="Mar_adm4"/>
        <s:Button x="115" y="233" label="executer" click="intersectdata()"/>
        <s:Button x="202" y="264" label="clear" click="clearintersect()"/>
        

    
    </viewer:WidgetTemplate>
</viewer:BaseWidget>

Lorsque j'exécute le widget un message d'erreur apparaît: "[RPC Fault faultString =".. Impossible de terminer l'opération "faultCode =" 400 "faultDetail =" Erreur d'exécution de l'Outil "]"

pouvez vous m'aider s'il vous plait??
Mercii d'avances.
** j'utilise flex viewer 3.4, flach builder 4.6 et arcgis 10.1

Hors ligne

 

#6 Sat 12 April 2014 22:02

zanady
Juste Inscrit !
Date d'inscription: 7 Sep 2013
Messages: 9

Re: error:[RPC Fault faultString="Unable to complete ...] intersect widget

j'ai déja poser le problème dans les deux forums: ( http://gis.stackexchange.com et ESRI forums http://forums.arcgis.com ) mais j'ai pas eu de réponse jusqu'à maintenant.

Hors ligne

 

Pied de page des forums

Powered by FluxBB