1

I 'm trying to create a web service that will make a google map in my web site it works good when i run it in my web page but when running the web service alone I get this error message "The XML element 'EnableTheming' from namespace 'http://tempuri.org/' is already present in the current scope. Use XML attributes to specify another XML name or namespace for the element."

[WebMethod]
public void gMap(GMap GMapc)
{

GLatLng mainLocation = new GLatLng(24.706114, 46.748883);
GMapc.setCenter(mainLocation, 10);//setting the map


List<goMap> mapList = new List<goMap>();// list of locations
mapList.Add(new goMap { area = "Riyadh", name = "جمعية البر بشمال الرياض", locat = "24.733591", locon = "46.679189", url = "https://www.google.com.sa/maps/place/%D8%AC%D9%85%D8%B9%D9%8A%D8%A9+%D8%A7%D9%84%D8%A8%D8%B1+%D8%A8%D8%B4%D9%85%D8%A7%D9%84+%D8%A7%D9%84%D8%B1%D9%8A%D8%A7%D8%B6%E2%80%AD/@24.7410639,46.7132029,13z/data=!4m7!1m4!3m3!1s0x0:0x0!2zMjTCsDQ0JzI3LjgiTiA0NsKwNDAnNDEuNSJF!3b1!3m1!1s0x0000000000000000:0x1b34d99dfdaf74e2?hl=ar" });
mapList.Add(new goMap { area = "Riyadh", name = "جمعية البر فرع الربوة و الجنادرية", locat = "24.786491", locon = "46.759167", url = "https://www.google.com.sa/maps/place/%D8%AC%D9%85%D8%B9%D9%8A%D8%A9+%D8%A7%D9%84%D8%A8%D8%B1+%D9%81%D8%B1%D8%B9+%D8%A7%D9%84%D8%B1%D9%88%D8%B6%D8%A9+%D9%88%D8%A7%D9%84%D8%AC%D9%86%D8%A7%D8%AF%D8%B1%D9%8A%D8%A9%E2%80%AD/@24.7687204,46.7602613,18z/data=!3m1!4b1!4m2!3m1!1s0x3e2f01e493abfc01:0x266757deff3c5dcc?hl=ar" });
         mapList.Add(new goMap { area = "Riyadh", name = "جمعية البر حي الربوة و النظيم", locat = "24.706114", locon = "46.748883", url = "https://www.google.com.sa/maps/place/%D8%AC%D9%85%D8%B9%D9%8A%D8%A9+%D8%A7%D9%84%D8%A8%D8%B1+%D8%A8%D8%AD%D9%8A+%D8%A7%D9%84%D8%B1%D8%A8%D9%88%D8%A9+%D9%88%D8%A7%D9%84%D9%86%D8%B8%D9%8A%D9%85%E2%80%AD/@24.7059528,46.7511043,17z/data=!3m1!4b1!4m2!3m1!1s0x3e2f0158682882f9:0xf6700b68148a1812?hl=ar" });
         mapList.Add(new goMap { area = "Riyadh", name = "جمعية البر حي الربوة", locat = "24.691767", locon = "46.748202", url = "https://www.google.com.sa/maps/place/%D8%AC%D9%85%D8%B9%D9%8A%D8%A9+%D8%A7%D9%84%D8%A8%D8%B1+%D8%A8%D8%AD%D9%8A+%D8%A7%D9%84%D8%B1%D8%A8%D9%88%D8%A9%E2%80%AD/@24.6915669,46.7504231,17z/data=!3m1!4b1!4m2!3m1!1s0x3e2f06aa7be39105:0x5c362d8d3b8b15df?hl=ar" });
         mapList.Add(new goMap { area = "Riyadh", name = "جمعية البر السلي", locat = "24.677303", locon = "46.816226", url = "https://www.google.com.sa/maps/place/%D8%AC%D9%85%D8%B9%D9%8A%D8%A9+%D8%A7%D9%84%D8%A8%D8%B1%E2%80%AD/@24.6770446,46.8184357,17z/data=!3m1!4b1!4m2!3m1!1s0x3e2f078339eb83df:0x6d911b7f817ed234?hl=ar" });

         //Add Zoom in Zoom out
         GControl control = new GControl(GControl.preBuilt.LargeMapControl);
         GControl control2 = new GControl(GControl.preBuilt.MenuMapTypeControl, new GControlPosition(GControlPosition.position.Top_Right));
         GMapc.Add(control);
         GMapc.Add(control2);
         GMapc.Add(new GControl(GControl.preBuilt.GOverviewMapControl, new GControlPosition(GControlPosition.position.Bottom_Left)));
         //pin variables
         PinIcon p;
         GMarker gm;
         GInfoWindow win;
         foreach (var i in mapList)//to display pin icons from the list
         {
             p = new PinIcon(PinIcons.home, Color.LightGreen);
             gm = new GMarker(new GLatLng(Convert.ToDouble(i.locat), Convert.ToDouble(i.locon)),
             new GMarkerOptions(new GIcon(p.ToString(), p.Shadow())));
             //window to show the map informatiom
             win = new GInfoWindow(gm, i.name + " <a href='" + i.url + "'></a>", false, GListener.Event.mouseover);
             GMapc.Add(win);
         }


 }
Neda'a
  • 47
  • 1
  • 6
  • is a calss I have created inside the webservice – Neda'a Dec 04 '15 at 22:23
  • Possibly the same issue [as here](http://stackoverflow.com/questions/12492748/in-asp-net-webservice-passing-a-webcontrol-to-a-webmethod)? – ourmandave Dec 05 '15 at 02:11
  • I think it is the same issue, but is there any other way to make it possible? – Neda'a Dec 05 '15 at 05:50
  • I found this when I remove GMap from the parameter of the method the service will apear but the method wont function correctly. – Neda'a Dec 05 '15 at 06:17

0 Answers0