BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 09-01-2004, 09:58 AM   #1
ghill1011
New Member
 
Join Date: Sep 2004
Posts: 1
Default HELP with HttpConnection.setRequestProperty()

Please Login to Remove!

Running 3.7. I'm trying to create a SOAP client in my blackberry simulator. I use: HttpConnection.setRequestProperty("SOAPAction", "ping")
to set the soap action. But, what HttpConnection writes out is:
"soapaction: ping". When the web service receives this, it complains that the SOAP Action is not set and returns an error to my client. Anyone have any ideas?
Offline  
Old 09-01-2004, 01:28 PM   #2
Mark Rejhon
Retired BBF Moderator
 
Mark Rejhon's Avatar
 
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: Bold
Carrier: Rogers
Posts: 4,870
Default

I am now attempting to make an inquiry with Blackberry developers, will let you know if I get an answer...

Others, please feel free to help here. Thanks!
__________________
Thanks,
Mark Rejhon
Author of XMPP extension XEP-0301:
www.xmpp.org/extensions/xep-0301.html - specification
www.realjabber.org - open source
Offline  
Old 09-03-2004, 08:34 AM   #3
David O'Meara
New Member
 
Join Date: Sep 2004
Location: Australia
Posts: 4
Default

My work-around is on the blackberry site
__________________
David O'Meara
JavaRanch
Offline  
Old 09-03-2004, 10:15 AM   #4
kirson
Talking BlackBerry Encyclopedia
 
kirson's Avatar
 
Join Date: Aug 2004
Location: Chicago
Model: 9000
Carrier: ATT
Posts: 421
Default

David,

Hope you don't mind, but I'm copying your response into this forum -- makes it easier to read the thread beginning to end. If you would rather I delete this, just let me know, and I'll remove it. Here is David's workaround:

Quote:
I'm shocked, you're quite right. I have no idea where the behaviour comes from. I also tried "Soap-Action" just to see what happens, and it too gets converted.

The work around I'm using is to open a socket connection and write the header myslef, but it means you now miss out on the automatic parsing of the response header. Annoying. I'm really looking forward to rewriting that when I shouldn't have to.

Just for the record:
Split the URL into the host and URI, use the Connector to open HOST:port, cast the Connection to StreamConnection (Not HttpConnection)
write the header like this: (i save it as a byte array then send as two chucks)
bos = new ByteArrayOutputStream();
out = new OutputStreamWriter(bos, "UTF-8");
out.write("POST ");
out.write( URI );
out.write(" HTTP/1.1\r\n");
out.write("Content-Type:text/html\r\n");
...

* Don't forget the request length
* Don't forget the extra \r\n at the end
* Note the URI in the POST part.

Then send the header followed by the payload.

OutputStream os = conn.openOutputStream();
byte[] header = getHeader(requestData.length);
os.write(header,0,header.length);
os.write(requestData, 0, requestData.length);
os.close();

The easiest place to get this is to use the Apache SOAP TCP Tunnel GUI and copy the header data as-is. Drop another post and tell me how you got on. I'm using kSoap2.0 by the way.
Offline  
Old 09-03-2004, 12:11 PM   #5
Mark Rejhon
Retired BBF Moderator
 
Mark Rejhon's Avatar
 
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: Bold
Carrier: Rogers
Posts: 4,870
Default

I was the one who made that inquiry on that website :D ....

Thanks for copying it back!
__________________
Thanks,
Mark Rejhon
Author of XMPP extension XEP-0301:
www.xmpp.org/extensions/xep-0301.html - specification
www.realjabber.org - open source
Offline  
Old 09-22-2004, 10:26 PM   #6
David O'Meara
New Member
 
Join Date: Sep 2004
Location: Australia
Posts: 4
Default

Mark, any response from RIM as to why the header gets mangled? I've been using the code I posted on my demo hand-held, but the default security for the company providing the demo blocks the request.

I find it strange that socket connections on port 80 appear to be treated differently to http connections, but I'm still looking into it. I haven't ruled out user error.
__________________
David O'Meara
JavaRanch
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


SERVER TECHNOLOGY 4870-XLS-44 SENTRY VDC 48VOLT DC REMOTE POWER MANAGER picture

SERVER TECHNOLOGY 4870-XLS-44 SENTRY VDC 48VOLT DC REMOTE POWER MANAGER

$299.99



Moxa NPort 5232 Device Server 2-Port RS-422/485 picture

Moxa NPort 5232 Device Server 2-Port RS-422/485

$29.99



Moxa NPort 5230 Device Server 2-Port RS-422/485 picture

Moxa NPort 5230 Device Server 2-Port RS-422/485

$29.99



AVAYA S8300E S3 V1 Media Server 700508955 W/ 320GB Hard Drive 16GB RAM picture

AVAYA S8300E S3 V1 Media Server 700508955 W/ 320GB Hard Drive 16GB RAM

$249.00



Server - 82700 - 1 1/2 Qt Mini Warmer picture

Server - 82700 - 1 1/2 Qt Mini Warmer

$150.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.