在報錯項目的idea路徑下(示例路徑,根據實際情況查找)
D:\idea_workspace\demo\.idea\artifacts
,找到錯誤提示中的模塊名,此處示例為“ueditor”,應該會有兩個文件(ueditor_war_exploded.xml 和 ueditor_war.xml),刪除再重新編譯即可。posted @ 2018-02-24 10:46 朱杰兵 閱讀(437) | 評論 (0) | 編輯 收藏
posts - 140, comments - 1, trackbacks - 0, articles - 0 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
解決辦法: 在報錯項目的idea路徑下(示例路徑,根據實際情況查找) D:\idea_workspace\demo\.idea\artifacts ,找到錯誤提示中的模塊名,此處示例為“ueditor”,應該會有兩個文件(ueditor_war_exploded.xml 和 ueditor_war.xml),刪除再重新編譯即可。posted @ 2018-02-24 10:46 朱杰兵 閱讀(437) | 評論 (0) | 編輯 收藏 問題:idea使用過程中 報告 plugin error。 Error Loading Project: Cannot load 10 artifacts Details... 并且 tomcat不能配置。 解決:打開setting>>plugins>>啟用 application servers View. 多次勾選后再取消,重啟idea。安裝插件 (本人打開plugin界面時,application server 為紅色,點擊兩次enable就可以,當時以為報紅是因為缺少插件,廢了不少時間) ![]() posted @ 2018-02-24 10:29 朱杰兵 閱讀(337) | 評論 (0) | 編輯 收藏 |
1 | < soap:Envelope xmlns:soap = "http://www.w3.org/2003/05/soap-envelope" xmlns:sam = "http://user.service.xxx.com" > |
2 | < soap:Header /> |
3 | < soap:Body > |
4 | < sam:getUserInfo > |
5 | < sam:userName >sunlightcs</ sam:userName > |
6 | </ sam:getUserInfo > |
7 | </ soap:Body > |
8 | </ soap:Envelope > |
01 | import java.io.IOException; |
02 | import java.io.OutputStream; |
03 | import java.io.OutputStreamWriter; |
04 | import java.io.Writer; |
05 |
06 | import org.apache.http.HttpResponse; |
07 | import org.apache.http.client.HttpClient; |
08 | import org.apache.http.client.methods.HttpPost; |
09 | import org.apache.http.entity.ContentProducer; |
10 | import org.apache.http.entity.EntityTemplate; |
11 | import org.apache.http.impl.client.DefaultHttpClient; |
12 | import org.apache.http.util.EntityUtils; |
13 |
14 |
15 | public class ClientTest { |
16 |
17 | public static void main(String[] args) { |
18 | ClientTest.httpClientPost(); |
19 | } |
20 | |
21 | private static void httpClientPost() { |
22 | HttpClient client = new DefaultHttpClient(); |
23 | HttpPost post = new HttpPost( "http://localhost:8080/xxx/services/userService" ); |
24 | |
25 | try { |
26 | ContentProducer cp = new ContentProducer() { |
27 | public void writeTo(OutputStream outstream) throws IOException { |
28 | Writer writer = new OutputStreamWriter(outstream, "UTF-8" ); |
29 | |
30 | /** |
31 | * 獲取請求的xml格式數據 |
32 | */ |
33 | String requestXml = getRequestXml(); |
34 | writer.write(requestXml); |
35 | writer.flush(); |
36 | } |
37 | }; |
38 |
39 | post.setEntity( new EntityTemplate(cp)); |
40 | HttpResponse response = client.execute(post); |
41 | |
42 | //打印返回的xml數據 |
43 | System.out.println(EntityUtils.toString(response.getEntity())); |
44 | } catch (IOException e) { |
45 | e.printStackTrace(); |
46 | } |
47 | } |
48 | |
49 | |
50 | private static String getRequestXml(){ |
51 | StringBuilder sb = new StringBuilder( "<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:sam=\"http://user.service.xxx.com\">" ); |
52 | sb.append( "<soap:Header/>" ); |
53 | sb.append( "<soap:Body>" ); |
54 | sb.append( "<sam:getUserInfo>" ); |
55 | sb.append( "<sam:userName>sunlightcs</sam:userName>" ); |
56 | sb.append( "</sam:getUserInfo>" ); |
57 | sb.append( "</soap:Body>" ); |
58 | sb.append( "</soap:Envelope>" ); |
59 | |
60 | return sb.toString(); |
61 | } |
62 |
63 | } |
1 | <? xml version = '1.0' encoding = 'UTF-8' ?> |
2 | < soapenv:Envelope xmlns:soapenv = "http://www.w3.org/2003/05/soap-envelope" > |
3 | < soapenv:Body > |
4 | < ns:getUserInfoResponse xmlns:ns = "http://user.service.xxx.com" > |
5 | < ns:return >xxx</ ns:return > |
6 | </ ns:getUserInfoResponse > |
7 | </ soapenv:Body > |
8 | </ soapenv:Envelope > |
posted @ 2017-05-24 16:10 朱杰兵 閱讀(1219) | 評論 (0) | 編輯 收藏
posted @ 2017-04-26 19:53 朱杰兵 閱讀(95) | 評論 (0) | 編輯 收藏
解決辦法
刪掉war包中的xml-apis.jar就可以了
posted @ 2017-04-14 16:06 朱杰兵 閱讀(104) | 評論 (0) | 編輯 收藏
posted @ 2017-04-13 14:16 朱杰兵 閱讀(180) | 評論 (0) | 編輯 收藏