我使用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
提交
取消