10-13-2009 08:55 AM
Hi all,
I am stuck with a peculiar Enterprise BES behavior.
I have a signed COD application that opens a HTTP connection by determining the connection string (as in various connection scenarios like WAP, WiFi etc) and I am getting connected by far (tested in DeviceAnywhere) and in some Corporate phones. My app has both GET and POST connection requirement (not simultaneously) and till now I have no issues with GET. But issues starts to flood in whenever a POST connection is initiated and that only from a phone behind some corporate BES (Simulator, DeviceAnywhere and other phones are doing fine). The chain of events that happens is as given below:
1. The response for POST receives a HTTP 302 with a new URL (which is not the URL for my server).
2. Resending the POST to this URL comes back with HTTP 200 but there is no hit to our server and the ContentType is different.
Since Corporate BES phones are hard to come by, one of my friend (also an employee of that corporate) was helping me out with the testing by far but now I am stuck since I don't know what next I should ask him to try.
I would very much appreciate if anyone can throw some light to it.
Thanks in advance,
Bikram
10-13-2009 08:29 PM
The connection from a BES enabled phone (assuming that you have specified deviceside=false or this is what the phone is defaulting to, is complicated because the http request must go through the corporate network and then out via their firewall. There are many potential break points in this chain. For example, some corporations require users to logon to a proxy server before they will be allowed out of the corporate network.
Unless you have contacts inside the corporate who can review the BES logs, debugging this might be very difficult. if you can get the BES logs, then these will show you what is going on, provide you have the right logging turned on. Sorry, this is not my area, I can't help much more on resolving the problem this way. Actually if you have a contact in this area, you should ask them this question directly.
I would start by making sure that your URL can be directly entered by your friend. He or she should try this in their Browser, making sure it is the BlackBerry Browser. If there is no trouble with this, then, in theory, you should be able to get through. If your friend can't get to your web site, then this will give you some indication about what needs to be resolved.
Assuming that your friend can get through and does not require to login to anything, then my only suggestion is that you log everything that comes back with the 302 and the 200, including all headers, and try to work out from this what Servers are being involved and why the redirection is taking place.
Good luck.
10-13-2009 09:29 PM
Thanks a lot for your guidance.
Regarding trying out through browser, I can send my friend the URL that the application is internally hitting, but since this has to be a POST request, I have no idea how I can generate a POST request from browser by typing the URL in the address bar.
I am not sure if he has enough privilages to get the BES log for me. The last option, as you said, remains is to print everything (HTTP header n all) into the phone display. I'll try to give it a shot and update my results to this thread.
Thanks again for replying this fast.
10-13-2009 10:25 PM
My guess is that there is something about your HTTP headers that is causing BES to clobber the requests.
How are you setting these?
Content-Type
User-Agent
Content-Length
If-Modified-Since
10-14-2009 12:17 AM - edited 10-14-2009 12:18 AM
Given below a sample HTTP transaction for the same POST message (I have also added a server response to it -- taken from the wireshark for case when it is working i.e. no corporate scenario):
POST /mcoupons/sync HTTP/1.1
User-Agent: ...
Content-Type: application/vnd.syncml+xml
Content-Length: 1460
Connection: Close
Expect: 100-continue
Host: 121.243.14.241:8080
HTTP/1.1 100 Continue
<SyncML xmlns='SYNCML
YNCML1.1'>
...
</SyncML>
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
Set-Cookie: JSESSIONID=0E0378A9591DB1C76D6A416DFCC3953E; Path=/
Cache-Control: no-store
Cache-Control: private
Connection: close
Content-Type: application/vnd.syncml+xml;charset=UTF-8
Content-Length: 12228
Date: Mon, 12 Oct 2009 04:08:30 GMT
Connection: close
<SyncML xmlns='SYNCML
YNCML1.1'>
...
</SyncML>
Unfortunately I can't sniff the network traffic for the corporate scenario for obvious reasons
.
10-14-2009 04:55 AM - edited 10-14-2009 04:57 AM
"I have no idea how I can generate a POST request from browser "
Actually the POST is not the important bit, this is a connectivity test. If you can put something on your web site that responds to a GET that will be enough to prove that the traffic is being correctly routed. it is possible that the corporate might do different processing for a GET and a POST, but I would say that is unlikely.
Getting your friend to use the URL from his PC inside the corporate might be a good test to.
Can you confirm that the URL you are using is a name, rather than an IP address. I understand that some corporates do not allow named IP addresses, they want to use DNS and serve the names from their own DNS Server so that they know what addresses are being requested.
Edit to fix typos.
10-22-2009 09:21 AM
"Actually the POST is not the important bit, this is a connectivity test. If you can put something on your web site that responds to a GET that will be enough to prove that the traffic is being correctly routed."
- The application (the jad file) is downloaded/installed (using the BB browser) from the same server using IP address (later I tried with a DNS name as well). I presume this rules out the presence of any connectivity issue. Right?
Although I am not sure if corporate firewall rules could be different for BB browser and J2ME app. Could they?
Another thing that I think might be different is the UA-Agent of the browser and the APP. Can you please tell me what is the UA-Agent (or any other relevant field in HTTP header) for Browser? I would like to putt the same values for my APP and try.
Any other thoughts/inputs is highly appreciated.
01-21-2010 02:28 AM
url
Bikram wrote:"Actually the POST is not the important bit, this is a connectivity test. If you can put something on your web site that responds to a GET that will be enough to prove that the traffic is being correctly routed."
- The application (the jad file) is downloaded/installed (using the BB browser) from the same server using IP address (later I tried with a DNS name as well). I presume this rules out the presence of any connectivity issue. Right?
Although I am not sure if corporate firewall rules could be different for BB browser and J2ME app. Could they?
Another thing that I think might be different is the UA-Agent of the browser and the APP. Can you please tell me what is the UA-Agent (or any other relevant field in HTTP header) for Browser? I would like to putt the same values for my APP and try.
Any other thoughts/inputs is highly appreciated.
me to stuggle in that http post link appent with argumets plz any help ? thanks in advance