DiexcService2.java 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package com.cxfws.demo.service.impl;
  2. import javax.annotation.PostConstruct;
  3. import javax.jws.WebMethod;
  4. import javax.jws.WebResult;
  5. import javax.jws.WebService;
  6. import org.json.JSONArray;
  7. import org.json.JSONException;
  8. import org.json.JSONObject;
  9. import org.springframework.stereotype.Service;
  10. @Service("diexcWebService2")
  11. @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "diexcWebService2Port", serviceName = "diexcWebService2")
  12. public class DiexcService2{
  13. @PostConstruct
  14. private void init(){
  15. //System.out.println("------DiexcService2--init-");
  16. }
  17. @WebMethod(operationName = "excTable",action="http://service.web.jsjty.com/excTable")
  18. @WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
  19. public String excTable(int num) {
  20. JSONArray jsons=new JSONArray();
  21. try {
  22. jsons.put(new JSONObject().put("sid", "dservice2"));
  23. } catch (JSONException e) {
  24. e.printStackTrace();
  25. }
  26. return jsons.toString();
  27. }
  28. }