当前位置: 首页>>代码示例>>Java>>正文


Java HttpResponseException类代码示例

本文整理汇总了Java中org.ksoap2.transport.HttpResponseException的典型用法代码示例。如果您正苦于以下问题:Java HttpResponseException类的具体用法?Java HttpResponseException怎么用?Java HttpResponseException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HttpResponseException类属于org.ksoap2.transport包,在下文中一共展示了HttpResponseException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getWSResponse

import org.ksoap2.transport.HttpResponseException; //导入依赖的package包/类
Komunikat getWSResponse(String code, String soapAction, String methodName, String outerBox) 
				throws HttpResponseException, IOException, XmlPullParserException{
	    //create envelope
	    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
	    envelope.dotNet = true;
	    envelope.implicitTypes=false;
	    
	    addSecurityHeader(envelope);
	    addMappings(envelope, outerBox);
	    
	    envelope.setOutputSoapObject(createRequestParameter(code, methodName));
	    
	    //WS call
	    HttpTransportSE transport = new HttpTransportSE(URL);
    	transport.debug = true;
//    	try{
    	transport.call(soapAction, envelope);
//    	}catch(Exception e){
//    		e.printStackTrace();
//    	}
	        
        WSResponse response = (WSResponse) envelope.bodyIn;
		return response.getKomunikat();
	}
 
开发者ID:mmprog,项目名称:wspocztapolska,代码行数:25,代码来源:WSPoczta.java

示例2: soap

import org.ksoap2.transport.HttpResponseException; //导入依赖的package包/类
public Vector<?> soap(HttpServletRequest req) throws JSONException,
		IOException {
	JSONObject json = new JSONObject(IO.read(req));
	// TODO: Route to SOAP ...
	String action = req.getAttribute(Route.ACTION).toString();
	if (action == null) {
		throw new JSONException("Missing SOAP action.");
	}
	final Route route = router.route(action);
	if (route == null) {
		throw new JSONException("Not support action:" + action);
	}
	final SoapObject so = new SoapObject(route.getNameSpace(),
			route.getAction());

	Envelope envelope = createEnvelope(so, IO.toElement(json, route.getNameSpace(),
			route.getAction()));
	KXmlSerializer xmlWriter = new KXmlSerializer();
	ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
	xmlWriter.setOutput(outputStream, "UTF-8");
	envelope.write(xmlWriter);
	xmlWriter.flush();
	Logger.getLogger(Soaper.class.getName()).info(outputStream.toString());
	
	HttpTransportSE ht = getHttpTransportSE(route.getSoapUrl());
	try {
		ht.call(so.getName(), envelope);
		Vector<?> ro = (Vector<?>) envelope.getResponse();
		return ro;
	} catch (HttpResponseException | XmlPullParserException | SoapFault e) {
		throw new JSONException(e);
	}
}
 
开发者ID:cheeray,项目名称:ws-bridge,代码行数:34,代码来源:Soaper.java

示例3: getPrzesylka

import org.ksoap2.transport.HttpResponseException; //导入依赖的package包/类
public Komunikat getPrzesylka(String code) 
		throws HttpResponseException, IOException, XmlPullParserException{
	return getWSResponse(code, SOAP_ACTION, METHOD_NAME, RESPONSE_OUTER_BOX);
}
 
开发者ID:mmprog,项目名称:wspocztapolska,代码行数:5,代码来源:WSPoczta.java

示例4: getPrzesylkaEx

import org.ksoap2.transport.HttpResponseException; //导入依赖的package包/类
public Komunikat getPrzesylkaEx(String code)
		throws HttpResponseException, IOException, XmlPullParserException{
	return getWSResponse(code, SOAP_ACTION_EX, METHOD_NAME_EX, RESPONSE_OUTER_BOX_EX);
}
 
开发者ID:mmprog,项目名称:wspocztapolska,代码行数:5,代码来源:WSPoczta.java


注:本文中的org.ksoap2.transport.HttpResponseException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。