亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 10.txt

?? 《JAVA WEB服務(wù)應(yīng)用開發(fā)詳解》代碼
?? TXT
?? 第 1 頁 / 共 5 頁
字號(hào):
26        String encodingStyleURI = args.length == 3
27                                  ? args[0].substring(1)
28                                  : Constants.NS_URI_SOAP_ENC;
29        URL url = new URL (args[1 - offset]);
30        String symbol = args[2 - offset];
31    
32        // Build the call.
33        Call call = new Call ();
34        call.setTargetObjectURI ("urn:xmltoday-delayed-quotes");
35        call.setMethodName ("getQuote");
36        call.setEncodingStyleURI(encodingStyleURI);
37        Vector params = new Vector ();
38        params.addElement (new Parameter("symbol", String.class, symbol, null));
39        call.setParams (params);
40    
41        // make the call: note that the action URI is empty because the 
42        // XML-SOAP rpc router does not need this. This may change in the
43        // future.
44        Response resp = call.invoke (/* router URL */ url, /* actionURI */ "" );
45    
46        // Check the response.
47        if (resp.generatedFault ()) {
48          Fault fault = resp.getFault ();
49          System.out.println ("Ouch, the call failed: ");
50          System.out.println ("  Fault Code   = " + fault.getFaultCode ());  
51          System.out.println ("  Fault String = " + fault.getFaultString ());
52        } else {
53          Parameter result = resp.getReturnValue ();
54          System.out.println (result.getValue ());
55        }
56      }
57    }
例程10-7
001    //org.apache.soap.server.SMTP2HTTPBridge.Java
002    package org.apache.soap.server;
003    
004    import Java.io.*;
005    import Java.net.*;
006    import Java.util.*;
007    
008    import com.ibm.network.mail.base.*;
009    import com.ibm.network.mail.smtp.event.*;
010    import org.apache.soap.util.net.*;
011    import org.apache.soap.util.*;
012    import org.apache.soap.rpc.SOAPContext;
013    import org.apache.soap.Constants;
014    import org.apache.soap.transport.*;
015    import org.apache.soap.transport.smtp.*;
016    import Javax.mail.MessagingException;
017    
018    /**
019     * This class can be used as a bridge to relay SOAP messages received via
020     * email to an HTTP SOAP listener. This is basically a polling POP3 client
021     * that keeps looking for new messages to work on. When it gets one,
022     * it forwards it to a SOAP HTTP listener and forwards the response via
023     * SMTP to the original requestor (to either the ReplyTo: or From: address).
024     *
025     * @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
026     */
027    public class SMTP2HTTPBridge implements Runnable {
028      Object waitObject = new Object ();
029      long pollDelayMillis;
030      com.ibm.network.mail.pop3.protocol.CoreProtocolBean pop3 =
031        new com.ibm.network.mail.pop3.protocol.CoreProtocolBean ();
032      com.ibm.network.mail.smtp.protocol.CoreProtocolBean smtp =
033        new com.ibm.network.mail.smtp.protocol.CoreProtocolBean ();
034      URL httpURL;
035    
036      /**
037       * Constructor: creates a bridge. Call run() to start polling using
038       * the current thread. (If you want to use a separate thread then
039       * do new Thread (new SMT2HTTPBridge (...)).start ();
040       *
041       * @param pollDelayMillis number of milli-seconds to sleep b'ween polls
042       * @param popServer hostname of POP3 server
043       * @param popLoginName login ID
044       * @param password password for login
045       * @param smtpServer hostname of SMTP server
046       */
047      public SMTP2HTTPBridge (/* POP3 params */
048                              long pollDelayMillis,
049                              String popServer, String popLoginName,
050                              String password,
051                              /* HTTP params */
052                              URL httpURL,
053                              /* SMTP params */
054                              String smtpServer) {
055        /* set up the pop3 side */
056        this.pollDelayMillis = pollDelayMillis;
057        pop3.setPOP3ServerHost (popServer);
058        pop3.setUserOptions(/* popLoginName */ popLoginName,
059          /* password */ password,
060          /* leaveMessagesOnServer */ false,
061          /* rememberPassword */ false);
062        pop3.addMessageListener (
063          new com.ibm.network.mail.pop3.event.MessageListener () {
064            public void messageReceived (
065                com.ibm.network.mail.pop3.event.MessageEvent me) {
066              receiveMessage (me.getMessage ());
067            }
068          }
069        );
070        pop3.addStatusListener (new POP3StatusListener ());
071    
072        /* set up the http side */
073        this.httpURL = httpURL;
074    
075        /* set up the smtp side */
076        smtp.setSmtpServerHost (smtpServer);
077        smtp.addStatusListener (new StatusListener () {
078          public void operationComplete (StatusEvent e) {
079            System.err.println ("DONE: " + e.getStatusString ());
080            synchronized (waitObject) {
081              waitObject.notify ();
082            }
083          }
084    
085          public void processStatus (StatusEvent e) {
086            System.err.println ("Status update: " + e.getStatusString ());
087          }
088        });
089      }
090    
091      /**
092       * Poll for messages forever.
093       */
094      public void run () {
095        while (true) {
096          if (pop3.isReady ()) {
097            System.err.println ("SMTP2HTTPBridge: Polling for messages ..");
098            pop3.receiveMessage ();
099          }
100          try {
101            Thread.sleep (pollDelayMillis);
102          } catch (Exception e) {
103            e.printStackTrace ();
104          }
105        }
106      }
107    
108      /**
109       * This is called by the POP3 message listener after receiving a 
110       * message from the pop server.
111       * 
112       * @param msg the message that was received
113       */
114      void receiveMessage (MimeMessage msg) {
115        /* extract the stuff from the SMTP message received */
116       String subject = msg.getHeader (SMTPConstants.SMTP_HEADER_SUBJECT);
117        String actionURI = msg.getHeader (Constants.HEADER_SOAP_ACTION);
118        String toAddr = msg.getHeader (SMTPConstants.SMTP_HEADER_TO);
119       String fromAddr = msg.getHeader (SMTPConstants.SMTP_HEADER_FROM);
120        MimeBodyPart mbp = (MimeBodyPart) msg.getContent ();
121        byte[] ba = (byte[]) mbp.getContent ();
122    
123        /* forward the content to the HTTP listener as an HTTP POST */
124        Hashtable headers = new Hashtable ();
125        headers.put (Constants.HEADER_SOAP_ACTION, actionURI);
126        TransportMessage response;
127        // This is the reponse SOAPContext. Sending it as a reply not supported yet.
128        SOAPContext ctx;
129        try
130        {
131            // Note: no support for multipart MIME request yet here...
132            TransportMessage tmsg = new TransportMessage(new String (ba),
133                                                      new SOAPContext(),
134                                                         headers);
135            tmsg.save();
136    
137            response = HTTPUtils.post (httpURL, tmsg,
138                                       30000, null, 0);
139            ctx = response.getSOAPContext();
140        } catch (Exception e) {
141            e.printStackTrace();
142    	return;
143        }
144        System.err.println ("HTTP RESPONSE IS: ");
145        String payload = null;
146        try {
147          // read the stream
148            payload = IOUtils.getStringFromReader (response.getEnvelopeReader());
149        } catch (Exception e) {
150          e.printStackTrace ();
151        }
152        System.err.println ("'" + payload + "'");
153    
154        /* forward the response via SMTP to the original sender */
155        MimeBodyPart mbpResponse = new MimeBodyPart ();
156        mbpResponse.setContent (new String (payload), response.getContentType());
157        mbpResponse.setEncoding (MimePart.SEVENBIT);
158        mbpResponse.setDisposition (MimePart.INLINE);
159    
160        MimeMessage msgResponse = new MimeMessage();
161        msgResponse.setContent (mbpResponse, "");
162        msgResponse.addHeader (SMTPConstants.SMTP_HEADER_SUBJECT,
163                               "Re: " + subject);
164        msgResponse.addHeader (Constants.HEADER_SOAP_ACTION, actionURI);
165        msgResponse.addHeader (SMTPConstants.SMTP_HEADER_FROM, 
166                            SMTPUtils.getAddressFromAddressHeader (toAddr));
167        String sendTo = SMTPUtils.getAddressFromAddressHeader (fromAddr);
168        msgResponse.addRecipients (MimeMessage.TO, 
169                                   new InternetAddress[] { 
170                                     new InternetAddress (sendTo)
171                                   });
172        smtp.sendMessage (msgResponse);
173      }
174    
175      public static void main (String[] args) throws Exception {
176        if (args.length != 6) {
177          System.err.println ("Usage: Java " + SMTP2HTTPBridge.class.getName () +
178                              " polldelay \\");
179          System.err.println ("\t\t pop3host pop3login pop3passwd httpurl " +
180                              "smtphostname");
181          System.err.println ("  where:");
182          System.err.println ("    polldelay    number of millisec to " +
183                              "sleep between polls");
184          System.err.println ("    pop3host     hostname of the POP3 server");
185          System.err.println ("    pop3login    login ID of POP3 account");
186          System.err.println ("    pop3passwd   POP3 account password");
187          System.err.println ("    routerURL    http URL of SOAP router to " +
188                              "bridge to");
189          System.err.println ("    smtphostname SMTP server host name");
190          System.exit (1);
191        }
192        SMTP2HTTPBridge sb = new SMTP2HTTPBridge (/* POP3 params */
193                                                  Integer.parseInt (args[0]),
194                                                  args[1],
195                                                  args[2],
196                                                  args[3],
197                                                  /* HTTP params */
198                                                  new URL (args[4]),
199                                                  /* SMTP params */
200                                                  args[5]);
201        new Thread (sb).start ();
202      }
203    }
例程10-8
01     //samples.stockquote.GetQuoteSMTP.Java
02     package samples.stockquote;
03     
04     import Java.io.*;
05     import Java.net.*;
06     import Java.util.*;
07     import org.apache.soap.*;
08     import org.apache.soap.transport.*;
09     import org.apache.soap.transport.smtp.*;
10     import org.apache.soap.rpc.*;
11     
12     /**
13      * This shows how to get invoke the stockquote service using
14      * SOAP over SMTP. I gave up on command line args for this and
15      * decided to prompt for the info .. just too much stuff to 
16      * set up. 
17      *
18      * @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
19      */
20     public class GetQuoteSMTP {
21       public static void main (String[] args) throws Exception {
22         if (args.length != 7
23             && (args.length != 8 || !args[0].startsWith ("-"))) {
24           System.err.println ("Usage: Java " + GetQuoteSMTP.class.getName () +
25                               " [-encodingStyleURI] routerURL smtpserver" +
26     			  " replyaddr popserver poplogin poppasswd symbol");
27           System.err.println ("  where:");
28           System.err.println ("    routerURL   mailto: URL of SOAP router");
29           System.err.println ("    smtpserver  SMTP server host name");
30           System.err.println ("    replyaddr   email addr that response should " +
31     			  "be sent to (my address)");
32           System.err.println ("    popserver   POP server host name");
33           System.err.println ("    poplogin    login ID to get response email");
34           System.err.println ("    poppasswd   password for above");
35           System.err.println ("    symbol      stock symbol");
36           System.exit (1);
37         }
38     
39         // Process the arguments.
40         int offset = 8 - args.length;
41         String encodingStyleURI = args.length == 8
42                                   ? args[0].substring(1)
43                                   : Constants.NS_URI_SOAP_ENC;
44         URL url = new URL (args[1 - offset]);
45         String smtpserver = args[2 - offset];
46         String replyaddr = args[3 - offset];
47         String popserver = args[4 - offset];
48         String poplogin = args[5 - offset];
49         String poppasswd = args[6 - offset];
50         String symbol = args[7 - offset];
51     
52         // Build the call.
53        SOAPTransport ss = new SOAPSMTPConnection (/* from address */ replyaddr, 
54     					       /* subject */ "SOAP Request",
55     					       /* smtpServer */ smtpserver,
56     					       /* popPollDelay */ 20000,
57     					       /* popServer */ popserver,
58     					       /* popLogin */ poplogin,
59     					       /* popPassword */ poppasswd);
60         Call call = new Call ();
61         call.setSOAPTransport (ss);
62         call.setTargetObjectURI ("urn:xmltoday-delayed-quotes");
63         call.setMethodName ("getQuote");
64         call.setEncodingStyleURI(encodingStyleURI);
65         Vector params = new Vector ();
66         params.addElement (new Parameter ("symbol", String.class, symbol, null));
67         call.setParams (params);
68     
69         // make the call: note that the action URI is empty because the 
70         // XML-SOAP rpc router does not need this. This may change in the
71         // future.
72         Response resp = call.invoke (/* router URL */ url, /* actionURI */ "" );
73     
74         // Check the response.
75         if (resp.generatedFault ()) {
76           Fault fault = resp.getFault ();
77           System.out.println ("Ouch, the call failed: ");
78           System.out.println ("  Fault Code   = " + fault.getFaultCode ());  
79           System.out.println ("  Fault String = " + fault.getFaultString ());
80         } else {
81           Parameter result = resp.getReturnValue ();
82           System.out.println (result.getValue ());
83         }
84       }
85     }
例程10-9
01    //samples.messaging.POProcessor.Java

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91网站最新网址| 亚洲免费资源在线播放| 国产原创一区二区三区| 中文字幕av免费专区久久| 欧美日韩成人综合天天影院 | 午夜精品福利一区二区三区蜜桃| 欧美一区二区三区人| 国产传媒一区在线| 三级久久三级久久久| 国产人成亚洲第一网站在线播放| 97久久人人超碰| 蜜臀久久99精品久久久久宅男| 国产精品久久久久久久浪潮网站| 日韩精品一区二区三区在线| av中文字幕一区| 狠狠v欧美v日韩v亚洲ⅴ| ㊣最新国产の精品bt伙计久久| 51精品秘密在线观看| 色94色欧美sute亚洲线路一ni| 久久精品国产精品亚洲精品| 亚洲一区二区三区免费视频| 国产欧美一区二区三区网站 | 亚洲欧洲av在线| 久久青草欧美一区二区三区| 欧美人与禽zozo性伦| 风流少妇一区二区| 国产一区二区免费看| 亚洲制服丝袜一区| 亚洲视频免费在线观看| 久久综合色8888| 欧美在线免费视屏| 91丨九色丨尤物| 成人一区二区三区视频在线观看| 国产伦精品一区二区三区视频青涩| 国产精品18久久久久久久网站| 欧美久久久一区| 97se亚洲国产综合在线| 成人h动漫精品一区二区| 国产乱人伦偷精品视频免下载| 亚洲精品乱码久久久久久久久| 国产精品久久久久四虎| 精品国产百合女同互慰| 欧美tickle裸体挠脚心vk| 欧美日韩国产美| 粉嫩aⅴ一区二区三区四区| 国产一区二区三区四区在线观看 | 中文字幕亚洲电影| 久久久三级国产网站| 久久美女艺术照精彩视频福利播放| 欧美一区二区三区在| 日韩一卡二卡三卡国产欧美| 欧美日韩一级大片网址| 欧美日韩三级一区| 欧美日韩精品三区| 99视频国产精品| 99视频一区二区| 欧美在线不卡视频| 在线免费观看视频一区| 色94色欧美sute亚洲线路二| 欧美日韩激情一区| 欧美男人的天堂一二区| 精品区一区二区| 欧美v日韩v国产v| 国产亚洲欧美一级| 欧美国产1区2区| 亚洲天堂久久久久久久| 一区二区久久久久| 喷水一区二区三区| 亚洲妇女屁股眼交7| 青青草伊人久久| 黄网站免费久久| 美国十次综合导航| 国产精品91xxx| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美中文字幕亚洲一区二区va在线| 在线视频综合导航| 精品日韩99亚洲| 国产女人18水真多18精品一级做| 亚洲日本乱码在线观看| 亚洲欧美另类综合偷拍| 国产精品美女久久久久久久 | 青青草国产成人av片免费| 精品制服美女丁香| 北岛玲一区二区三区四区| 成人精品国产免费网站| 色94色欧美sute亚洲13| 日韩午夜av电影| 亚洲天堂网中文字| 日韩激情av在线| 成人精品小蝌蚪| 欧美日韩情趣电影| 在线免费av一区| 国产日产精品1区| 夜夜嗨av一区二区三区网页| 久久99精品国产91久久来源| 成人性生交大片免费看在线播放| 欧美三日本三级三级在线播放| 欧美第一区第二区| 樱花影视一区二区| 精品一区二区在线视频| 麻豆国产精品一区二区三区| 99久久婷婷国产| 欧美中文字幕久久| 国产精品福利一区二区三区| 麻豆精品精品国产自在97香蕉| 午夜精品免费在线| 成人免费毛片嘿嘿连载视频| 91精品欧美综合在线观看最新| 国产色产综合色产在线视频| 日韩在线卡一卡二| 99久久精品国产一区| 欧美本精品男人aⅴ天堂| 亚洲一区二区成人在线观看| 秋霞午夜av一区二区三区| 99久久婷婷国产综合精品电影| 欧美成人欧美edvon| 午夜精品久久久久久久久| 成人午夜伦理影院| 久久精品亚洲精品国产欧美 | 国产精品久线观看视频| 一区二区成人在线观看| 国产精品亚洲成人| 欧美一区二区三区色| 国产无遮挡一区二区三区毛片日本| 亚洲国产精品久久久男人的天堂| 精品一二三四区| 5566中文字幕一区二区电影| 一级精品视频在线观看宜春院 | 欧美亚洲动漫制服丝袜| 欧美mv日韩mv| 蓝色福利精品导航| 欧美日韩一区二区三区视频| 亚洲国产wwwccc36天堂| av欧美精品.com| 17c精品麻豆一区二区免费| 国产精品夜夜爽| 一区二区欧美精品| 午夜精品爽啪视频| 欧美一区二区日韩| 午夜电影网亚洲视频| 欧洲精品视频在线观看| 国产精品久久久久一区二区三区| 国产成人在线电影| 久久久综合激的五月天| 国产精品 欧美精品| www国产成人| 日本不卡123| 欧美精品成人一区二区三区四区| 国产欧美日韩在线视频| www.日韩在线| 中文字幕在线视频一区| 91美女在线视频| 一区在线观看视频| 在线观看中文字幕不卡| 洋洋成人永久网站入口| 欧美一区二区三区四区在线观看 | 懂色av一区二区三区蜜臀| 日韩免费高清av| 国产成人三级在线观看| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲欧美偷拍卡通变态| 欧美日韩三级视频| 日本欧洲一区二区| 亚洲精品一区二区在线观看| 精品写真视频在线观看| 日本一区二区视频在线观看| 成人深夜福利app| 亚洲国产精品视频| 日韩亚洲欧美中文三级| 国产成人啪午夜精品网站男同| 国产精品福利一区| 欧美精品在欧美一区二区少妇| 日本亚洲欧美天堂免费| 国产婷婷色一区二区三区四区| 国产69精品久久777的优势| 尤物在线观看一区| 精品久久一区二区| 亚洲一区二区视频在线观看| 欧美色综合久久| 国产精一品亚洲二区在线视频| 亚洲国产精品激情在线观看| 97精品电影院| 天堂成人国产精品一区| 在线成人免费观看| 国产在线精品一区在线观看麻豆| 中文在线资源观看网站视频免费不卡| www.久久精品| 亚洲男女毛片无遮挡| 欧美成人r级一区二区三区| 国产精品中文有码| 五月天久久比比资源色| 精品国产伦一区二区三区观看体验| www.欧美亚洲| 日韩精品1区2区3区| 国产精品久久777777| 精品视频123区在线观看| 粉嫩欧美一区二区三区高清影视| 亚洲精品美国一| 中文字幕va一区二区三区| 91麻豆精品国产无毒不卡在线观看|