Community of VE/MapPoint Users and Developers
This is a discussion on Axis2 with MapPoint 4.5 Java? within the MapPoint Web Service and Virtual Earth forums, part of the Map Forums category; Is MapPoint 4.5 compatible with Axis2? I cannot seem to generate all of the classes using wsdl2java. For example, MapPoint ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Axis2 with MapPoint 4.5 Java? MapPoint 3.0 with Axis 1.2 produced: RenderService.java RenderServiceLocator.java RenderServiceSoap.java RenderServiceSoapStub.java MapPoint 4.5 with Axis2 produces: RenderService.java RenderServiceCallbackHandler.java RenderServiceMessageReceiverInOut.java RenderServiceSkeleton.java RenderServiceStub.java I have also found other differences, e.g. Format.setHeight(Integer) is now format.setHeight(int), and several others similarly. Is it correct that MapPoint 4.1 is fully backward-compatible but 4.5 is not? Thank you Tom thomas.rowland@priceline.com |
| |||
| Re: Axis2 with MapPoint 4.5 Java? Yes mappoint 4.5 works fine with axis2. The mappoint types are generated as inner classes to the stub. You access everything through the stub. Generating the Java classes is almost the same as in axis1, except axis2 provides a .bat file you can use, and also some of the switch parameters are slightly different. Here is an example of generating the class files using ADB. You can also use JIBX or XMLBeans if you wish - let me know how that works out! Also make sure you also have all of the jar files in your classpath: wsdl2java -uri http://staging.mappoint.net/standard-30/mappoint.wsdl -ns2p http://s.mappoint.net/mappoint-30/=c...er.mappoint_45, http://s.mappoint.net/v40/=com.myapp...er.mappoint_45 -o .\mp45classfiles -g -t -wv 1.1 -d adb -ssi This creates the following files: CommonServiceCallbackHandler.java CommonServiceStub.java FindServiceCallbackHandler.java FindServiceStub.java RenderServiceCallbackHandler.java RenderServiceStub.java RouteServiceCallbackHandler.java RouteServiceStub.java You only need to use the stubs unless you are using asynch then you want to also make use of the callback handlers. Here is an example of using the RenderServiceStub to call the GetMap() method on a GetMap object: /************************************* * create your MapSpecification obj ************************************/ MapSpecification spec = new MapSpecification(); spec.setViews(aViews); spec.setDataSourceName("MapPoint.NA"); spec.setOptions(options); spec.setPushpins(aPushpins); /************************************* * the Stub ************************************/ RenderServiceStub stub = new RenderServiceStub(); /************************************** * Authenticator ************************************/ HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator(); auth.setUsername(MapManagerParams.getUsername()); auth.setPassword(MapManagerParams.getPassword()); auth.setPreemptiveAuthentication(true); /************************************** * ServiceClient options ************************************/ Options options = stub._getServiceClient().getOptions(); options.setProperty(HTTPConstants.AUTHENTICATE, auth); options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(90000)); options.setProperty(HTTPConstants.CONNECTION_TIMEO UT, new Integer(90000)); // make sure we are using HTTP 1.0 and not 1.1 options.setProperty( org.apache.axis2.context.MessageContextConstants.H TTP_PROTOCOL_VERSION, org.apache.axis2.transport.http.HTTPConstants.HEAD ER_PROTOCOL_10); //-- set the EndpointReference (the RenderServicURL) EndpointReference endpoint = new EndpointReference(sEndpoint); options.setTo(endpoint); /************************************* * GetMap object ************************************/ RenderServiceStub.GetMap getMap = new RenderServiceStub.GetMap(); getMap.setSpecification(spec); /************************************* * CustomerInfoRenderHeader ************************************/ CustomerInfoRenderHeader custInfoRenderHeader = new CustomerInfoRenderHeader(); custInfoRenderHeader.setCustomLogEntry((short) 20); CustomerInfoRenderHeader0 custInfoRenderHeader0 = new CustomerInfoRenderHeader0(); custInfoRenderHeader0.setCustomerInfoRenderHeader( custInfoRenderHeader); /************************************* * UserInfoRenderHeader ************************************/ UserInfoRenderHeader userInfoRenderHeader = new UserInfoRenderHeader(); userInfoRenderHeader.setDefaultDistanceUnit(Distan ceUnit.Mile); // CultureInfo CultureInfo cult = new CultureInfo(); // cultureInfo.setLcid(5); cult.setName("en-us"); // default is en-US userInfoRenderHeader.setCulture(cult); // countryRegionContext CountryRegionContext ctx = new CountryRegionContext(); ctx.setEntityID(244); userInfoRenderHeader.setContext(ctx); UserInfoRenderHeader6 userInfoRenderHeader6 = new UserInfoRenderHeader6(); userInfoRenderHeader6.setUserInfoRenderHeader(user InfoRenderHeader); /************************************* * Send the Request ************************************/ GetMapResponse mapResponse = stub.GetMap(getMap,custInfoRenderHeader0,userInfoR enderHeader6); /************************************* * get the images from the Response ************************************/ ArrayOfMapImage aImages = mapResponse.getGetMapResult(); MapImage[] images = aImages.getMapImage(); The above shows that working with the stubs and the ServiceClient are quite different using axis2, however working with the mappoint api has only changed slightly. E.g. the method params that used to be objects are now primitives, e.g.: pushpins[0].getLatLong().setLatitude(new Double(42.264779115928796)); is now pushpins[0].getLatLong().setLatitude(42.264779115928796); Another difference in the mappoint api is that every service method requires a userInfoHeader and customerInfoHeader param. Look at my code above to see how these are set - it tripped me up! One other difference in using axis2 was that there is no longer a client-config.wsdd. I have set those params programmatically here, but you can also use an axis2.xml file in its place. Here are some references that may help you with axis2: Axis2/Java - Axis2 Reference Guide Axis2/Java - Migrating from Axis 1.x Apache Axi2/Java | WSO2 Oxygen Tank Axis2 FAQ thanks, Your experiences/feedback are much appreciated! Tom thomas.rowland@priceline.com |
![]() |
| ||||
| Posted By | For | Type | Date | |
| MapPoint For Dummies - MP2K Magazine | This thread | Refback | 06-07-2007 08:07 PM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 05-31-2007 09:09 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mappoint java support | Anonymous | MapPoint Web Service and Virtual Earth | 7 | 02-20-2007 07:22 AM |
| mappoint cd development in java? | nprimex1 | MapPoint 2006/2009 Discussion | 2 | 03-23-2006 11:18 AM |
| Using MapPoint 2003 with Java | Anonymous | MapPoint 2006/2009 Discussion | 2 | 03-15-2004 03:36 PM |
| Integration of MapPoint in Java application | Shukri | MapPoint 2006/2009 Discussion | 0 | 09-29-2003 06:44 AM |
| something like mappoint, but for java... | Joeba | MapPoint 2006/2009 Discussion | 2 | 12-03-2002 09:14 AM |
Ski Deals
Book first-rate ski holidays from the leading travel brands at exceptionally competitive prices. Check out the latest range of ski deal online at Holiday Hypermarket.
Flights to Greece
Find cheap flights to Greece on Travel Counsellors. A personal Travel Counsellor can help you plan flights and find accommodation in Greece.
Holidays to Thailand
The best cultures and backgrounds make Thailand an interesting and memorable country to visit. Book great value holidays to Thailand online at dealchecker.co.uk.
Holidays in Dubai
Holidays in Dubai are an eclectic mix of the ancient and the modern. Discover an oasis of luxury amid the Arabian desert. Book here now!
Cheap Morocco Holidays
Cheap Morocco holidays may be the answer to your cheap holiday search. With sunshine throughout most of the year it can be great value if you avoid the peak season. Why not include a trip to the small tranquil town of Chefchaouen Tangier in your visit?
Travel
Check out the travel options on Travel.co.uk.
Holidays in Florida
Take a break! Enjoy stunning coastline! Info on holidays in Florida available at On The Beach!