Showing posts with label handle. Show all posts
Showing posts with label handle. Show all posts

Monday, March 26, 2012

With all the webservices, what is the right way to handle security?

We need tell webservice what to return, if a webservice is a general one, we need pass paramters to it to tell what data it should return. I don't think it is a good idea to expose the parameters to clients. So I am think I will put some parameters for a webserice to session state. then give a GUID to webservice, with the GUID, the webservice can get the parameters from session state. But I found my webservice can not read the variable from session state. (they are on same site).

This really depends on the specific web service. If you are dealing with something that returns very public data (e.g. a weather service), then security is not much of a concern. But if your web service has the potential to fo bad things on the client, or return confidential data, you clearly have to be careful. Authentication is one way to deal with this.

David


Sorry, I forgot to address your other question. In order to use session, you need to use this attribute on the method:

[WebMethod(EnableSession = true)]


thanks.

I just need some guide from you, so I don't spend time on wrong direction.

As the EnableSession, I posted in another post. It doesn't work. The reason is I need put that on GetData, but GetData can not be override.

Please give me some idea, I really need it.

with AJAX RC, how to handle system.web.UI namespace conflict? thanks

I add those under namespaces in web.config before when I use beta 2

<add namespace="system.web.UI"/>

<add namespace="microsoft.web.UI"/>

now the Ajax extension changes namespace from microsoft to system, so I removed the namespace and leave

<add namespace="system.web.UI"/>

but I still get error, how to handle this?

thanks

What error are you receiving?
Get the web.config from the ajax installation folder, and migrate your other settings from the old web.config. It's a pain, but that way I've never had any web.config error because of moving from beta1 to beta2 and so on. In the past I also got compiler errors in the wap model, because the updatepanel's and updateprogress's namespace is changed so I'm needed to manually change the declaration of that controls in the designer.cs files.

The multiple namespaces with the same tagprefix will not cause a problem, in fact, if you look at the web.config inside of the c:\Windows\Microsoft.NET\Framework\v2.0.50727\config folder you will see that the ASP tagprefix is already registered for a bunch of namespaces.

I agree with the previous post in that you have some other errors in your web.config.

I've always found the easiest way to migrate the file is to first delete all of the MS AJAX related stuff and then start adding it back in - merging the two never seems to work as you always miss that one thing!


berkovitz:

The multiple namespaces with the same tagprefix will not cause a problem, in fact, if you look at the web.config inside of the c:\Windows\Microsoft.NET\Framework\v2.0.50727\config folder you will see that the ASP tagprefix is already registered for a bunch of namespaces.

Yes it shouldn't be a problem. I only have codebehind (designer.cs) problem in the past when the UpdatePanel is moved from Microsoft.Web.Preview.UI to Microsoft.Wen.UI, that needs manual correction.


hello.

i still didn't get the error...what is it?


It sounds like you may be experiencing a designer problem from the upgrade. I suggest you try deleting all of the files in:

C:\documents and settings\[username]\Application Data\Microsoft\VisualStudio\8.0\ReflectedSchemas

Wednesday, March 21, 2012

XML Script inside UpdatePanel: Not instantiated?

I have a bit of XML-Script (which assigns a Drag/Drop handle behavior to a control) that performs as expected. However, if I place this script inside an UpdatePanel then the script doesn't run. Is this a known issue? Any known workarounds? If not, can anyone provide me with insight on how the AJAX libraries identify and parse XML-script? E.g., Is there a function I can call that will reinitialize XML-Script blocks? Note: I can put a <script type="text/javascript" /> in an UpdatePanel and it'll execute as expected.

Jeremy

Bumping this thead. Any thoughts? Let me know if I need to clarify the request. The obvious work around is to just wire up the features using imperative syntax via Javascript, although this seems like a pretty obvious issue so I want to make sure I'm not missing something.


Can you please post the code you are using so I can take a look at it? Thanks


I later discovered that this functionality was by design and that any script (not just XML script) will not re-execute upon refresh of an UpdatePanel. There are a few work arounds posted for this on the internet which involve registering the script, probably via RegisterClientScriptBlock() or something similar. The approach didn't work for me, however, and I haven't had a chance to dive into this further yet. When I get a chance I will revisit this and post code samples and/or findings.