您的位置:程序门 -> java -> j2me



请问下用kxml的问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


请问下用kxml的问题
发表于:2007-05-12 18:58:21 楼主
请问我要给服务器发送一个xml  
我希望服务器可以解析出我之中带的参数   例如id   然后通过sql语句查询数据库   最后返回   给客户端   一个xml

这个xml我要怎么传过去  
我这么写的   不知道行不行
httpconnection   httpconnection   =   (httpconnection)   connector
.open( "http://127.0.0.1:8080/jinboservlet ");

httpconnection.setrequestmethod(httpconnection.post);
dataoutputstream   dos   =   null;

string     textxml   =   null;

                        textxml   =   " <?xml   version   =   '1.0 '   encoding   =   'utf-8 '?> ";
                        textxml   =   textxml+ " <courses> ";
                        textxml   =   textxml   + "             <id> aaa </id> "   +
                                                            "   <name> bbb </name> "   +
                                                      "     <author> ccc </author> "   +
                                                        "   <price> ddd </price> "+
                                                            " <weight> sasa </weight> "+
                                                            " <date> fdfds </date> ";
                            textxml   =   textxml   +   " </courses> ";
                          byte[]     ss   =   textxml.getbytes();
                          dos.write(ss);
                          dos.flush();
发表于:2007-05-13 08:26:191楼 得分:0
httpconnection设置下content-length


快速检索

最新资讯
热门点击