你能帮我把移动应用程序中的数据以WBXML格式发送到Web服务器吗?我有一点xml到wbxml的转换,但不知道如何以有效的方式发送到web服务器?
发布于 2008-09-26 13:50:24
我不确定我是否完全理解你的问题,但这里...
您需要使用POST HTTP请求,并将WBXML数据写入连接对象输出流。下面是一个简单的例子,显然你需要更多的代码才能让它真正工作:
byte[] wbxml = getMyWbxmlData();
HttpConnection conn = (HttpConnection)Connector.open("http://myserver.com/mywbxmlhandler");
conn.setRequestMethod(HttpConnection.POST);
OutputStream output = conn.openOutputStream();
output.write(wbxml);
InputStream input = conn.openInputStream(); // This will flush the outputstream
// Do response processing假设您的WBXML已经包含了前导,比如版本号、公共代码页标识符等。
https://stackoverflow.com/questions/133815
复制相似问题