简体   繁体   English

RESTful Web服务的XML输入

[英]XML input for a RESTful web service

I have an xml input file from the following URL, 我有一个来自以下URL的xml输入文件,

http://maps.googleapis.com/maps/api/geocode/xml?address=new%20york%20&%20sensor=false ; http://maps.googleapis.com/maps/api/geocode/xml?address=new%20york%20&%20sensor=false

i would like to read the latitude and longitude positions from the XML file and i intend to write a method in the RESTful web service which calculate the location with minimum distance from each other. 我想从XML文件读取纬度和经度位置,我打算在RESTful Web服务中编写一种方法,该方法计算彼此之间的最小距离的位置。

i am very new to web services but i am aware that i should write my logic within the GET method and the @consumes and @produces will be XML. 我对Web服务非常陌生,但是我知道我应该在GET方法中编写逻辑,并且@consumes和@produces将是XML。

i need some help to understand how should i pass the XML to the web service. 我需要一些帮助,以了解如何将XML传递到Web服务。 Should i use JDOM to extract the value from the requires tag and pass it as a parameter to the web service ? 我是否应该使用JDOM从require标记中提取值并将其作为参数传递给Web服务?

need some help ! 需要一些帮助 !

HTTP GET method won't work here since you need to send some data in the payload. HTTP GET方法在这里无效,因为您需要在有效负载中发送一些数据。 You can use POST method which allows you to send a message body. 您可以使用POST方法来发送消息正文。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM