Select to view content in your preferred language

How do you add a map service?

3072
20
08-19-2010 08:03 AM
JoshuaCoates
Deactivated User
I am extremely new to ArcGIS Server as well as Flex Builder and am trying to see if someone can help me step by step on how to add a map service that I have created in flex builder. I have a map service and web app on ArcGIS Server where I am interning and the web app works great. However, I am trying to turn it up a notch and learn how to use Flex to make it look even better. The map (mxd/msd) is not a tiled (cached) map....so I am trying to figure out what steps I need to take in order to publish the service I currently have as a .NET into Flex?! The server type is ASP.NET and I have published the service from the MSD of my map. ..... I am not sure how to figure out what my Web application root and Web application URL are (for the project properties in Flex)? I assume that the web application URL is the URL where my web app is. I have very little knowledge of computer and mxml code, and little knowledge of technical computer terms but have been told that even I am capable of using Flex. I just want to get my service to run in Flex. Can someone walk me through this in "Layman's terms" please? All the tutorials and demos I have watched through ESRI and Adobe are completely over my head and I don't even know where or how to begin. Any help would be greatly appreciated!


Josh C.
Tags (2)
0 Kudos
20 Replies
BobHeien
Occasional Contributor
I'm a Flex newbie too, and was wondering the exact same thing, where will I find the service URL.  I finally did find after much digging.  Enter this ArcGIS Server services address in browser: http://<your server name>/ArcGIS/rest/services.  Should see your available services that you have added in ArcGIS Server Manager here if ArcGIS Server installed and working correctly.  Then just copy the address to mxml code like:
    <esri:Map>
        <esri:ArcGISDynamicMapServiceLayer url="http://<your server name>/ArcGIS/rest/services/<service name>/MapServer"/>
    </esri:Map>

Also, Take a look at the precompiled flexviewer here on the Getting Started page: http://help.arcgis.com/en/webapps/flexviewer/help/index.html.  All you need to do to get started is place the downloaded folder on your webserver per instructions and tweak some of the code to get going with flex.

Hope this helps.

Bob Heien, GISP
GIS Systems Analyst
WCICC-IT
Woodbury County Information & Communications Commission - Information Technologies
620 Douglas St.
Floor 2 1/2
Sioux City, IA 51101
bheien@sioux-city.org
Office: 712-279-6509
Fax: 712-279-6545
0 Kudos
JoshuaCoates
Deactivated User
Thanks for your help Bob, I am looking through it now and going to give it a shot!
0 Kudos
JoshuaCoates
Deactivated User
Ok well still no luck with this. First off - - - when using the getting started using the compiled package, I dont understand fully what is going on. I have flexviewer installed however I dont know how to find the web server folder. I assumed it was the folder in the server i use called \\gisserver....there is a folder in there called wwwroot with subfolders aspnet_client, backup_instannce, gisserver, my map service, etc. so do i just put the flexviewer folder inside the wwwroot folder? i did this and the web app opened....however, after doing Part 2....everytime i saved the xml and refreshed the web browser...no changes I made ever took place?!

Second - - - how do I open the flexviewer as a project in flashbuilder 4 and link it to my map service that I have in my server wwwroot folder? Every time I open flashbuilder and go to import flex project, when I navigate to the flexviewer folder and try to add it, it tells me the specified folder does not contain a flex project....but its the flexviewer that I downloaded. What am i missing here? Am I just that stupid or is this just not as easy as ESRI makes it seem? I am getting beyond frustrated that I can not grasp this concept. I want to use Flashbuilder to add my map service that is stored in my server.....and I can not figure this out whatsoever! Bob thank you for the help, I just can not get this to work. After getting the flexviewer open in the web browser following the getting started guide...is there not a way to add my map service to it...or does it not need to be done in flashbuilder?? I am wanting to do this through Flashbuilder so if someone can tell me how to do this with flashbuilder that would be amazing!!!


Josh C.
0 Kudos
DasaPaddock
Esri Regular Contributor
You need to download the source code zip. See the Getting Started page in the Developers book at:
http://help.arcgis.com/en/webapps/flexviewer/help/index.html
0 Kudos
JoshuaCoates
Deactivated User
Ok, I have downloaded the source code and gone through the steps for the Uncompiled package. I was successfully able to create and build the project within Flash Builder. I then went on to the "Verify setup of Viewer" process and after getting to step 4 (where it has you run the index.mxml and opens a browser to view the flex viewer application....nothing is displayed. The web browser opens the url "http://www.localhost.com/flexviewer/index.html" and the page is blank? Why is this? I saved the flexviewer-2.0beta2-src.zip into a folder i have created "......My Documents\ArcGIS\ArcGIS API for Flex\ArcGIS_Flex. Flash Builder extracted the zip file correctly into "C:\Documents and Settings\coatesj\Adobe Flash Builder 4\FlexViewer". Can anyone tell me what I am doing wrong and what I need to do to get this rolling? I need to show the project on my web server, therefore the next steps  show you how to change the output folder and output folder URL...and I am guessing this is where I tie my server into the flex project to display it on my server. However, I have a service running in ArcGIS Server Manager....this map service is the one that I want to make a Flex map of.....so can anyone tell me what needs to be done next? I really appreciate everyone who has helped me thus far.....I feel like I'm getting closer and closer.


Josh C.
0 Kudos
DasaPaddock
Esri Regular Contributor
Open the Project Properties and go to the "Flex Build Path" section. If you have a local web server you can set the Output folder to a place that the web server will serve and set the corresponding URL. If not, then then set the Output folder to wherever you'd like and clear the URL field. This should let you run it from within Flash Builder. Once you're ready to deploy it to your production web server you should select "Export Release Build..." from the Project menu and choose a place to save the output and then copy that output folder to your production web server.
0 Kudos
JoshuaCoates
Deactivated User
I have a local server that I chose as the output folder.......and used the same for the output folder URL. I try to launch and I am getting an Application Error

Error: Event Target: [object HTTPOperation]

Event Type: fault

Fault Code: Server.Error.Request

Fault Info: HTTP request error

What does this mean?
0 Kudos
DasaPaddock
Esri Regular Contributor
Try using a tool like HttpFox, Firebug, Charles Proxy, Fiddler etc. to see the http requests and responses and see which ones are failing.
0 Kudos
JoshuaCoates
Deactivated User
I did this and all the types that are failing are all the ones that start with "text/html"....these are all mostly from URL "http://publicgis/floodplain/assets/images....". I have no idea what all this means?! Why am I having such horrible luck with Flex?! Is there something I am overlooking or does this happen for many people?
0 Kudos