473,785 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Serialization the class from a webservice request

Hi,

I'm using .net 1.1 and have a web reference to a 3rd party.

What I'm attempting to do is when I get a "failed" response from the
webservice (that's inserting some data or doing something else) I want
to serialise the response object to disk.

So for instance in reference.vb I have the lines
<System.Web.Ser vices.Protocols .SoapDocumentMe thodAttribute(" http://....
yada yada yada", RequestNamespac e:=".... yada yada yada",
ResponseNamespa ce:=".... yada yada yada",
Use:=System.Web .Services.Descr iption.SoapBind ingUse.Literal,
ParameterStyle: =System.Web.Ser vices.Protocols .SoapParameterS tyle.Wrapped)>
_

Public Function TestDatabaseExi sts() As Result
Dim results() As Object = Me.Invoke("Test DatabaseExists" ,
New Object(-1) {})
Return CType(results(0 ), Result)
End Function

<System.Xml.Ser ialization.XmlT ypeAttribute([Namespace]:="http://....
yada yada yada")_
Public Class Result

'<remarks/>
Public ResultType As ResultType

'<remarks/>
Public Message As String

'<remarks/>

<System.Xml.Ser ialization.XmlA rrayItemAttribu te(IsNullable:= False)_
Public Errors() As [Error]
End Class
So If I call the TestDatabaseExi sits function I get an object back of
type Result. So what I want to do is write the serialized Result
object to disk. Attempting to do so throws the error;

The type WSIntegration.R esult in Assembly WSIntegration,
Version=3.1.313 4.15657, Culture=neutral , PublicKeyToken= null is not
marked as serializable.

So I change the line

<System.Xml.Ser ialization.XmlT ypeAttribute([Namespace]:="http://....
yada yada yada")_
Public Class Result

to

<Serializable() ")_
Public Class Result

and it does work!!!! ... but I don't wan't to start altering the
reference.vb and for some reason it doesn't work for all the classes
defined in the reference.vb

Can anyone suggest an alternative way of letting me do this or give me
some advise?

Thanks.
Steve.
Jul 31 '08 #1
0 1203

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2960
by: uAsking | last post by:
I'm building a client side application that uses webservices. In the client application I'm inheriting from basic types used by the webservices, so the wevservice provides the classes and sets all the serialization attributes for them. The classes are in a very basic structure with a Single object that contains two other objects. I inhert from them and add a function with converts the object returned from the webservice into my object...
0
1379
by: vthakur | last post by:
Hello: I have generated a c# proxy (client) from the WSDL. One of the class has a defaultValueAtribute. Like so: public class PersonInformationLoadRequest { public string DataSource;
0
2343
by: psy000 | last post by:
Hi, I have a C# web service client that talks to a JAVA application sever. I use AXIS to generate the WSDL file, use wsdl.exe to generate proxy stub c# code. When I try to use c# client connect to application server, I did not get the result in the C# client side, I used a soap monitor to look at the SOAP messages that were exchanged, I can see server returned a correct SOAP message, but the C# client failed to deserialize the XML...
5
2831
by: francois | last post by:
First of all I would to to apologize for resending this post again but I feel like my last post as been spoiled Here I go for my problem: Hi, I have a webservice that I am using and I would like it to return an XML serialized version of an object.
2
1331
by: Sergi Adamchuk | last post by:
I need determine which web service (class WebService or its inheritors) serveces current request (I need Type instance of class that serves request). For example you wrote your own WebService: public class MyService : WebService .... Now I need to know the Guid of WebService class that serves current
8
3470
by: ashoksrini | last post by:
Hi All, I have the below requirement and would like to get some feeback from the group on the best way to implement: 1. I have WSDL defined exposing few web services. 2. We dont have a requirement to have a server web service class. (reasons below) 3. I want to develop something like this - when client makes a web service call, on the server I can intercept the SOAP message (XML doc itself),
2
2485
by: Angelos Karantzalis | last post by:
Hi y'all, we're using a bunch of classes in a project, that we wanted to convert to-from xml easily. So, we defined XmlAttribute annotations for our class members and all worked fine. The Xml stream came from an external source with a custom xml schema, so we had no alternative. However, along the way we came to the point that we must expose those classes as return types for a web service. Returning an instance of a class through the...
3
5084
by: Michael Hoehne | last post by:
Hi, I'm currently facing a problem with a mixed environment using .NET 1.1 and ..NET 2.0 web services. We have a client application (the "client", system 1) running on .NET 2.0/WinXP, calling our web service (The "Web Service Server") running on a separate machine (also .NET 2.0, Win2003 Server, system 2). The web service server (system 2) itself makes calls to methods in the CRM
0
2334
by: hic78 | last post by:
Hi, I use a proxy class to invoke web service developed in SOAP/Java: using System.Diagnostics; using System.Xml.Serialization; using System; using System.Web.Services.Protocols; using System.ComponentModel; using System.Web.Services;
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.