【问题标题】:HTTP Get method is not working on WebLogic ServerHTTP Get 方法在 WebLogic Server 上不起作用
【发布时间】:2023-01-18 17:36:19
【问题描述】:

我的 HTTP Get 方法在本地运行良好,但在 WebLogic Server 上部署 EAR(应用程序的创建耳)后它无法运行。

我在单击按钮(ActionListener)时调用此方法

private String httpGetMethod(String number) {
        String Result = null;
        try {
            OkHttpClient client = new OkHttpClient().newBuilder().build();
            MediaType mediaType = MediaType.parse("text/plain");
            RequestBody body = RequestBody.create(mediaType, "");
            //My API URL
            String URL ="https://apilink";
            Request request = new Request.Builder().url(URL).method("GET", null).build();
            Response response = client.newCall(request).execute();
            String InitResult = response.body().string();
            Result=InitResult;
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return Result;
    }

【问题讨论】:

  • 您使用哪个确切的 JDev 版本?你得到什么错误?

标签: java oracle weblogic oracle-adf


【解决方案1】:

问题已解决,如果在该服务器的网络配置中不允许对该 API url 进行互联网调用,则 HTTP Get 方法在 WebLogic Server 中不起作用。我们允许进入网络并且该方法在 WebLogic 中有效。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-29
    • 1970-01-01
    • 1970-01-01
    • 2015-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多