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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? httptransport.java

?? it is a tools for developing J2ME application using web service.
?? JAVA
字號:
/* kSOAP * * The contents of this file are subject to the Enhydra Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License * on the Enhydra web site ( http://www.enhydra.org/ ). * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific terms governing rights and limitations * under the License. * * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), * Germany. All Rights Reserved. * * Contributor(s): John D. Beatty, Dave Dash, F. Hunter, Renaud Tognelli, *                 Thomas Strang, Alexander Krebs, Sean McDaniel * */package org.ksoap.transport;import java.io.*;import javax.microedition.io.*;import org.kxml.*;import org.kxml.io.*;import org.kxml.parser.*;import org.ksoap.*;/** Methods to facilitate SOAP calls over HTTP using the    J2ME generic connection framework.    <p>    Instances of HttpTransport can be in one of two states: connected    and not connected.  When an invocation on call is made the    instance is in a connected state until call returns or throws    an IOException.  in any case once control is returned to the    caller the instance is again in the not connected state.  HttpTransport    is not thread safe and applications should ensure that only one    thread is inside the call method at any given time.  It is    designed in such a way that applications can reuse a single instance    for all soap calls to one, or multiple, target endpoints.<p>    The underlying HttpConnection is opened with the timeout    flag set. In the MIDP API this flag is only a hint to the    underlying protocol handler to throw an InterrruptIOException,    however, there are no guarantees that it will be handled.  So    rather than support a timeout mechanism internally the design    is such that applications can manage timeouts in an environment    dependent way.<p>    For example some environments may allow for a timeout parameter    that can be externally specified in perhaps a system property    (which?  I don't know. it's in the api).  Others like    the emulator (ok, who cares) and the Motorola i85s can use    a simple and effective timeout mechanism that closes the    connection and associated streams in an asynchronous fashion.    Calling the close( ) method inside of a separate thread can    provide for this timeout handling by releasing threads that    maybe stuck inside of call( ) performing network io.<p>    Here is some sample code to demonstrate how such a timeout    mechanism may look:<br>    <pre>    private HttpTransport soap;      ...    TimerTask task =      new TimerTask( ) { public void run( ) { soap.close( ); } };    try {      new Timer( ).schedule( task, TIMEOUT );      soap.call( soapobject );  // invoke method      task.cancel( );           // cancel the timeout    } catch ( InterruptedIOException e ) {      // handle timeout here...    } catch ( IOException e ) {      // some other io problem...    }    </pre><br>    The call( ) method will throw and InterruptedIOException if    the instance is no longer in the connected state before    control is returned to the caller.  The call to soap.close( )    inside the TimerTask transitions the HttpConnection into    a not connected state.<p>    <b>Note</b>:  The InterruptedIOException will be caught by a thread    waiting on network io, however, it may not be immediate.  It is    assumed that the protocol handler will gracefully handle the    lifecycle of the outputstream and therefore it is not closed    inside the close method.  IOW the waiting thread will be interrupted    after the outputstream has been flushed.  If the waiting thread    is hung up waiting for input a call to close from a separate thread    the exception is observed right away and will return before the    thread calling close.  <b>At least this is what has been observation    on the i85s handset.</b>  On this device, if a call to    outputstream.close( ) is made while the outputstream is    being flushed it seems to cause a deadlock, ie outputstream will    never return. */public class HttpTransport {    String url;    String soapAction = "\"\"";    SoapEnvelope requestEnvelope = new SoapEnvelope ();    SoapEnvelope responseEnvelope = new SoapEnvelope ();    HttpConnection connection;    OutputStream os;    InputStream is;    InputStreamReader reader;    /** state info */    private boolean connected = false;    /** Set to true if debugging */    public boolean debug;    /** String dump of request for debugging. */    public String requestDump;    /** String dump of response for debugging */    public String responseDump;    /** default constructor */    public HttpTransport () {    }    /**     * Creates instance of HttpTransport with set url and SoapAction     *     * @param url the destination to POST SOAP data     * @param soapAction the desired SOAP action (for HTTP headers)     */    public HttpTransport (String url, String soapAction) {	this.url = url;	this.soapAction = soapAction;    }    /**     * Set the target url.     *     * @param url the target url.     */    public void setUrl (String url) {	this.url = url;    }    /**     * set the desired soapAction header field     *     * @param soapAction the desired soapAction     */    public void setSoapAction (String soapAction) {	this.soapAction = soapAction;    }    /**     * set the desired ClassMap for the SOAP Envelopes     *     * @param classMap the desired ClassMap     */    public void setClassMap (ClassMap classMap) {	requestEnvelope.setClassMap (classMap);	responseEnvelope.setClassMap (classMap);    }    /** Sends the requestEnvelope and fills the	responseEnvelope        @exception InterruptedIOException if transport was closed async.	@exception IOException if an error occurs    */    public void call () throws IOException {	ByteArrayOutputStream bos = new ByteArrayOutputStream ();	XmlWriter xw = new XmlWriter (new OutputStreamWriter (bos));	requestEnvelope.write (xw);	xw.flush ();	bos.write ('\r');	bos.write ('\n');	byte [] requestData = bos.toByteArray ();	bos = null;	xw = null;	requestDump = debug ? new String (requestData) : null;	responseDump = null;        try {            connected = true;            connection =              (HttpConnection) Connector.open (url, Connector.READ_WRITE, true);            connection.setRequestProperty ("SOAPAction", soapAction);            connection.setRequestProperty ("Content-Type", "text/xml");            connection.setRequestProperty                ("Content-Length", ""+requestData.length);            connection.setRequestProperty ("User-Agent", "kSOAP/1.0");            connection.setRequestMethod (HttpConnection.POST);            os = connection.openOutputStream ();            os.write (requestData, 0, requestData.length);//            os.flush ();  // removed in order to avoid chunked encoding            os.close ();            requestData = null;            is = connection.openInputStream ();            if (debug) {                bos = new ByteArrayOutputStream ();                byte [] buf = new byte [256];                while (true) {                    int rd = is.read (buf, 0, 256);                    if (rd == -1) break;                    bos.write (buf, 0, rd);                }                buf = bos.toByteArray ();                responseDump = new String (buf);                is.close ();                is = new ByteArrayInputStream (buf);            }            reader = new InputStreamReader (is);            XmlParser xp = new XmlParser (reader);            responseEnvelope.parse (xp);        } finally {          if (!connected) throw new InterruptedIOException ();          reset ();        }    }    /**     * Executes a SOAP Method and returns a response     *     * @param method the remote soap method to be executed     * @return the result of the soap method     * @exception IOException if an error occurs     */    public Object call (SoapObject method) throws IOException {	requestEnvelope.setBody (method);	call ();	if (responseEnvelope.getBody () instanceof SoapFault)	    throw((SoapFault)responseEnvelope.getBody ());	return responseEnvelope.getResult ();    }    public void call (XmlIO request, XmlIO result) throws IOException {        requestEnvelope.setBody (request);        responseEnvelope.setBody (result);                if (responseEnvelope.getBody () instanceof SoapFault)	    throw((SoapFault)responseEnvelope.getBody ());    }     /**     * Closes the connection and associated streams.  This method     * does not need to be explictly called since the uderlying     * connections and streams are only opened and valid inside of     * the call method.  Close can be called ansynchronously,     * from another thread to potentially release another thread     * that is hung up doing network io inside of call.  Caution     * should be taken, however when using this as a psedu timeout     * mechanism.  it is a valid and suggested approach for the     * motorola handsets.  oh, and it works in the emulator...     */    public void reset () {        connected = false;        if (reader != null) {            try { reader.close (); }            catch (Throwable e) { }            reader = null;        }        if (is != null) {            try { is.close (); }            catch (Throwable e) { }            is = null;        }        if (connection != null) {            try { connection.close (); }            catch (Throwable e) { }            connection = null;        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美天天综合网| 成人午夜精品在线| 欧美亚一区二区| 亚洲精品视频免费观看| 99国产精品久久久久| 亚洲另类在线视频| 欧美日韩一区小说| 蜜桃视频第一区免费观看| 精品奇米国产一区二区三区| 国产乱码精品一区二区三区av | 三级欧美在线一区| 欧美一区三区四区| 国产呦精品一区二区三区网站| 国产日韩欧美制服另类| 99国产精品视频免费观看| 一区二区三区色| 91麻豆精品国产自产在线| 国产一区二区三区免费播放| 国产精品视频一二三区| 色88888久久久久久影院按摩| 五月开心婷婷久久| 久久久精品免费观看| 91丨porny丨最新| 丝袜亚洲另类欧美综合| 亚洲精品在线免费播放| av一本久道久久综合久久鬼色| 亚洲综合视频网| 久久男人中文字幕资源站| 91免费观看在线| 久久不见久久见免费视频1| 国产精品乱人伦| 日韩一区二区视频| 99九九99九九九视频精品| 日本在线不卡一区| 国产精品久久午夜夜伦鲁鲁| 欧美伊人久久大香线蕉综合69| 久久黄色级2电影| 亚洲综合色视频| 久久久久久免费网| 欧美久久久久久蜜桃| 岛国一区二区在线观看| 日韩精品一级二级| 亚洲私人影院在线观看| 欧美xxxxx裸体时装秀| 日本高清无吗v一区| 国产自产高清不卡| 亚洲成人www| 蜜臀av国产精品久久久久| 中文字幕欧美日本乱码一线二线| 欧美午夜精品理论片a级按摩| 国产精品99久久久久久有的能看 | 日韩久久久久久| 91视频国产资源| 激情久久五月天| 亚洲一二三级电影| 中文字幕亚洲在| 久久精品一区二区三区不卡| 777奇米成人网| 色综合久久88色综合天天6 | 国产黄色精品网站| 青青青爽久久午夜综合久久午夜| 亚洲欧美日韩一区二区| 中文字幕欧美日本乱码一线二线| 日韩欧美精品三级| 欧美肥胖老妇做爰| 欧美日韩一区三区| 91九色最新地址| 91麻豆成人久久精品二区三区| 国产99精品国产| 国产麻豆视频精品| 极品美女销魂一区二区三区免费| 午夜影院久久久| 午夜久久久久久电影| 一级特黄大欧美久久久| 亚洲精品久久嫩草网站秘色| 日韩一区有码在线| 中文字幕在线观看不卡| 国产精品久久看| 中文字幕一区av| 亚洲精品视频在线| 一区二区三区在线不卡| 亚洲欧美激情小说另类| 亚洲天堂精品在线观看| 亚洲情趣在线观看| 一区二区三区美女| 亚洲高清在线精品| 日韩精品一二区| 美女尤物国产一区| 国产一区二区三区精品视频 | 国内成+人亚洲+欧美+综合在线| 免费成人av在线| 精品午夜一区二区三区在线观看| 狠狠色综合色综合网络| 国产aⅴ综合色| 99精品视频一区| 欧洲一区二区三区在线| 91麻豆精品国产91久久久久| 欧美一卡二卡三卡| 久久精品视频免费观看| 中日韩免费视频中文字幕| 一区在线观看免费| 亚洲成人av电影| 美国毛片一区二区三区| 国产精品99久久久久久宅男| 成人aa视频在线观看| 欧美午夜精品久久久久久超碰 | 久久国产综合精品| 国产一区二区不卡老阿姨| 成人美女视频在线观看18| 一本大道久久精品懂色aⅴ | 日韩亚洲欧美中文三级| 国产日韩欧美综合一区| 一区二区三区中文在线| 麻豆精品蜜桃视频网站| 福利视频网站一区二区三区| 91成人在线观看喷潮| 精品免费一区二区三区| 中文字幕一区二区三区在线播放 | 国产一区二区三区在线观看免费 | 亚洲成人一二三| 激情综合色综合久久综合| 不卡一区二区三区四区| 欧美亚洲综合在线| 精品久久久久久久一区二区蜜臀| 国产精品盗摄一区二区三区| 午夜在线成人av| 国产精品自拍av| 欧美性受xxxx黑人xyx| 精品日本一线二线三线不卡| 亚洲欧美日韩在线播放| 久久国产精品露脸对白| 色婷婷久久久综合中文字幕 | 久久一区二区三区国产精品| 亚洲柠檬福利资源导航| 精品一区二区三区日韩| 91首页免费视频| 久久久久久久久久久电影| 五月天久久比比资源色| 99麻豆久久久国产精品免费优播| 欧美日韩国产小视频| 国产精品麻豆欧美日韩ww| 看片的网站亚洲| 欧美午夜电影一区| 成人欧美一区二区三区小说| 麻豆精品一区二区av白丝在线| 91福利社在线观看| 国产精品区一区二区三区| 麻豆成人av在线| 777午夜精品视频在线播放| 亚洲精品乱码久久久久久| 国产91富婆露脸刺激对白 | 日韩欧美一二三| 亚洲午夜精品网| 91理论电影在线观看| 中文字幕免费观看一区| 国产资源在线一区| 日韩欧美一级二级三级| 日韩1区2区3区| 欧美精品在线观看播放| 亚洲一线二线三线久久久| 99久久er热在这里只有精品66| 久久毛片高清国产| 麻豆久久久久久久| 欧美一区日本一区韩国一区| 午夜精品一区二区三区免费视频| 色94色欧美sute亚洲线路二| 亚洲丝袜美腿综合| caoporen国产精品视频| 国产精品素人一区二区| 国产成人免费在线| 国产日产欧美一区二区视频| 国产剧情一区在线| 国产三级欧美三级日产三级99| 久久av资源站| 久久一区二区视频| 国产成人免费在线观看不卡| 亚洲国产精品传媒在线观看| 风流少妇一区二区| 国产精品久久久久久久久免费桃花 | 国产精品一区久久久久| 久久久亚洲午夜电影| 国产经典欧美精品| 国产精品欧美综合在线| 不卡一区在线观看| 一区二区三区蜜桃| 91精品国产综合久久久久久久| 人人超碰91尤物精品国产| 欧美大片免费久久精品三p| 极品少妇xxxx精品少妇| 国产三级精品三级在线专区| 成人aaaa免费全部观看| 一区二区三区91| 欧美一区二区啪啪| 国产黄人亚洲片| 亚洲精品国产第一综合99久久 | 久久精品国产精品亚洲综合| 欧美成人激情免费网| 国产成人av一区二区三区在线| 国产精品久久国产精麻豆99网站| 91丨九色丨蝌蚪丨老版|