Help to generate WebService client to consume services Bing in Java


hello everyone, created a webservice client using address for netbeans

http://dev.virtualearth.net/webservices/v1/metadata/geocodeservice/geocodeservice.wsdl

my code:

 

 public static void main(string[] args) {         try {             qname spacename = new qname("http://dev.virtualearth.net/webservices/v1/geocode");             string key = new string("bing maps key");             jaxbelement<string> appid = new jaxbelement<string>(spacename, string.class, key);             credentials credential = new credentials();             credential.setapplicationid(appid);             jaxbelement<credentials> cred = new jaxbelement<credentials>(spacename, credentials.class, credential);             location location = new location();             location.setlatitude(double.parsedouble("-26.9299"));             location.setlongitude(double.parsedouble("-48.9484"));             jaxbelement<location> loca = new jaxbelement<location>(spacename, location.class, location);             reversegeocoderequest request = new reversegeocoderequest();             request.setcredentials(cred);             request.setlocation(loca);             geocoderesponse resp = reversegeocode(request);             list<geocoderesult> result= (list<geocoderesult>) resp.getresults();         } catch (exception e) {             e.printstacktrace();         }     } 


have problem:

 

javax.xml.ws.soap.soapfaultexception: formatter threw exception while trying deserialize message: there error while trying deserialize parameter http://dev.virtualearth.net/webservices/v1/geocode/contracts:request. innerexception message 'there error deserializing object of type microsoft.virtualearth.publictypes.geocode.reversegeocoderequest. '/' character, hexadecimal value 0x2f, cannot included in name. line 1, position 457.'.  please see innerexception more details. 	at com.sun.xml.internal.ws.fault.soap11fault.getprotocolexception(soap11fault.java:178) 	at com.sun.xml.internal.ws.fault.soapfaultbuilder.createexception(soapfaultbuilder.java:111) 	at com.sun.xml.internal.ws.client.sei.syncmethodhandler.invoke(syncmethodhandler.java:108) 	at com.sun.xml.internal.ws.client.sei.syncmethodhandler.invoke(syncmethodhandler.java:78) 	at com.sun.xml.internal.ws.client.sei.seistub.invoke(seistub.java:107) 	at $proxy35.reversegeocode(unknown source) 	at mobileclient.main.reversegeocode(main.java:500) 	at mobileclient.main.main(main.java:53) 

someone could me with problem?

thank you!

 

 



take @ article: http://ngjon.wordpress.com/2010/01/19/simple-java-starter-applications-using-bing-maps-web-services/

there several other articles on blog regarding soap services , java. said highly recommend using rest services instead of soap services. if want use rest services take @ bing maps android sdk has bunch of libraries connecting rest services. http://bingmapsandroidsdk.codeplex.com/


http://rbrundritt.wordpress.com


Bing Maps  >  Bing Maps REST, SOAP, Spatial Data Services



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'