JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java & XML、Web Service  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 請問 JAVA去呼叫doNET的WebService
giker8





發文: 14
積分: 0
於 2007-09-03 09:43 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我寫了一個java 的client去使用doNET WebService的方法出現了錯誤,程式如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package myWebServiceJavaClient;
 
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
 
import javax.xml.namespace.QName;
import java.lang.Integer;
import javax.xml.rpc.ParameterMode;
 
public class TestService2 {
  public static void main(String[] args) {
        try {
           String endpoint = "http://192.168.1.2/pki/WebService.asmx";
           Service service = new Service();
           Call call = (Call) service.createCall();
           call.setTargetEndpointAddress(new java.net.URL(endpoint));
           call.setOperationName(new QName("http://tempuri.org/","Sign_Plain"));
           call.addParameter("PinCode", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
           call.addParameter("InFileName", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
           call.addParameter("OuFileName", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
           call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
           call.setUseSOAPAction(true);
           call.setSOAPActionURI("http://tempuri.org/Sign_Plain");
   
           
           String ret = (String) call.invoke(new Object[] {"111111", "D:\\temp\\test1.doc","D:\\temp\\test2.doc"});
           System.out.println("Sent 'Hello!', got '" + ret.toString() + "'");
           
 
           
        } catch (Exception e) {
            System.err.println(e.toString());
        }
    }
 
}
 


出現附件的錯誤訊息,
而Eclipse出現
log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.
(500)Internal Server Error

想請問各位前輩,如何修正

我的環境是
jdk5
axis1.4

因為剛接觸WebService,所以有很多不懂的,若文中有遺漏的請多見諒,謝謝。

(縮略圖,點擊圖片鏈接看原圖)


reply to postreply to post
» JWorld@TW »  Java & XML、Web Service

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8