Search Results

Search found 25 results on 1 pages for 'turbogears'.

Page 1/1 | 1 

  • Turbogears 2.0 with Python 2.6

    - by AKSK
    I've tried to install TurboGears 2.0 with Python 2.6 on both Windows 7 and Windows XP, but both give the same error: File "D:\PythonProjects\tg2env\Scripts\paster-script.py", line 8, in <module> load_entry_point('pastescript==1.7.3', 'console_scripts', 'paster')() File "D:\PythonProjects\tg2env\lib\site-packages\pastescript-1.7.3-py2.6.egg\paste\script\command.py", line 73, in run commands = get_commands() File "D:\PythonProjects\tg2env\lib\site-packages\pastescript-1.7.3-py2.6.egg\paste\script\command.py", line 115, in get_ plugins = pluginlib.resolve_plugins(plugins) File "D:\PythonProjects\tg2env\lib\site-packages\pastescript-1.7.3-py2.6.egg\paste\script\pluginlib.py", line 81, in res pkg_resources.require(plugin) File "D:\PythonProjects\tg2env\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py", line 626, in require File "D:\PythonProjects\tg2env\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py", line 524, in resolve pkg_resources.DistributionNotFound: zope.sqlalchemy>=0.4: Not Found for: City_Guide (did you run python setup.py develop?) Now, according to the documentation on the main site, TurboGears 2.0 supports Python 2.6 in this page: TurboGears works with any version of python between 2.4 and 2.6. The most widely deployed version of python at the moment of this writing is version 2.5. Both python 2.4 and python 2.6 require additional steps which will be covered in the appropriate sections. But they never mention those steps in the documentation.

    Read the article

  • Install TurboGears on windows xp

    - by coder
    I've been trying to get TurboGears installed on Windows by following this site. I've installed virtualenv but when I execute the command "virtualenv --no-site-packages testproj", I get the following message: New python executable in testproj\Scripts\python.exe Traceback (most recent call last): File "C:\Python26\Scripts\virtualenv-script.py", line 8, in load_entry_point('virtualenv==1.4.5', 'console_scripts', 'virtualenv')() File "C:\Python26\lib\site-packages\virtualenv-1.4.5-py2.6.egg\virtualenv.py", line 529, in main use_distribute=options.use_distribute) File "C:\Python26\lib\site-packages\virtualenv-1.4.5-py2.6.egg\virtualenv.py", line 612, in create_environment site_packages=site_packages, clear=clear)) File "C:\Python26\lib\site-packages\virtualenv-1.4.5-py2.6.egg\virtualenv.py", line 837, in install_python stdout=subprocess.PIPE) File "C:\Python26\lib\subprocess.py", line 621, in __init__ errread, errwrite) File "C:\Python26\lib\subprocess.py", line 830, in _execute_child startupinfo) WindowsError: [Error 14001] This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem Can someone help me debug this ? If any one knows a better tutorial to install turbogears, please let me know.

    Read the article

  • Turbogears 2 vs Django - any advice on choosing replacement for Turbogears 1?

    - by michela
    I have been using Turbogears 1 for prototyping small sites for the last couple of years and it is getting a little long in the tooth. Any suggestions on making the call between upgrading to Turbogears 2 or switching to something like Django? I'm torn between the familiarity of the TG community who are pretty responsive and do pretty good documentation vs the far larger community using Django. I am quite tempted by the built-in CMS features and the Google AppEngine support. Any advice? Thanks .M.

    Read the article

  • How to extend the Turbogears 2.1 login functionality

    - by Marc
    I'm using Turbogears 2.1 and repoze.who/what and am having trouble figuring out how to extend the basic authentication functionality. I am essentially attempting to require users to activate their account via an emailed link before they can login. If they try to login without activating their account, I want to display an appropriate error message. The default Turbogears functionality simply displays one message for all errors. I created my own authentication plugin which works fine. It won't allow users to login if they have not activated their account. However, the problem comes when I try to create the form and display custom error messages. How can I go about doing this? Thanks

    Read the article

  • Returning Database Blobs in TurboGears 2.x / FCGI / Lighttpd extremely slow

    - by Tom
    Hey everyone, I am running a TG2 App on lighttpd via flup/fastcgi. We are reading images (~30kb each) from BlobFields in a MySQL database and return those images with a custom mime type via a controller method. Caching these images on the hard disk makes no sense because they change with every request, the only reason we cache these in the DB is that creating these images is quite expensive and the data used to create the images is also present in plain text on the website. Now to the problem itself: When returning such an image, things get extremely slow. The code runs totally fine on paster itself with no visible delay, but as soon as its running via fcgi/lighttpd the described phenomenon happens. I profiled the method of my controller that returns my blob, and the entire method runs in a few miliseconds, but when "return" executes, the entire app hangs for roughly 10 seconds. We could not reproduce the same error with PHP on FCGI. This only seems to happen with Turbogears or Pylons. Here for your consideration the concerned piece of source code: @expose(content_type=CUSTOM_CONTENT_TYPE) def return_img(self, img_id): """ Return a DB persisted image when requested """ img = model.Images.by_id(img_id) #get image from DB response.headers['content-type'] = 'image/png' return img.data # this causes the app to hang for 10 seconds

    Read the article

  • good beginner tutorial for turbogears 2

    - by coder10
    I find myself struggling to do simple things that would normally take me about 5 minutes to do in PHP. At the moment, I'm trying to create a basic form which will print the details on another page when you click submit. Looking at the documentation, I find examples but none explaining why it works in such a way.

    Read the article

  • Renaming TurboGears 2's Repoze Fields with TGAdmin

    - by William Chambers
    I've been working on renaming TurboGears 2's Repoze 'groups' field to 'roles' to free the namespace and db tables for other purposes. Also roles makes much more sense to me then groups because I have a strong Drupal background. Now I have found some of the docs to do this such as these: http://www.turbogears.org/2.1/docs/main/Auth/Customization.html#customizing-the-model-structure-assumed-by-the-quickstart http://code.gustavonarea.net/repoze.what-quickstart/#customizing-the-model-definition However these only go part of the way. I have made (I'm pretty sure at least, I've double checked a few times.) all the changes required as you can see in this diff. This seems to work fine however I've ran into a rather major issue with the TurboGears Admin system. I've tried http://turbogears.org/2.0/docs/main/Extensions/Admin/index.html and it didn't seem to make any difference, however I'm not 100% sure I did it correctly. The problem occurs when I attempt to go to localhost/admin/permissions/. It causes a Internal Server Error and outputs the following error. http://pastebin.com/YWMH3SiU This error does not happen on the Roles/Users pages and the permissions /edit/1 also works. I'm running kubuntu 10.04 with TG 2.1b2. (I'm running the beta mostly for easier mako support which is really important.) Any help would be very appreciated.

    Read the article

  • File Uploads with Turbogears 2

    - by William Chambers
    I've been trying to work out the 'best practices' way to manage file uploads with Turbogears 2 and have thus far not really found any examples. I've figured out a way to actually upload the file, but I'm not sure how reliable it us. Also, what would be a good way to get the uploaded files name? file = request.POST['file'] permanent_file = open(os.path.join(asset_dirname, file.filename.lstrip(os.sep)), 'w') shutil.copyfileobj(file.file, permanent_file) file.file.close() this_file = self.request.params["file"].filename permanent_file.close() So assuming I'm understanding correctly, would something like this avoid the core 'naming' problem? id = UUID. file = request.POST['file'] permanent_file = open(os.path.join(asset_dirname, id.lstrip(os.sep)), 'w') shutil.copyfileobj(file.file, permanent_file) file.file.close() this_file = file.filename permanent_file.close()

    Read the article

  • Remove all user's cookies/sessions when password is reset

    - by Juraj
    I'm interested in improving security of my TurboGears 2.2 application so that when user changes his password, it logs him out from all sessions and he must login again. When user changes password on browser 1, he must relogin on browser 2, too. Experiments show that this is not the case, especially if browser 2 had "remember me" enabled. It's standard quickstarted app using repoze.who. It seems maybe I need to change AuthTktCookiePlugin, but don't see a way to do it without much rewiring.

    Read the article

  • Can Core Data be used on Linux?

    - by glenc
    This might be a stupid question, but I was wondering whether or not you can use the Core Data libraries on Linux at all? I'm planning how to build the server side of an iPhone app that I'm working on, and have found that you can use PyObjC to get access to Core Data in a Python environment, e.g. use Core Data in a TurboGears web application. At this point I'm thinking that you would have to run the web server on Mac OSX, because I can't find any evidence on the internet that you can access the Objective-C libraries on Linux. I've always written webapps on Linux but will obviously make the jump to an OSX server if it allows me to use the same datastore implementation on the iPhone and the server, the only job remaining being the Core Data <- Web Services XML translation that has to happen on the wire.

    Read the article

  • Serving files with Turbogears2

    - by Lionel
    How do I serve files from an arbitrary directory with Turbogears2? I have a database with the local path, e.g. /home/myuser/tg2env/MyProject/myproject/files/somefile.jpg tg.url seems to only be able to serve things from the public directory. Is there a widget available, or do I need to write some sort of DownloadController?

    Read the article

  • TG2.1: Proper location to store a database session instance?

    - by Lee Olayvar
    I am using a custom database (MongoDB) with TG 2.1 and i am wondering where the proper place to store the PyMongo connection/database instances would be? Eg, at the moment they are getting created inside of my inherited instance of AppConfig. Is there a standard location to store this? Would shoving the variables into the project.model.__init__ be the best location, given that under SQLAlchemy, the database seems to commonly be retrieved via: from project.model import DBSession, metadata Anyway, just curious what the best practice is.

    Read the article

  • How do Python and PHP compare for ecommerce?

    - by Ibn Saeed
    If I were to start an ecommerce store, which language would you suggest I start with? Python or PHP? And would it be wise to use Python for an ecommerce site in favor of PHP? PHP has lots of shopping carts, both open source and commercial. Is Python the future of Web Development ? Edit: I would like to clear out that i am not asking for Shopping carts solutions and links to them.

    Read the article

  • In MVC framworks (such as Ruby on Rails), do usually Model spell as singular and controller and view

    - by Jian Lin
    I usually see Ruby on Rails books using script/generate model Story name:string link:string which is a singular Story, while when it is controller script/generate controller Stories index then the Story now is Stories, which is plural. Is this a standard on Ruby on Rails? Is it true in other MVC frameworks too, like CakePHP, Symfony, Django, or TurboGears? I see that in the book Rails Space, the controller is also called User, which is the same as the model name, and it is the only exception I see.

    Read the article

  • Python web frameworks comparisons

    - by stupidLearner
    I recently asked a question on SO about Python web frameworks: http://stackoverflow.com/questions/4909306/python-web-frameworks-vs-java-web-frameworks-how-is-web-development-in-python-do I want to learn one just for fun but it also has to be able to help me deliver a proper working application. I am looking for a framework with lots of features, powerful, mature, with large community, good documentation, books etc. I need something that will help me be more productive in developing my app and not waste time figuring out how to do a certain thing in the framework or how to write workaround around the limitations of the framework. I was thinking one of the following: django, zope, turbogears, pylons. Off course the war is raging out there and there are other alternatives but seems Django is at the top... or is it just hype? I am interested in pros and cons of each. What was the best feature you think the framework has? What is the thing it lacks? What could have been done differently. Help me chose one to learn for starters.

    Read the article

  • how to choose a web framework and javascript library?

    - by Trylks
    I've been procrastinating learning some framework for web apps w/ some library for AJAX, something like django with prototype, or turbogears with mootools, or zeta components with dojo, grok, jquery, symfony... The point is to spend some of my spare time, have "fun" and create cool stuff that hopefully is some useful. I think maybe I wouldn't like something like GWT or pyjamas because I wouldn't like to "get married" with some technology, I want to keep my freedom to add another javascript library, and so on. I didn't decide even the language yet, but I think I'd prefer python. PHP could be fine if there is some framework that is nice enough. Besides that, I don't even know where to start. I don't feel like learning a framework to then realize there is something that I cannot comfortably do, switch to another framework then find that a third framework has something really cool, etc. And the same goes for javascript libraries. So, some guidance would be really appreciated. I don't really know why are so many options available and what do they aim for, I guess some of them focus on some aspects and some on others, but I just want to make cool and nice apps that I can easily maintain, without spending too much time on coding or learning and avoiding the "trapped in the framework" feeling, when doing something is awfully complicated (or even impossible) with compared with the rest of things or doing that same thing on a different framework. I guess in the end I'll go for django and jquery since they are the most widely used options, afaik, but if I was going for the most widely used options I guess I should choose Java or PHP (I don't really like Java for my spare time, but php is not so bad), so I preferred to ask first. I think the question has to consider both, framework and library, since sometimes they are coupled. I think this is the place to ask this kind of things, sorry if not, and thank you.

    Read the article

  • SQLAlchemy session management in long-running process

    - by codeape
    Scenario: A .NET-based application server (Wonderware IAS/System Platform) hosts automation objects that communicate with various equipment on the factory floor. CPython is hosted inside this application server (using Python for .NET). The automation objects have scripting functionality built-in (using a custom, .NET-based language). These scripts call Python functions. The Python functions are part of a system to track Work-In-Progress on the factory floor. The purpose of the system is to track the produced widgets along the process, ensure that the widgets go through the process in the correct order, and check that certain conditions are met along the process. The widget production history and widget state is stored in a relational database, this is where SQLAlchemy plays its part. For example, when a widget passes a scanner, the automation software triggers the following script (written in the application server's custom scripting language): ' wiget_id and scanner_id provided by automation object ' ExecFunction() takes care of calling a CPython function retval = ExecFunction("WidgetScanned", widget_id, scanner_id); ' if the python function raises an Exception, ErrorOccured will be true ' in this case, any errors should cause the production line to stop. if (retval.ErrorOccured) then ProductionLine.Running = False; InformationBoard.DisplayText = "ERROR: " + retval.Exception.Message; InformationBoard.SoundAlarm = True end if; The script calls the WidgetScanned python function: # pywip/functions.py from pywip.database import session from pywip.model import Widget, WidgetHistoryItem from pywip import validation, StatusMessage from datetime import datetime def WidgetScanned(widget_id, scanner_id): widget = session.query(Widget).get(widget_id) validation.validate_widget_passed_scanner(widget, scanner) # raises exception on error widget.history.append(WidgetHistoryItem(timestamp=datetime.now(), action=u"SCANNED", scanner_id=scanner_id)) widget.last_scanner = scanner_id widget.last_update = datetime.now() return StatusMessage("OK") # ... there are a dozen similar functions My question is: How do I best manage SQLAlchemy sessions in this scenario? The application server is a long-running process, typically running months between restarts. The application server is single-threaded. Currently, I do it the following way: I apply a decorator to the functions I make avaliable to the application server: # pywip/iasfunctions.py from pywip import functions def ias_session_handling(func): def _ias_session_handling(*args, **kwargs): try: retval = func(*args, **kwargs) session.commit() return retval except: session.rollback() raise return _ias_session_handling # ... actually I populate this module with decorated versions of all the functions in pywip.functions dynamically WidgetScanned = ias_session_handling(functions.WidgetScanned) Question: Is the decorator above suitable for handling sessions in a long-running process? Should I call session.remove()? The SQLAlchemy session object is a scoped session: # pywip/database.py from sqlalchemy.orm import scoped_session, sessionmaker session = scoped_session(sessionmaker()) I want to keep the session management out of the basic functions. For two reasons: There is another family of functions, sequence functions. The sequence functions call several of the basic functions. One sequence function should equal one database transaction. I need to be able to use the library from other environments. a) From a TurboGears web application. In that case, session management is done by TurboGears. b) From an IPython shell. In that case, commit/rollback will be explicit. (I am truly sorry for the long question. But I felt I needed to explain the scenario. Perhaps not necessary?)

    Read the article

  • Python web devlopment framework for python 3.1 user

    - by iama
    I have been learning python for some time now. While starting this "learning python" endeavor I decided to learn the latest and greatest 3.1 version of python. I regret this decision now because I wanted to try my hands on some of the python web development frameworks & it looks like many of them does not support 3.1 yet & it looks like it might take them years to support the new version of Python especially Django and TurboGears. This is really disappointing. Therefore, SO users, do you have any recommendation for a web framework for me that runs on 3.1 and supports some of the modern (I guess I will never learn ;-)) web framework features like MVC/ORM/URL Routing/Caching etc. Many thanks for your response.

    Read the article

  • In MVC framworks (such as Ruby on Rails), does usually Model spell as singular and controller and vi

    - by Jian Lin
    I usually see Ruby on Rails books using script/generate model Story name:string link:string which is a singular Story, while when it is controller script/generate controller Stories index then the Story now is Stories, which is plural. Is this a standard on Ruby on Rails? Is it true in other MVC frameworks too, like CakePHP, Symfony, Django, or TurboGears? I see that in the book Rails Space, the controller is also called User, which is the same as the model name, and it is the only exception I see. Update: also, when scaffold is done on Ruby on Rails, then automatically, the model is singular and the controller and view are both plural.

    Read the article

  • How, in general, can web framework support REST style?

    - by juro
    I would like to know, what are the ways a web framework may be suitable for designing a RESTful app, in general. One goal is for example to provide http request routing, so they are automatically sent to appropriate controllers. From architectural point of view, web framework based on MVC pattern are more suitable for REST. What other features of web frameworks are helpful by building apps satisfying the REST constraints? Is there any reason why you consider certain languages(python/java) or web frameworks(django/turbogears/jersey/restlets/...) as the most applicable ones?

    Read the article

  • MySQLdb within python2.5 virtualenv

    - by wizard
    I have a Fedora 11 box with MySQL server. Fedora 11 uses python 2.6 internally and python 2.6 is automatically installed on the box. I have created a python virtual-env for version 2.5.5, so that I can run turbogears 1.x application. I have MySQLdb rpm installed on the box (and it works fine with python 2.6). When I import MySQLdb from within python version 2.6 it imports is successfully. When I import MySQLdb from within the python 2.5.5 virtual-env the import fails (because I have installed virtual-env with --no-site-packages). So, I have to install MySQLdb python as a local package (local to virtual-env). 'easy_install MySQL-python' within the virtual env fails. It downloads the MySQL-python-1.2.3.c1.tar.gz/download, but the 'python setup.py build' fails with error. The same problem occurs when building the MySQL outside of virtual-env. Is the 'python setup.py build' for MySQL-python trying to link to a library (and am I missing some library)? Or is the downloaded code missing some header files (unlikely)? Thanks.

    Read the article

  • Why use Django on Google App Engine?

    - by Travis Bradshaw
    When researching Google App Engine (GAE), it's clear that using Django is wildly popular for developing in Python on GAE. I've been scouring the web to find information on the costs and benefits of using Django, to find out why it's so popular. While I've been able to find a wide variety of sources on how to run Django on GAE and the various methods of doing so, I haven't found any comparative analysis on why Django is preferable to using the webapp framework provided by Google. To be clear, it's immediately apparent why using Django on GAE is useful for developers with an existing skillset in Django (a majority of Python web developers, no doubt) or existing code in Django (where using GAE is more of a porting exercise). My team, however, is evaluating GAE for use on an all-new project and our existing experience is with TurboGears, not Django. It's been quite difficult to determine why Django is beneficial to a development team when the BigTable libraries have replaced Django's ORM, sessions and authentication are necessarily changed, and Django's templating (if desirable) is available without using the entire Django stack. Finally, it's clear that using Django does have the advantage of providing an "exit strategy" if we later wanted to move away from GAE and need a platform to target for the exodus. I'd be extremely appreciative for help in pointing out why using Django is better than using webapp on GAE. I'm also completely inexperienced with Django, so elaboration on smaller features and/or conveniences that work on GAE are also valuable to me. Thanks in advance for your time!

    Read the article

  • which package i should choose, if i want to install virtualenv for python?

    - by hugemeow
    pip search just returns so many matches, i am confused about which package i should choose to install .. should i only install virtualenv? or i'd better also install virtualenv-commands and virtualenv-commands, etc, but i really don't know exactly what virtualenv-commands is ... mirror0@lab:~$ pip search virtualenv virtualenvwrapper - Enhancements to virtualenv virtualenv - Virtual Python Environment builder veh - virtualenv for hg pyutilib.virtualenv - PyUtilib utility for building custom virtualenv bootstrap scripts. envbuilder - A package for automatic generation of virtualenvs virtstrap-core - A bootstrapping mechanism for virtualenv+pip and shell scripts tox - virtualenv-based automation of test activities virtualenvwrapper-win - Port of Doug Hellmann's virtualenvwrapper to Windows batch scripts everyapp.bootstrap - Enhanced virtualenv bootstrap script creation. orb - pip/virtualenv shell script wrapper monupco-virtualenv-python - monupco.com registration agent for stand-alone Python virtualenv applications virtualenvwrapper-powershell - Enhancements to virtualenv (for Windows). A clone of Doug Hellmann's virtualenvwrapper RVirtualEnv - relocatable python virtual environment virtualenv-clone - script to clone virtualenvs. virtualenvcontext - switch virtualenvs with a python context manager lessrb - Wrapper for ruby less so that it's in a virtualenv. carton - make self-extracting virtualenvs virtualenv5 - Virtual Python 3 Environment builder clever-alexis - Clever redhead girl that builds and packs Python project with Virtualenv into rpm, deb, etc. kforgeinstall - Virtualenv bootstrap script for KForge pypyenv - Install PyPy in virtualenv virtualenv-distribute - Virtual Python Environment builder virtualenvwrapper.project - virtualenvwrapper plugin to manage a project work directory virtualenv-commands - Additional commands for virtualenv. rjm.recipe.venv - zc.buildout recipe to turn the entire buildout tree into a virtualenv virtualenvwrapper.bitbucket - virtualenvwrapper plugin to manage a project work directory based on a BitBucket repository tg_bootstrap - Bootstrap a TurboGears app in a VirtualEnv django-env - Automaticly manages virtualenv for django project virtual-node - Install node.js into your virtualenv django-environment - A plugin for virtualenvwrapper that makes setting up and creating new Django environments easier. vip - vip is a simple library that makes your python aware of existing virtualenv underneath. virtualenvwrapper.django - virtualenvwrapper plugin to create a Django project work directory terrarium - Package and ship relocatable python virtualenvs venv_dependencies - Easy to install any dependencies in a virtualenviroment(without making symlinks by hand and etc...) virtualenv-sh - Convenient shell interface to virtualenv virtualenvwrapper.github - Plugin for virtualenvwrapper to automatically create projects based on github repositories. virtualenvwrapper.configvar - Plugin for virtualenvwrapper to automatically export config vars found in your project level .env file. virtualenvwrapper-emacs-desktop - virtualenvwrapper plugin to control emacs desktop mode bootstrapper - Bootstrap Python projects with virtualenv and pip. virtualenv3 - Obsolete fork of virtualenv isotoma.depends.zope2_13_8 - Running zope in a virtualenv virtual-less - Install lessc into your virtualenv virtualenvwrapper.tmpenv - Temporary virtualenvs are automatically deleted when deactivated isotoma.plone.heroku - Tooling for running Plone on heroku in a virtualenv gae-virtualenv - Using virtualenv with zipimport on Google App Engine pinvenv - VirtualEnv plugins for pin isotoma.depends.plone4_1 - Running plone in a virtualenv virtualenv-tools - A set of tools for virtualenv virtualenvwrapper.npm - Plugin for virtualenvwrapper to automatically encapsulate inside the virtual environment any npm installed globaly when the venv is activated d51.django.virtualenv.test_runner - Simple package for running isolated Django tests from within virtualenv difio-virtualenv-python - Difio registration agent for stand-alone Python virtualenv applications VirtualEnvManager - A package to manage various virtual environments. virtualenvwrapper.gem - Plugin for virtualenvwrapper to automatically encapsulate inside the virtual environment any gems installed when the venv is activated

    Read the article

  • "Could not establish secure channel for SSL/TLS" in .NET CF application on smart phone

    - by Stefan Mohr
    I have a stubborn communications issue with an application running on the .NET Compact Framework 3.5 on Windows Mobile smartphones. I am constructing a web request using this code: UTF8Encoding encoding = new System.Text.UTF8Encoding(); byte[] Data = encoding.GetBytes(HttpUtility.ConstructQueryString(parameters)); httpRequest = WebRequest.Create((domain)) as HttpWebRequest; httpRequest.Timeout = 10000000; httpRequest.ReadWriteTimeout = 10000000; httpRequest.Credentials = CredentialCache.DefaultCredentials; httpRequest.Method = "POST"; httpRequest.ContentType = "application/x-www-form-urlencoded"; httpRequest.ContentLength = Data.Length; Stream SendReq = httpRequest.GetRequestStream(); SendReq.Write(Data, 0, Data.Length); SendReq.Close(); HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse(); return httpResponse.GetResponseStream(); The web service functions by receiving a JSON-encoded document as part of the URL (eg. https://site.com/ws/sync??document={"version":"1.0.0","items":[{"item_1":"item1"}]}&user=usr&password=pw), and as a response receives another JSON document as response data. This code runs fine on all emulators and PDAs running WM 5 and 6. We have seen an issue with a couple of customers running Treo smartphones (and only on the Sprint network). We have tested the code on an identical device on the AT&T network (via DeviceAnywhere) and once again the code worked as we expected. This has to be some sort of security policy on the phone, but we've been unable to determine a workaround or diagnose it thoroughly as we cannot reproduce it in house and have had to resort to getting users to assist with running test drivers for us. When this code executes, the user's device throws the following exception: System.Net.WebException Could not establish secure channel for SSL/TLS Stack trace: at System.Net.HttpWebRequest.finishGetRequestStream() at System.Net.HttpWebRequest.GetRequestStream() at OurApp.GetResponseStream(String domain, Hashtable parameters) inner exception: System.IO.IOException Authentication failed because the remote party has closed the transport stream. Stack trace: at System.Net.SslConnectionState.ClientSideHandshake() at System.Net.SslConnectionState.PerformClientHandShake() at System.Net.Connection.connect(Object ignored) at System.Threading.ThreadPool.WorkItem.doWork(Object o) at System.Threading.Timer.ring() Examining the server Apache logs shows no hits from the user's IP - I don't think the device is even attempting to send a packet before failing. If relevant, the server is running Apache on Linux and is written using the TurboGears Python framework. The server certificate is issued by a CA and is still valid. The test driver where this error was copied from was not code signed, however the same error (without the error messages) is signed with a GeoTrust certificate so we don't believe this is a code signing issue. The application installs and launches without issue on all phones - it's just establishing this SSL connection that is breaking for these users. One significant issue in troubleshooting is that there is a substantial inconvenience each time we try out a solution (need to find a "volunteer" customer), so we're really looking for a silver bullet or a better understanding of the handshaking process so we can be reasonably confident we only need to ask the user to test it one or two more times. One final mention: we have tried the sync both over ActiveSync and also over GPRS with identical results. Any thoughts would be greatly appreciated!

    Read the article

1