使用kasoap2-Android进行XML解析

我很难解析这个结构xml: 1 1 2012-03-28 13:39:04 2 1 2012-01-23 10:00:03 也许有人可以给我一些想法如何解析它? 我的请求看起来: String method_name = “GetPublications”; // creating new SoapObject soap = GetSoapObject(method_name); SoapSerializationEnvelope envelope = GetEnvelope(soap); HttpTransportSE androidHttpTransport = new HttpTransportSE(REQUEST_URL); androidHttpTransport.call(NAMESPACE + method_name, envelope); soap = (SoapObject) envelope.getResponse(); kSoap2-Android正在返回: anyType{Publications=anyType{Publication=anyType{PublicationID=1; PublisherID=1; Date=2012-03-28 13:39:04; }; Publication=anyType{PublicationID=2; PublisherID=1; Date=2012-01-23 10:00:03; }; }; } 谢谢。

如何将多个png图像转换为单个tiff文件

我有一个png格式的几个图像的字节数组。 我必须将其转换为tiff文件,然后转换为相应的字节数组。 这个tiff文件将保存多个图像。 我已经接受了很多,但我没有成功。 问题是。 我只能在java中这样做!! :)任何人都可以就我的问题提供一些见解吗? 我不会受益于ImageMagick等,因为我有一个服务器组件来处理这个转换,然后将它作为tiff保存在后端。 客户端给我一个字节数组,它将转换为png图像。

在Java中从XML中删除命名空间

