Serialization

dotnet framework

    Next

  • 1. Handler for asmx page ?
    On Jun 18, 11:10 am, "Oriane" < XXXX@XXXXX.COM > wrote: > Hi there, > > When I try to access a Web service running on my default Web site, on Vista > and IIS 7.0, I get an error message : "the MIME type is not recognized". So > I guess that the asmx handler is not configured ??? > > Regards There is a chance that ASP.NET is not registered properly with IIS. This has happened to me and I had to run asp_regiis.exe to re-register it. 1. Open a command prompt and go to the Microsoft.Net Framework version directory, e.g. cd C:\Winnt\Microsoft.net\Framework\v2.0.50727\ 2 Run the asp_regiis.exe program with -i e.g. asp_regiis -i Not sure if you have to restart IIS or not Another test is to create a simple aspx web page and see if you can access it. Possibly it will give you a better error message than a web service method does. Ron
  • 2. System.Net.WebException: The underlying connection was closed:
    No, Kevin, I am not consuming my own web service. Another team in our company (intranet) has a web service (also developed in .Net) which we are calling. However, the code snipet above is working. Thank you "Kevin Yu [MSFT]" wrote: > Hi Tim, > > VS.NET generate the proxy class according to the interfaces in the > webservice. Mostly they can work as expected. I think the exception might > have something to do with the webservice itself. Are you consuming your own > webservice or service on the internet? > > Kevin Yu > ======= > "This posting is provided "AS IS" with no warranties, and confers no > rights
  • 3. What is the difference between WCF service and web service
    Hello, friends, Just wonder what is the difference between WCF services and web services? WCF services is a kind of web services, or, web services is a kind of WCF services? Or just two different implementation which basically do the same thing? Thanks.
  • 4. wsdl, disco not found or 'You are not authorized to view the page'
    Hi all I created a custom web service, generated XXwsdl.aspx, XXdisco.aspx and copied them to SP server. I can see the webservice while adding Web Reference. But the system showed the classical error msg 'DISCO, wsdl, XML element not found etc.' I researched and added 'validate=true' in <httpHandlers><add verb="*.asmx"> in machine.config(v1.x) and web.config(v2.x). Now I try and get 'You are not authorized to view this page' after I enter my SP uid and pwd. I have the Admin rights on the account. Actually, I find these 2 error messages on consecutive tries. Anybody got any ideas, pls share. Thanks
  • 5. Extracting Client Certificate fields...mutual authentication
    Hi, Am developing a web service that is gonna be consumed by a client over https. I'm using certificates to get the mutual authentication in place. On the server side, I want my service to be able to extract some fields from the client's certificate. I tested the service using the browser and it works fine...proving that the client IS sending its certificate and is getting authenticated at IIS level. In the web method, I'm trying to access the client's certificate using Context.Request.ClientCertificate.SerialNumber. But this throws an exception saying m_safeCertContext is an invalid handle. A lil examination shows that the call to ClientCertificate is actually returning null. What am i missing? Sinex

Serialization

Postby QnJpYW4gTGluZGVu » Sun, 26 Sep 2004 08:59:02 GMT

I have a Web Service that handles all the logic from my websites.
Part of that logic will be the processing of all the cookies.

What I want to do is pass a structure that I have created:

Public Structure SUserInput
    Public IsPlacement As Boolean
    Public ReleaseID As Integer
    Public IPAddress As String
    Public BrowserType As String
    Public Referrer As String
    Public cCookies As HttpCookieCollection
End Structure

I get the following error:
"The type 'System.Web.HttpCookieCollection' cannot be serialized because its 
default accessor is decorated with declarative security permission 
attributes. Consider using imperative asserts or demands in the accessor."

I would like to know exactly what this means, I have researched it a bit, 
but I would really appreciate if someone could help me understand exactly 
what is going on.

Any input will be appreciated.
Brian

Serialization

Postby RGF2ZSBU » Sat, 26 May 2007 04:46:02 GMT

Is there a way to deserialize en element, say, <elementX\> inbound from a 
webservice to <elementY\> in your code other than using the XmlElement 
attribute tags for each property and such?  I'm using a web service now that 
consumes a web service using one element name but is likely to change and it 
seems like there must be a better way to go than to change all of the 
attributes in my code

Similar Threads:

1.avoiding XML serialization, different WSDL generation, soap serialization

Hello,

I think my problem is interesting for most of developers who wish to
exchange actual business entities with webservices, not just xml stubs.

I can not use XML serialization, when generating wsdl, because some of
transmited entities have only getters. It is required by our framework and
cannot be avoided (to ensure data consistency in most cases).

How do I exchange business entities in that case? I found several solutions,
basically they all imply serializing my classes with soap/binary formatters
and passing parameters as XmlElements, strings or byte arrays. That implies:
    1. versioning problems (but that can be avoided with extra work),
    2. anonymous parametes (any serialized object will be passed as
XmlElement, or any other selected transfer type. Type validation will be
performed only during run time, which leads to bugs).
    3. using XML serialization either way, just ussing "always XML
