View Single Post
Old 12-17-2009, 11:28 PM   #50 (permalink)
New Member
Join Date: Nov 2009
Model: 8900
Carrier: Airtel
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Stuck on SOAP Application for BlackBerry

Hi All, I've successfully created a standalone java version of a SOAP communication class to enable Web Services data delegation.

But when I try to port to Blackberry device software, I'm having trouble.

1. I cannot find the correct replacement for H**pURLConnection class in Blackberry.

We need to use doOutput=true, so we can output the request/response to the Writer object through the stream.

right now, my coding goes like this:
URL u = new URL(server);
URLConnection uc = u.openConnection();
H**pURLConnection connection = (H**pURLConnection) uc;
connection.setRequestProperty("SOAPAction", SOAP_ACTION);
OutputStream out = connection.getOutputStream();
Writer wout = new OutputStreamWriter(out);
wout.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");

..................XML CODE HERE.................


InputStream in = connection.getInputStream();
int c;
while ((c = != -1)
//read and store the response as an XML String

Can someone please look into this and suggest a solution with H**pTransport than using the H**pURLConnection? with H**pURLConnection, I am sending the SOAP request as an XML and getting the request as an XML. How can I do this with H**pTransport in KSOAPDemo version of the same, so I can get a simple SOAP Client working on blackberry device?
Offline   Reply With Quote