MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Axis2 with MapPoint 4.5 Java?

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint Web Service and Virtual Earth

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 05-30-2007
Junior Member
White Belt
 
Join Date: May 2007
Location: Connecticut
Posts: 5
Axis2 with MapPoint 4.5 Java?

Is MapPoint 4.5 compatible with Axis2? I cannot seem to generate all of the classes using wsdl2java. For example,

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 06-08-2007
Junior Member
White Belt
 
Join Date: May 2007
Location: Connecticut
Posts: 5
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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/axis2-mappoint-4-5-java-5913.html

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 12:56 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

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!


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51