serializable" format for parameters.

How else could this problem be addressed? Suggestions are very welcome..

regards,
Ramunas Urbonas


2.serialization, deserialization and serialization again?

In my ws I have a method that serializes a simple custom object with some
properties. On the other side, in my aspx application, the object is
received and deserialized nicely by .net.

But the problem is that i don't _want_ .net to deserialize the returning
xml. The serialized xml text is exactly what I want because Im only going to
feed that string into a simple "Xml Web Control" and then attach a
stylesheet file to it. Im a bit new to this but shouldnt this be very very
simple? At the moment Im doing a work-around and serializing the stupid
object _back_ to xml again and something tells me I shouldnt need to do
that? Since its allready there in the soap response i mean ... but thow do I
get hold of it in aspx .net?

Continuing ...

My first approach was to try and make use of the deserialized object instead
somehow but unfortunately the deserialized object didnt actually have
exactly the same structure as my original object. The properties (get/set)
in my original object had been exchanged for simple variables which then
didnt allow me to use this object as a datasource etc. So that approach left
me with nothing. I really dont get this, why serialize and deserialize if
whats left isnt the same as the original anyway?


3.Serialization and de-serialization of types loaded from assembly at runtime

Hi group!

Is it possible to scan an assembly *which has NOT been added as a
reference* for types, and dynamically create instances of the loaded
types?

I have a program, MyProgram.exe, which at runtime uses
Asseembly.LoadFile(...) to load an assembly, MyAssembly.dll. When
MyAssembly.dll is added as a reference to the MyProgram project,
serialization and de-serialization works lige a charm.

However, when I remove the reference to MyAssembly.dll in the MyProgram
project, I get an exception upon de-serialization.

Is there something I can do which is like "adding an assembly as a
reference at runtime"?

The best,
Mogens

4.Serialization and de-serialization of types loaded from assembly a

Howdy,

Yes it's possible and quite simple. Have a look at my short C# example 

private void button3_Click(object sender, System.EventArgs e)
{

	System.Reflection.Assembly assembly 
		= 
System.Reflection.Assembly.LoadFile("C:\\WINDOWS\\assembly\\GAC\\Microsoft.VisualBasic\\7.0.5000.0__b03f5f7f11d50a3a\\Microsoft.VisualBasic.dll");

	listBox1.BeginUpdate();  
	foreach (System.Type type in assembly.GetExportedTypes())
	{
		listBox1.Items.Add(type.FullName);   
		if (type.IsClass && !type.IsAbstract)
		{
			object instance = System.Activator.CreateInstance(type);  
		}
	}
	listBox1.EndUpdate(); 

}
-- 
Milosz Skalecki
MCP, MCAD


" XXXX@XXXXX.COM " wrote:

> Hi group!
> 
> Is it possible to scan an assembly *which has NOT been added as a
> reference* for types, and dynamically create instances of the loaded
> types?
> 
> I have a program, MyProgram.exe, which at runtime uses
> Asseembly.LoadFile(...) to load an assembly, MyAssembly.dll. When
> MyAssembly.dll is added as a reference to the MyProgram project,
> serialization and de-serialization works lige a charm.
> 
> However, when I remove the reference to MyAssembly.dll in the MyProgram
> project, I get an exception upon de-serialization.
> 
> Is there something I can do which is like "adding an assembly as a
> reference at runtime"?
> 
> The best,
> Mogens
> 
> 

5.Binary Serialization - Need Advice on How To Prevent Developers Accidentally Breaking Serializations

Hi all,

We have an object graph that we persist to disk using binary
serialization. The issue that we are trying to find a solution to, is
how to prevent developers from accidentally breaking serialization, by
adding a new object to the graph which is not serializable.

I was hoping to add a Nunit test to our suite which would fail if this
object graph is not serializable.  However, after having done this
once in Java, I realized it is not so straightforward.

(In Java, if your object contains another object which is not
Serializable, it won't fail if the child object is null at time of
serialization.  So our unit test had to use Reflection to iterate over
the public and private fields of the entire object graph to test that
each member implemented Serializable).

I'm wondering if, in .NET there is some easier way to test that the
entire object graph is serializable?  (If the solution is have your
test populate every field with data, and then try to Serialize, we
might as well follow the same model as we did for the Java code).

Thanks for anyone's thoughts on this...
Sam


6. Serialization - DeSerialization - Serialization Issues

7. XML Serialization Vs Breaking Domain/Business Logic Vs Custom Serialization

8. Recursive XML serialization? XML serialization of cyclic objects?



Return to dotnet framework

 

Who is online

Users browsing this forum: No registered users and 62 guest