备份修改

This commit is contained in:
Jered Ye 2024-03-05 22:46:05 +08:00
parent 755e238e6f
commit 32b3c4ac88
11 changed files with 1113 additions and 69 deletions

View File

@ -3,4 +3,5 @@
<system systemId="http://47.95.22.126:8080/oj/webservice/OJWS?wsdl" uri="wsdl/47.95.22.126_8080/oj/webservice/OJWS.wsdl"/>
<system systemId="http://127.0.0.1:8080/oj/webservice/OJWS?wsdl" uri="wsdl/127.0.0.1_8080/oj/webservice/OJWS.wsdl"/>
<system systemId="http://106.15.36.190:80/oj/webservice/OJWS?wsdl" uri="wsdl/106.15.36.190_80/oj/webservice/OJWS.wsdl"/>
<system systemId="https://219.228.76.122:443/oj/webservice/OJWS?wsdl" uri="wsdl/219.228.76.122_443/oj/webservice/OJWS.wsdl"/>
</catalog>

View File

@ -872,7 +872,7 @@
</wsdl:binding>
<wsdl:service name="OJWS">
<wsdl:port binding="tns:OJWSSoapBinding" name="OJWSImplPort">
<soap:address location="http://106.15.36.190/oj/webservice/OJWS" />
<soap:address location="https://219.228.76.122:443/oj/webservice/OJWS" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@ -21,6 +21,7 @@ import java.util.List;
import java.util.Queue;
import javax.swing.JEditorPane;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.text.Element;
import javax.xml.namespace.QName;
import myjdom.model.Solution;
@ -124,6 +125,14 @@ public class Control {
}
//
public static JTextField getDistributorField(int a) {
switch (a) {
case 0:
return mainFrame.distributorIP;
default:
return mainFrame.distributorPort;
}
}
public static JEditorPane getJudgeInfoEditorPane(int a) {
switch (a) {
case 1:

View File

@ -63,6 +63,9 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel2">
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="&#x88c1;&#x5224;&#x673a;">
@ -80,26 +83,6 @@
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="comboCppCompiler" min="-2" pref="110" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="comboJavaCompiler" min="-2" pref="110" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="distributorIP" min="-2" pref="173" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="distributorPort" min="-2" pref="166" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="button_Start" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
@ -123,12 +106,37 @@
<EmptySpace max="32767" attributes="0"/>
<Component id="button_StartThread" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="comboCppCompiler" min="-2" pref="110" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="comboJavaCompiler" min="-2" pref="110" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="distributorIP" min="-2" pref="173" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="distributorPort" min="-2" pref="106" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jCheckBox2" min="-2" pref="66" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Component id="threadManagerTabb" min="-2" pref="955" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Component id="threadManagerTabb" min="-2" pref="955" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="49" max="-2" attributes="0"/>
<Component id="jSeparator1" pref="23" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="21" max="-2" attributes="0"/>
<Component id="jSeparator1" pref="1" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -149,6 +157,7 @@
<Component id="distributorPort" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="distributorIP" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jCheckBox2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
@ -204,6 +213,7 @@
<Component class="javax.swing.JTextField" name="distributorIP">
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JTextField()"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
@ -217,6 +227,9 @@
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="distributorPort">
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="jLabel14">
<Properties>
@ -550,6 +563,23 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="jCheckBox2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="&#x5b8b;&#x4f53;" size="12" style="2"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="cc" red="0" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="dubbo"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCheckBox2ActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="jCheckBox1.setToolTipText(&quot;&#x4e0b;&#x6b21;&#x7a0b;&#x5e8f;&#x542f;&#x52a8;&#x65f6;&#xff0c;&#x81ea;&#x52a8;&#x5f00;&#x59cb;&#x88c1;&#x5224;&quot;);"/>
</AuxValues>
</Component>
</SubComponents>
</Container>
</SubComponents>

View File

@ -22,6 +22,7 @@ import javax.swing.JOptionPane;
import javax.xml.namespace.QName;
import share.gui.NewCompileSetting;
import web.Dubboservice;
import web.Webservice;
/**
*
@ -130,6 +131,7 @@ public class MainFrame extends javax.swing.JFrame {
comboCppCompiler = new javax.swing.JComboBox();
jLabel10 = new javax.swing.JLabel();
comboJavaCompiler = new javax.swing.JComboBox();
jCheckBox2 = new javax.swing.JCheckBox();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
@ -289,6 +291,16 @@ public class MainFrame extends javax.swing.JFrame {
comboJavaCompiler.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
jCheckBox2.setFont(new java.awt.Font("宋体", 2, 12)); // NOI18N
jCheckBox2.setForeground(new java.awt.Color(0, 204, 102));
jCheckBox2.setText("dubbo");
jCheckBox1.setToolTipText("下次程序启动时,自动开始裁判");
jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox2ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
@ -299,25 +311,6 @@ public class MainFrame extends javax.swing.JFrame {
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboCppCompiler, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(9, 9, 9)
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(comboJavaCompiler, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(distributorIP, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(distributorPort, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(20, 20, 20))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(button_Start)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
@ -339,10 +332,33 @@ public class MainFrame extends javax.swing.JFrame {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(button_StartThread))))
.addComponent(threadManagerTabb, javax.swing.GroupLayout.PREFERRED_SIZE, 955, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(49, 49, 49)
.addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE))
.addComponent(button_StartThread))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboCppCompiler, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(9, 9, 9)
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(comboJavaCompiler, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(distributorIP, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(distributorPort, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jCheckBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(36, 36, 36))))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(threadManagerTabb, javax.swing.GroupLayout.PREFERRED_SIZE, 955, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(28, 28, 28)))
.addGap(21, 21, 21)
.addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 1, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -359,7 +375,8 @@ public class MainFrame extends javax.swing.JFrame {
.addComponent(jLabel4)
.addComponent(distributorPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(distributorIP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)))
.addComponent(jLabel3)
.addComponent(jCheckBox2)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
@ -449,6 +466,7 @@ public class MainFrame extends javax.swing.JFrame {
this.button_Start.setEnabled(false);
this.buttonStop.setEnabled(true);
this.button_StartThread.setEnabled(true);
Webservice.existDubbo=false;
// if(!Dubboservice.running){
// Dubboservice.main(null);
// Dubboservice.running=true;
@ -517,6 +535,10 @@ public class MainFrame extends javax.swing.JFrame {
}
}//GEN-LAST:event_jButton2ActionPerformed
private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox2ActionPerformed
Webservice.ENABLE_DUBBO=jCheckBox2.isSelected();
}//GEN-LAST:event_jCheckBox2ActionPerformed
private void loadConfig() {
this.distributorIP.setText(Config.getValue("distributorIP"));
this.distributorPort.setText(Config.getValue("distributorPort"));
@ -597,11 +619,12 @@ public class MainFrame extends javax.swing.JFrame {
javax.swing.JButton button_StartThread;
private javax.swing.JComboBox comboCppCompiler;
private javax.swing.JComboBox comboJavaCompiler;
private javax.swing.JTextField distributorIP;
private javax.swing.JTextField distributorPort;
public javax.swing.JTextField distributorIP;
public javax.swing.JTextField distributorPort;
private javax.swing.JButton jButton1;
javax.swing.JButton jButton2;
private javax.swing.JCheckBox jCheckBox1;
private javax.swing.JCheckBox jCheckBox2;
javax.swing.JComboBox<String> jComboBox1;
private javax.swing.JLabel jLabel10;
javax.swing.JLabel jLabel14;
@ -617,7 +640,7 @@ public class MainFrame extends javax.swing.JFrame {
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
public javax.swing.JPanel jPanel2;
javax.swing.JPanel jPanel6;
javax.swing.JPanel jPanel7;
private javax.swing.JScrollPane jScrollPane11;

View File

@ -0,0 +1,34 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package web;
import javax.net.ssl.*;
import java.security.cert.X509Certificate;
/**
*
* @author tange
*/
public class DisableHostnameVerifier {
public static void disable() throws Exception {
// 创建 SSLContext
SSLContext sslContext = SSLContext.getInstance("TLS");
// 创建一个 TrustManager实现 X509TrustManager 接口并禁用主题备用名称检查
X509TrustManager trustManager = new X509TrustManager() {
public void checkClientTrusted(X509Certificate[] chain, String authType) {}
public void checkServerTrusted(X509Certificate[] chain, String authType) {}
public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[0]; }
};
// 初始化 SSLContext将自定义的 TrustManager 添加到 TrustManager 数组中
sslContext.init(null, new TrustManager[] { trustManager }, null);
// 获取 SSLContext 中的 SSLSocketFactory并设置为默认的 SSLSocketFactory
HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
// 禁用主题备用名称检查
HttpsURLConnection.setDefaultHostnameVerifier((hostname, session) -> true);
}
}

View File

@ -11,8 +11,18 @@ import com.alibaba.dubbo.config.RegistryConfig;
import util.Decrypt;
import edu.dhu.ws.OJWS;
import edu.dhu.ws.OJWS_Service;
import static gui.Control.getDistributorField;
import static gui.Control.getJudgeInfoEditorPane;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
import java.time.LocalTime;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Resource;
import javax.swing.JEditorPane;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.xml.namespace.QName;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
@ -24,6 +34,8 @@ import org.apache.dubbo.config.annotation.DubboService;
public class Webservice implements java.rmi.Remote{
private OJWS_Service webs;
private OJWS servicePort;
public static boolean ENABLE_DUBBO=false;
public static boolean existDubbo=false;
//@DubboReference(url = "http://106.15.36.190:3000/edu.dhu.ws.OJWS")
//http://106.15.36.190:3000/edu.dhu.ws.OJWS
//dubbo://219.228.76.122:80/edu.dhu.ws.OJWS
@ -47,34 +59,81 @@ public class Webservice implements java.rmi.Remote{
// 初始化
return reference.get();
}
public Webservice(){
webs = new OJWS_Service();
try{
servicePort = webs.getOJWSImplPort();
}
catch(Exception e){}
private void setDubbo(){
String url = "dubbo://localhost:8080/edu.dhu.ws.OJWS";
JTextField ip=getDistributorField(0);
JTextField port=getDistributorField(1);
if(ip!=null)//测试时获取不到控件
url=String.format("dubbo://%s:%s/edu.dhu.ws.OJWS",ip.getText(),port.getText());
try
{
String url = "dubbo://192.168.0.101:20880/edu.dhu.ws.OJWS";//todo:需要改成用户自己输入
JEditorPane infoPane=getJudgeInfoEditorPane(0);
if(!existDubbo&&infoPane!=null)
infoPane.setText(infoPane.getText()+LocalTime.now().toString()+"正在请求Dubbo服务...\n");
//String url = "dubbo://219.228.76.122:20880/edu.dhu.ws.OJWS";//todo:需要改成用户自己输入
dubboPort = initDubboPort(url);
}
catch(Exception e){
JEditorPane infoPane=getJudgeInfoEditorPane(1);
infoPane.setText(infoPane.getText()+LocalTime.now().toString()+e.getMessage()+"\n");
e.printStackTrace();
}
if(dubboPort!=null){
JEditorPane infoPane=getJudgeInfoEditorPane(0);
if(!existDubbo&&infoPane!=null)
infoPane.setText(infoPane.getText()+LocalTime.now().toString()+"\nDubbo服务连接成功URL:"+url+"\n");
existDubbo=true;
servicePort=dubboPort;
}else{
existDubbo=false;
JEditorPane infoPane=getJudgeInfoEditorPane(1);
infoPane.setText(infoPane.getText()+LocalTime.now().toString()+"\nDubbo服务连接失败URL:"+url+"\n");
}
//如果能使用dubbo服务就使用不能的话就用原来的
}
public Webservice(URL url,QName qname)throws java.rmi.RemoteException{
webs = new OJWS_Service(url,qname);
servicePort = webs.getOJWSImplPort();
public Webservice(){
try {
DisableHostnameVerifier.disable();
} catch (Exception ex) {
Logger.getLogger(Webservice.class.getName()).log(Level.SEVERE, null, ex);
}
if(!ENABLE_DUBBO){
try{
webs = new OJWS_Service();
servicePort = webs.getOJWSImplPort();
}
catch(Exception e){
e.printStackTrace();
}
}
else
setDubbo();
}
public Webservice(URL url,QName qname)throws java.rmi.RemoteException, MalformedURLException{
url=new URL("https",url.getHost(),url.getPort(),url.getFile());
try {
DisableHostnameVerifier.disable();
} catch (Exception ex) {
Logger.getLogger(Webservice.class.getName()).log(Level.SEVERE, null, ex);
}
if(!ENABLE_DUBBO){
try{
webs = new OJWS_Service(url,qname);
servicePort = webs.getOJWSImplPort();
}
catch(Exception e){
JEditorPane infoPane=getJudgeInfoEditorPane(1);
infoPane.setText(infoPane.getText()+LocalTime.now().toString()+e.getMessage()+"\n");
}
}
else
setDubbo();
}
public String getSolutions(int arg0)throws java.rmi.RemoteException{
String s =this.servicePort.wsGetSolutions("judge","judge123",arg0);
@ -94,6 +153,13 @@ public class Webservice implements java.rmi.Remote{
}
public static void main(String[] args) {
Webservice ws=new Webservice();
System.out.println(ws.dubboPort.test("a"));
try {
System.out.println(ws.getProblem(75));
} catch (RemoteException ex) {
Logger.getLogger(Webservice.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
//////P.S.部署到服务器时要注意账号密码修改

View File

@ -872,7 +872,7 @@
</wsdl:binding>
<wsdl:service name="OJWS">
<wsdl:port binding="tns:OJWSSoapBinding" name="OJWSImplPort">
<soap:address location="http://106.15.36.190/oj/webservice/OJWS" />
<soap:address location="https://106.15.36.190:80/oj/webservice/OJWS" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@ -0,0 +1,878 @@
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="OJWS" targetNamespace="http://ws.dhu.edu/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.dhu.edu/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xs:schema elementFormDefault="unqualified" targetNamespace="http://ws.dhu.edu/" version="1.0" xmlns:tns="http://ws.dhu.edu/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="WS_CanDoCategory" type="tns:WS_CanDoCategory" />
<xs:element name="WS_CanDoCategoryResponse" type="tns:WS_CanDoCategoryResponse" />
<xs:element name="WS_DrawProblem" type="tns:WS_DrawProblem" />
<xs:element name="WS_DrawProblemResponse" type="tns:WS_DrawProblemResponse" />
<xs:element name="WS_GetExamById" type="tns:WS_GetExamById" />
<xs:element name="WS_GetExamByIdResponse" type="tns:WS_GetExamByIdResponse" />
<xs:element name="WS_GetExamDetail" type="tns:WS_GetExamDetail" />
<xs:element name="WS_GetExamDetailResponse" type="tns:WS_GetExamDetailResponse" />
<xs:element name="WS_GetExamList" type="tns:WS_GetExamList" />
<xs:element name="WS_GetExamListResponse" type="tns:WS_GetExamListResponse" />
<xs:element name="WS_GetExamProCatagorys" type="tns:WS_GetExamProCatagorys" />
<xs:element name="WS_GetExamProCatagorysResponse" type="tns:WS_GetExamProCatagorysResponse" />
<xs:element name="WS_GetExamProblemStatus" type="tns:WS_GetExamProblemStatus" />
<xs:element name="WS_GetExamProblemStatusResponse" type="tns:WS_GetExamProblemStatusResponse" />
<xs:element name="WS_GetExamProblems" type="tns:WS_GetExamProblems" />
<xs:element name="WS_GetExamProblemsResponse" type="tns:WS_GetExamProblemsResponse" />
<xs:element name="WS_GetProblem" type="tns:WS_GetProblem" />
<xs:element name="WS_GetProblem4Judge" type="tns:WS_GetProblem4Judge" />
<xs:element name="WS_GetProblem4JudgeResponse" type="tns:WS_GetProblem4JudgeResponse" />
<xs:element name="WS_GetProblemResponse" type="tns:WS_GetProblemResponse" />
<xs:element name="WS_GetSolutions" type="tns:WS_GetSolutions" />
<xs:element name="WS_GetSolutionsResponse" type="tns:WS_GetSolutionsResponse" />
<xs:element name="WS_IsPermit" type="tns:WS_IsPermit" />
<xs:element name="WS_IsPermitResponse" type="tns:WS_IsPermitResponse" />
<xs:element name="WS_ItrainSubmitCode" type="tns:WS_ItrainSubmitCode" />
<xs:element name="WS_ItrainSubmitCodeResponse" type="tns:WS_ItrainSubmitCodeResponse" />
<xs:element name="WS_ItrainSubmitThisProblem" type="tns:WS_ItrainSubmitThisProblem" />
<xs:element name="WS_ItrainSubmitThisProblemResponse" type="tns:WS_ItrainSubmitThisProblemResponse" />
<xs:element name="WS_Login" type="tns:WS_Login" />
<xs:element name="WS_LoginResponse" type="tns:WS_LoginResponse" />
<xs:element name="WS_PassThisCategory" type="tns:WS_PassThisCategory" />
<xs:element name="WS_PassThisCategoryResponse" type="tns:WS_PassThisCategoryResponse" />
<xs:element name="WS_SkipThisProblem" type="tns:WS_SkipThisProblem" />
<xs:element name="WS_SkipThisProblemResponse" type="tns:WS_SkipThisProblemResponse" />
<xs:element name="WS_SubmitCode" type="tns:WS_SubmitCode" />
<xs:element name="WS_SubmitCodeResponse" type="tns:WS_SubmitCodeResponse" />
<xs:element name="WS_SubmitHistory" type="tns:WS_SubmitHistory" />
<xs:element name="WS_SubmitHistoryResponse" type="tns:WS_SubmitHistoryResponse" />
<xs:element name="WS_SubmitThisProblem" type="tns:WS_SubmitThisProblem" />
<xs:element name="WS_SubmitThisProblemResponse" type="tns:WS_SubmitThisProblemResponse" />
<xs:element name="WS_SubmittedCode" type="tns:WS_SubmittedCode" />
<xs:element name="WS_SubmittedCodeResponse" type="tns:WS_SubmittedCodeResponse" />
<xs:element name="WS_UpdateResult" type="tns:WS_UpdateResult" />
<xs:element name="WS_UpdateResultResponse" type="tns:WS_UpdateResultResponse" />
<xs:element name="WS_ViewWrongCase" type="tns:WS_ViewWrongCase" />
<xs:element name="WS_ViewWrongCaseResponse" type="tns:WS_ViewWrongCaseResponse" />
<xs:complexType name="WS_GetExamList">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetExamListResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetProblem">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
<xs:element name="arg3" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetProblemResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:base64Binary" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_SubmitThisProblem">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element minOccurs="0" name="arg2" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_SubmitThisProblemResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_DrawProblem">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
<xs:element name="arg3" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_DrawProblemResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:base64Binary" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_SubmittedCode">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_SubmittedCodeResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_Login">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_LoginResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_SkipThisProblem">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
<xs:element name="arg3" type="xs:int" />
<xs:element name="arg4" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_SkipThisProblemResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetSolutions">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetSolutionsResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_ItrainSubmitCode">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
<xs:element minOccurs="0" name="arg3" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_ItrainSubmitCodeResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_ViewWrongCase">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
<xs:element name="arg3" type="xs:int" />
<xs:element name="arg4" type="xs:int" />
<xs:element name="arg5" type="xs:boolean" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_ViewWrongCaseResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_SubmitHistory">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_SubmitHistoryResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetExamById">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetExamByIdResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetProblem4Judge">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetProblem4JudgeResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:base64Binary" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_SubmitCode">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element minOccurs="0" name="arg2" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_SubmitCodeResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetExamProblemStatus">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
<xs:element name="arg3" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetExamProblemStatusResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_IsPermit">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
<xs:element minOccurs="0" name="arg3" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_IsPermitResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_PassThisCategory">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
<xs:element name="arg3" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_PassThisCategoryResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetExamProblems">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetExamProblemsResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_CanDoCategory">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_CanDoCategoryResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_UpdateResult">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element minOccurs="0" name="arg2" type="xs:base64Binary" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_UpdateResultResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetExamProCatagorys">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetExamProCatagorysResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_ItrainSubmitThisProblem">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
<xs:element minOccurs="0" name="arg3" type="xs:string" />
<xs:element minOccurs="0" name="arg4" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_ItrainSubmitThisProblemResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetExamDetail">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element name="arg2" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="WS_GetExamDetailResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="WS_GetExamProCatagorysResponse">
<wsdl:part element="tns:WS_GetExamProCatagorysResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetExamByIdResponse">
<wsdl:part element="tns:WS_GetExamByIdResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetExamList">
<wsdl:part element="tns:WS_GetExamList" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetExamProblemsResponse">
<wsdl:part element="tns:WS_GetExamProblemsResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetProblem">
<wsdl:part element="tns:WS_GetProblem" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_DrawProblem">
<wsdl:part element="tns:WS_DrawProblem" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_ViewWrongCaseResponse">
<wsdl:part element="tns:WS_ViewWrongCaseResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetProblem4JudgeResponse">
<wsdl:part element="tns:WS_GetProblem4JudgeResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_SubmittedCode">
<wsdl:part element="tns:WS_SubmittedCode" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_ItrainSubmitCodeResponse">
<wsdl:part element="tns:WS_ItrainSubmitCodeResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_SkipThisProblem">
<wsdl:part element="tns:WS_SkipThisProblem" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_UpdateResultResponse">
<wsdl:part element="tns:WS_UpdateResultResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_ItrainSubmitCode">
<wsdl:part element="tns:WS_ItrainSubmitCode" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetExamById">
<wsdl:part element="tns:WS_GetExamById" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_SubmitCode">
<wsdl:part element="tns:WS_SubmitCode" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_PassThisCategory">
<wsdl:part element="tns:WS_PassThisCategory" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_ItrainSubmitThisProblemResponse">
<wsdl:part element="tns:WS_ItrainSubmitThisProblemResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetProblemResponse">
<wsdl:part element="tns:WS_GetProblemResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_IsPermitResponse">
<wsdl:part element="tns:WS_IsPermitResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_CanDoCategory">
<wsdl:part element="tns:WS_CanDoCategory" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_UpdateResult">
<wsdl:part element="tns:WS_UpdateResult" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetExamProCatagorys">
<wsdl:part element="tns:WS_GetExamProCatagorys" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_ItrainSubmitThisProblem">
<wsdl:part element="tns:WS_ItrainSubmitThisProblem" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_CanDoCategoryResponse">
<wsdl:part element="tns:WS_CanDoCategoryResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_SubmitThisProblem">
<wsdl:part element="tns:WS_SubmitThisProblem" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_SubmitThisProblemResponse">
<wsdl:part element="tns:WS_SubmitThisProblemResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_SubmittedCodeResponse">
<wsdl:part element="tns:WS_SubmittedCodeResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_Login">
<wsdl:part element="tns:WS_Login" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_SubmitHistoryResponse">
<wsdl:part element="tns:WS_SubmitHistoryResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetExamDetailResponse">
<wsdl:part element="tns:WS_GetExamDetailResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetSolutions">
<wsdl:part element="tns:WS_GetSolutions" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_SubmitCodeResponse">
<wsdl:part element="tns:WS_SubmitCodeResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_PassThisCategoryResponse">
<wsdl:part element="tns:WS_PassThisCategoryResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetExamListResponse">
<wsdl:part element="tns:WS_GetExamListResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_LoginResponse">
<wsdl:part element="tns:WS_LoginResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_ViewWrongCase">
<wsdl:part element="tns:WS_ViewWrongCase" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_SkipThisProblemResponse">
<wsdl:part element="tns:WS_SkipThisProblemResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_SubmitHistory">
<wsdl:part element="tns:WS_SubmitHistory" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_DrawProblemResponse">
<wsdl:part element="tns:WS_DrawProblemResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetProblem4Judge">
<wsdl:part element="tns:WS_GetProblem4Judge" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetExamProblemStatus">
<wsdl:part element="tns:WS_GetExamProblemStatus" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_IsPermit">
<wsdl:part element="tns:WS_IsPermit" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetExamProblems">
<wsdl:part element="tns:WS_GetExamProblems" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetExamProblemStatusResponse">
<wsdl:part element="tns:WS_GetExamProblemStatusResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetSolutionsResponse">
<wsdl:part element="tns:WS_GetSolutionsResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="WS_GetExamDetail">
<wsdl:part element="tns:WS_GetExamDetail" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="OJWS">
<wsdl:operation name="WS_GetExamList">
<wsdl:input message="tns:WS_GetExamList" name="WS_GetExamList">
</wsdl:input>
<wsdl:output message="tns:WS_GetExamListResponse" name="WS_GetExamListResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetProblem">
<wsdl:input message="tns:WS_GetProblem" name="WS_GetProblem">
</wsdl:input>
<wsdl:output message="tns:WS_GetProblemResponse" name="WS_GetProblemResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_SubmitThisProblem">
<wsdl:input message="tns:WS_SubmitThisProblem" name="WS_SubmitThisProblem">
</wsdl:input>
<wsdl:output message="tns:WS_SubmitThisProblemResponse" name="WS_SubmitThisProblemResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_DrawProblem">
<wsdl:input message="tns:WS_DrawProblem" name="WS_DrawProblem">
</wsdl:input>
<wsdl:output message="tns:WS_DrawProblemResponse" name="WS_DrawProblemResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_SubmittedCode">
<wsdl:input message="tns:WS_SubmittedCode" name="WS_SubmittedCode">
</wsdl:input>
<wsdl:output message="tns:WS_SubmittedCodeResponse" name="WS_SubmittedCodeResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_Login">
<wsdl:input message="tns:WS_Login" name="WS_Login">
</wsdl:input>
<wsdl:output message="tns:WS_LoginResponse" name="WS_LoginResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_SkipThisProblem">
<wsdl:input message="tns:WS_SkipThisProblem" name="WS_SkipThisProblem">
</wsdl:input>
<wsdl:output message="tns:WS_SkipThisProblemResponse" name="WS_SkipThisProblemResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetSolutions">
<wsdl:input message="tns:WS_GetSolutions" name="WS_GetSolutions">
</wsdl:input>
<wsdl:output message="tns:WS_GetSolutionsResponse" name="WS_GetSolutionsResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_ItrainSubmitCode">
<wsdl:input message="tns:WS_ItrainSubmitCode" name="WS_ItrainSubmitCode">
</wsdl:input>
<wsdl:output message="tns:WS_ItrainSubmitCodeResponse" name="WS_ItrainSubmitCodeResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_ViewWrongCase">
<wsdl:input message="tns:WS_ViewWrongCase" name="WS_ViewWrongCase">
</wsdl:input>
<wsdl:output message="tns:WS_ViewWrongCaseResponse" name="WS_ViewWrongCaseResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_SubmitHistory">
<wsdl:input message="tns:WS_SubmitHistory" name="WS_SubmitHistory">
</wsdl:input>
<wsdl:output message="tns:WS_SubmitHistoryResponse" name="WS_SubmitHistoryResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetExamById">
<wsdl:input message="tns:WS_GetExamById" name="WS_GetExamById">
</wsdl:input>
<wsdl:output message="tns:WS_GetExamByIdResponse" name="WS_GetExamByIdResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetProblem4Judge">
<wsdl:input message="tns:WS_GetProblem4Judge" name="WS_GetProblem4Judge">
</wsdl:input>
<wsdl:output message="tns:WS_GetProblem4JudgeResponse" name="WS_GetProblem4JudgeResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_SubmitCode">
<wsdl:input message="tns:WS_SubmitCode" name="WS_SubmitCode">
</wsdl:input>
<wsdl:output message="tns:WS_SubmitCodeResponse" name="WS_SubmitCodeResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetExamProblemStatus">
<wsdl:input message="tns:WS_GetExamProblemStatus" name="WS_GetExamProblemStatus">
</wsdl:input>
<wsdl:output message="tns:WS_GetExamProblemStatusResponse" name="WS_GetExamProblemStatusResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_IsPermit">
<wsdl:input message="tns:WS_IsPermit" name="WS_IsPermit">
</wsdl:input>
<wsdl:output message="tns:WS_IsPermitResponse" name="WS_IsPermitResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_PassThisCategory">
<wsdl:input message="tns:WS_PassThisCategory" name="WS_PassThisCategory">
</wsdl:input>
<wsdl:output message="tns:WS_PassThisCategoryResponse" name="WS_PassThisCategoryResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetExamProblems">
<wsdl:input message="tns:WS_GetExamProblems" name="WS_GetExamProblems">
</wsdl:input>
<wsdl:output message="tns:WS_GetExamProblemsResponse" name="WS_GetExamProblemsResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_CanDoCategory">
<wsdl:input message="tns:WS_CanDoCategory" name="WS_CanDoCategory">
</wsdl:input>
<wsdl:output message="tns:WS_CanDoCategoryResponse" name="WS_CanDoCategoryResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_UpdateResult">
<wsdl:input message="tns:WS_UpdateResult" name="WS_UpdateResult">
</wsdl:input>
<wsdl:output message="tns:WS_UpdateResultResponse" name="WS_UpdateResultResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetExamProCatagorys">
<wsdl:input message="tns:WS_GetExamProCatagorys" name="WS_GetExamProCatagorys">
</wsdl:input>
<wsdl:output message="tns:WS_GetExamProCatagorysResponse" name="WS_GetExamProCatagorysResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_ItrainSubmitThisProblem">
<wsdl:input message="tns:WS_ItrainSubmitThisProblem" name="WS_ItrainSubmitThisProblem">
</wsdl:input>
<wsdl:output message="tns:WS_ItrainSubmitThisProblemResponse" name="WS_ItrainSubmitThisProblemResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetExamDetail">
<wsdl:input message="tns:WS_GetExamDetail" name="WS_GetExamDetail">
</wsdl:input>
<wsdl:output message="tns:WS_GetExamDetailResponse" name="WS_GetExamDetailResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="OJWSSoapBinding" type="tns:OJWS">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="WS_GetExamList">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_GetExamList">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_GetExamListResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetProblem">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_GetProblem">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_GetProblemResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_SubmitThisProblem">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_SubmitThisProblem">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_SubmitThisProblemResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_DrawProblem">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_DrawProblem">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_DrawProblemResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_SubmittedCode">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_SubmittedCode">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_SubmittedCodeResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_Login">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_Login">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_LoginResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_SkipThisProblem">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_SkipThisProblem">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_SkipThisProblemResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetSolutions">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_GetSolutions">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_GetSolutionsResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_ItrainSubmitCode">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_ItrainSubmitCode">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_ItrainSubmitCodeResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_ViewWrongCase">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_ViewWrongCase">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_ViewWrongCaseResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_SubmitHistory">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_SubmitHistory">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_SubmitHistoryResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetExamById">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_GetExamById">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_GetExamByIdResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetProblem4Judge">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_GetProblem4Judge">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_GetProblem4JudgeResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_SubmitCode">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_SubmitCode">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_SubmitCodeResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetExamProblemStatus">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_GetExamProblemStatus">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_GetExamProblemStatusResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_IsPermit">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_IsPermit">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_IsPermitResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_PassThisCategory">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_PassThisCategory">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_PassThisCategoryResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetExamProblems">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_GetExamProblems">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_GetExamProblemsResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_CanDoCategory">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_CanDoCategory">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_CanDoCategoryResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_UpdateResult">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_UpdateResult">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_UpdateResultResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetExamProCatagorys">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_GetExamProCatagorys">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_GetExamProCatagorysResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_ItrainSubmitThisProblem">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_ItrainSubmitThisProblem">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_ItrainSubmitThisProblemResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WS_GetExamDetail">
<soap:operation soapAction="" style="document" />
<wsdl:input name="WS_GetExamDetail">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="WS_GetExamDetailResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="OJWS">
<wsdl:port binding="tns:OJWSSoapBinding" name="OJWSImplPort">
<soap:address location="https://219.228.76.122:443/oj/webservice/OJWS" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@ -9,6 +9,7 @@ import MyCache.Shared;
import common.Config;
import resultData.RunInfo;
import common.Const;
import common.LangSelector;
//import gui.Control;
import java.io.BufferedWriter;
import java.io.File;
@ -110,17 +111,19 @@ public class Judger {
String linkCommand = Config.getCompilerDir(language) + File.separator + "g++ " +"\""+ Config.getTargetPath() +File.separator+"output"+File.separator+ "Main"+".o"+"\"" + " -o " +"\""+ Config.getTargetPath()+File.separator+"output"+File.separator + "Main"+".exe"+"\"\n";
return linkCommand;
}
/////////////////////////////////////////////////////////////////////////////////////////////////TODO
//mingw32-g++.exe -Wall -g -c E:\Downloads\aaa\aa.cpp -o obj\Debug\aa.o
//mingw32-g++.exe -o bin\Debug\aaa.exe obj\Debug\aa.o
private String compileCommand(String language) {
String compileCommand = "";
language = language.toLowerCase();
language = language.toLowerCase();//todo
if (language.equals("c")) {
compileCommand += "\"" + Config.getCompilerDir(language) + File.separator + "gcc\" -c " + "\""+sourceFile +"\""+ " -o " +"\""+Config.getTargetPath()+ File.separator+"output"+ File.separator + "Main"+".o"+"\"\n";
} else if (language.equals("java")) {
compileCommand += "\"" + Config.getCompilerDir(language) + File.separator + "javac\" " + sourceFile; //todoÎļþ·¾
} else if (language.equals("cpp")||language.equals("c++")) {
compileCommand += "\"" + Config.getCompilerDir(language) + File.separator + "g++\" -Wall -g -std=c++14 -c "
//compileCommand +=Config.getCompilerDir(language) + File.separator +LangSelector.getCompileCommand("C++",null);
compileCommand += "\"" + Config.getCompilerDir(language) + File.separator + "g++\" -Wall -g -c -std=c++14 "//todo:C++14
+ "\""+sourceFile+"\"" + " -o " + "\""+Config.getTargetPath()+ File.separator+"output"+ File.separator + "Main"+".o"+"\"\n";
} else {
CompileInfo.info = "this programing language is not support!!!";