我使用java并尝试通过带有参数的post请求获取信息。我编写了两个不同的版本,一种使用 Apache httpclient,另一种使用 java.net。我还有一个用Python编写的版本(不是我的)java里的不行!我至少收到此错误作为响应:状态代码:500 内部服务器错误{"d":{"Message":"Fehler bei der Suche nach Funkanlagenstandorten.","StackTrace":"","Source":"","InnerException":""}}System.InvalidOperationException:“GetLocationsShare”不是有效的 Web 服务方法名称。在 System.Web.Services.Protocols.HttpServerProtocol.Initialize() 在 System.Web.Services.Protocols.ServerProtocolFactory.Create(类型类型、HttpContext 上下文、HttpRequest 请求、HttpResponse 响应、Boolean& abortProcessing)边界框:package objects;import java.util.ArrayList;import java.util.List;/** * order: west, south, east, north * * @author Zinke * */public class BoundingBox{ public final static double STEP = 0.03d; private double north; private double east; private double west; private double south; private static final double northMin = 47.0f, northMax = 55.0f; private static final double eastMin = 5.0f, eastMax = 16.0f; /** * <b>Initial constructor</b><br> * <br> * Bounding box for data scraping: Germany<br> * coordiantes in decimal degree<br> * <br> * order: west, south, east, north */ public BoundingBox() { setWest(eastMin); setSouth(northMin); setEast(eastMin + STEP); setNorth(northMin + STEP); } /** * Bounding box for data scraping: Germany<br> * coordiantes in decimal degree<br> * order: west, south, east, north * * @param west * @param south * @param east * @param north */ public BoundingBox(double north, double east,double south,double west) { setWest(west); setNorth(north); setEast(east); setSouth(south); } public double getNorth() { return north; } public void setNorth(double north) { this.north = north; }有人能帮帮我吗?
1 回答
幕布斯6054654
TA贡献1876条经验 获得超7个赞
你的代码似乎有效。我刚刚尝试过,仅更改了示例中提供的坐标值,并从我的浏览器调试控制台中提取了一些坐标值,并且它有效:
{"nord":51.7151177895987,"ost":12.70294189453125,"sued":9.857482910156252,"west":50.49770501038011}
我的猜测是,你应该确保你的班级没有错误BoundingBox
,并且每个坐标值的范围是合适的。
添加回答
举报
0/150
提交
取消