我想从Java中删除XML中的命名空间。 你能指导一下需要做什么吗? 可以使用DOM解析器,但这将是一个节点解析的节点。 我想知道是否有一些代码可以从整个XML中删除所有命名空间( mig: 。 我的XML: funcCode FLT000204 Function Y submit FBT000000 cancel FBT000001 Text Field rptNum FLT006718 Report No. Y FinTextInputWithSearcher reportNo FLT005821 Report No. Y Desc. Label rptDesc N FinTextInput desc FLT000690 Description rptDesc FLT002771 Description Y rptType FLT007124 Report Type Y reporttype FLT005818 Report Type Y FinComboBox printRep FLT011541

libgdx中BoundingBox和Sphere之间的碰撞检测

在我的libgdx游戏中,我有3D BoundingBoxes和Spheres用于地图和玩家对象。 我想计算它们是否相互碰撞,以便正确模拟这些物体的运动。 我可以用什么方法来计算这些物体是否碰撞/交叉?

Primefaces p:带数据表的fileDownload

我有一个返回文件夹的所有文件的数据表,并且可以使用primefaces p:filedownload资源下载该文件。 它运行正常,但是当加载代码时我无法修改文件,因为FileInputStream是oppened。 如果我在数据表加载期间关闭FileInputStream,则p:filedownload不起作用 任何人? (如果我取消注释注释部分,filedownload不起作用,如果我保留它,我不能通过Windows编辑文件) Java的: public List getAnexosQuestionarios() { List resultado = new ArrayList(); File[] arquivos = FileHelper.listarArquivos(selected.getEmpresa().getDiretorio(), FileHelper.QUESTIONARIOS); if (arquivos != null) { for (File arquivo : arquivos) { InputStream stream = null; try { stream = new FileInputStream(arquivo.getAbsolutePath()); String extensao = arquivo.getName().substring(arquivo.getName().lastIndexOf(“.”) + 1); StreamedContent file = new DefaultStreamedContent(stream, MimeTypes.valueOf(extensao).getMimeType(), arquivo.getName()); […]

使用java的交互式命令Runtime.getRunTime.exec()

如何使用Runtime.getRunTime.exec()发送和接收多个输入。 例如,如果我想运行诸如openSSL之类的东西来生成csr,它会询问诸如州,城市,公用名等内容。 Process p = Runtime.getRuntime().exec(cmd); OutputStream out = p.getOutputStream(); //print stuff p.getInputStream(); //Now i want to send some inputs out.write(“test”.getBytes()); //flush and close??? don’t know what to do here //print what ever is returned //Now i want to send some more inputs out.write(“test2”.getBytes()); //print what ever is returned.. and so on until this is […]

Android在绘制前获取视图的位图?

我希望采用视图层次结构并将其转换为位图。 使用view.getDrawingCache()正是我想要它做的,但是如果我在绘制视图之前尝试它,它将无法工作。 是否有另一个函数可以做同样的事情,但在实际绘制之前? 我想创建视图并将其转换为位图以显示和丢弃实际视图。 如果有办法强制绘制可能也有效的视图。 有任何想法吗? 我在之前的post中找到了这个: public static Bitmap loadBitmapFromView(View v) { Bitmap b = Bitmap.createBitmap( v.getLayoutParams().width, v.getLayoutParams().height, Bitmap.Config.ARGB_8888); Canvas c = new Canvas(b); v.layout(0, 0, v.getLayoutParams().width, v.getLayoutParams().height); v.draw(c); return b; } 这看起来很有希望但是当我使用它时,我得到的是一个半透明的黑盒子。

接受List作为Jersey Web服务的参数,该Web服务使用多部分的内容类型

我有一个现有的Jersey webservice方法,它通过Http POST方法接受许多参数,该方法用于处理标准表单数据,application / x-www-form-urlencoded的内容类型; 其中一个参数是字符串列表。 下面是我拥有的方法签名的示例。 @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public Response createItem( @FormParam(“p1”) long p1, @FormParam(“p2”) String p2, @FormParam(“p3”) List p3, @FormParam(“p4”) String p4, @Context UriInfo uriInfo ) throws SQLException { 这是正常工作,当在List中传递多个p3参数时,Jersey正确生成并传递给方法。 我现在需要制作一个可以接受多部分请求的方法的替代版本,这样文件也可以与现有参数一起上传。 所以我创建了一个非常相似的方法签名来使用多部分请求,如下所示。 @POST @Consumes(MediaType.MULTIPART_FORM_DATA) public Response createItemWithFile( @FormDataParam(“p1”) long p1, @FormDataParam(“p2”) String p2, @FormDataParam(“p3”) List p3, @FormDataParam(“p4”) String p4, @FormDataParam(“file”) InputStream inputStream, @Context […]

目标org.springframework.boot的执行默认值:spring-boot-maven-plugin:1.2.3.RELEASE:repackage failed:Source必须引用现有文件

我想使用maven-jar-plugin来构建diff分类器jar,比如: mvn deploy:部署-p debug,classifier-demo-0.0.1-debug.jar mvn deploy:部署-p test,classifier-demo-0.0.1-test.jar。 但失败了: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.2.3.RELEASE:repackage failed: Source must refer to an existing file pom.xml: 4.0.0 org.springframework.boot spring-boot-starter-parent 1.2.3.RELEASE org.lenic classifier-demo 0.0.1 1.7 local-repo file://D:\repo test test debug true debug org.springframework.boot spring-boot-maven-plugin org.apache.maven.plugins maven-jar-plugin ${classifier}

netty的并发编码

编码器的编码方法会同时执行吗? 我观察到编码方法可能由不同的线程并发。 管道定义为: Channels.pipeline( idleHandler, new AmfDecoder(GameEvent.class), new AmfEncoder(), concurrencyHandler, new WebHandler()); 编码器: public class AmfEncoder extends OneToOneEncoder{ private final SerializationContext serializationContext = new SerializationContext(); private final Amf3Output amfout = new Amf3Output(serializationContext); @Override protected Object encode(ChannelHandlerContext arg0, Channel arg1, Object arg2) throws Exception { T e = (T)arg2; ByteArrayOutputStream byteoutStreamSize = new ByteArrayOutputStream(); amfout.setOutputStream(byteoutStreamSize); amfout.writeObject(e.getBody()); […]