java 调用webservice

狂奔啦蜗牛 发布于 2013/11/06 15:26
阅读 806
收藏 0

在java中调用webservice 来获取的数据的的时候,需要添加参数 参数类型是ArrayOfString,不明白这个类型添加一些数据后,会怎么执行查询,求指导 服务器端数据采用SSH架构,执行过程中出现如下的错误

详细代码如下:

Service service = new Service();
  List<HrPerson> person = new ArrayList<HrPerson>();
  System.out.println(service.getServiceName());
  System.out.println(service.getWSDLDocumentLocation());

  ServicePortType ser = service.getServiceHttpPort();
//  HrPerson hr = new HrPerson();
//
//  JAXBElement<String> sex = new JAXBElement<String>(new QName(
//    "http://test/yilihrService", "sex"), String.class, "男");
//
//  hr.setSex(sex);

  ArrayOfString num = new ArrayOfString();

  num.getString().add("2013");

  System.out.println(ser.getHrOrg(num));

  System.exit(0);

错误消息如下

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [select hrorg0_.ORG_ID as ORG1_0_, hrorg0_.PARENT_ID as PARENT2_0_, hrorg0_.NAME as NAME0_, hrorg0_.OID as OID0_, hrorg0_.FROMTIME as FROMTIME0_, hrorg0_.TOTIME as TOTIME0_, hrorg0_.RANK as RANK0_, hrorg0_.CREATOR as CREATOR0_, hrorg0_.TIMECREATED as TIMECREA9_0_, hrorg0_.WHOMODIFIED as WHOMODI10_0_, hrorg0_.TIMEMODIFIED as TIMEMOD11_0_, hrorg0_.DUTY as DUTY0_, hrorg0_.REMARK as REMARK0_, hrorg0_.FULL_NAME as FULL14_0_, hrorg0_.VIRTUAL as VIRTUAL0_, hrorg0_.LOGO as LOGO0_, hrorg0_.ORGLEVEL as ORGLEVEL0_, hrorg0_.AREA as AREA0_, hrorg0_.CORPORATION as CORPORA19_0_, hrorg0_.INDEPEN as INDEPEN0_, hrorg0_.TRADE as TRADE0_, hrorg0_.OTHERNAME as OTHERNAME0_, hrorg0_.GID as GID0_, hrorg0_.SEQUENCE as SEQUENCE0_, hrorg0_.TRADETYPE as TRADETYPE0_, hrorg0_.ENG_NAMES as ENG26_0_, hrorg0_.WETHER_VIRTUAL as WETHER27_0_, hrorg0_.OLD_ORGID as OLD28_0_, hrorg0_.DPM_HEADS as DPM29_0_, hrorg0_.ENGLISH_ID as ENGLISH30_0_, hrorg0_.INVEST_COMPANY as INVEST31_0_, hrorg0_.ORG_TYPE as ORG32_0_, hrorg0_.COMPANY as COMPANY0_, hrorg0_.SMSACCOUNT as SMSACCOUNT0_ from YILIEHR.HR_ORG hrorg0_ where hrorg0_.FROMTIME<sysdate and hrorg0_.TOTIME>sysdate]; SQL state [null]; error code [17008]; 关闭的连接; nested exception is java.sql.SQLException: 关闭的连接
 at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:188)
 at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:108)
 at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
 at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
 at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
 at $Proxy35.getHrOrg(Unknown Source)
 at test.test.main(test.java:34)

 

加载中
0
红薯
红薯
SQL state [null]; error code [17008]; 关闭的连接; nested exception is java.sql.SQLException: 关闭的连接
狂奔啦蜗牛
狂奔啦蜗牛
您的意思是说 我没连接上webservice?
返回顶部
顶部