Passing Objects Between WCFs?

May 20, 2011

I have an ASP application, which calls an HTTP WCF service, which calls a TCP WCF service (all on different servers). I'm ultimately trying to pass one class object between the three.I've discovered that I can't do this directly in the HTTP WCF, even though my class object is defined identically in BOTH WCFs. Like this:

Public Function CallOtherFunction(ByVal ThisClass as MyClass)
Dim RetVal as Boolean
RetVal = CallMyOtherWCFFunction(ThisClass)
End Function

Instead I have to:

Public Function CallOtherFunction(ByVal ThisClass as MyClass)
Dim RetVal as Boolean
Dim MyOutgoingClass as MyOtherWCF.MyClass

[code]....

My objects are rather large, to say they have a lot of properties. Any way to not have to declare a new variable in my calling function?

View 1 Replies


ADVERTISEMENT

Passing Objects Between Forms?

Aug 11, 2010

I'm translating a document management application from vb6. I want to program with good habits and technique, so I'm asking for your opinion really rather than just a solution.I have a decent understanding of OOP, but I'm not very experienced in VB at all. What I'm doing now is trying to figure out the best way to pass objects between forms.For example, in my initialization form, I have an object that stores a group of database connections. I need to pass this object around because reconnecting takes a significant amount of time. There are other objects such as user info and permissions.

Public Class Form 1
Dim DB = New DBobject
Public Sub Form1_Load

[code]......

View 5 Replies

Passing Objects To Methods?

Jun 26, 2010

I always thought I understood how this works...but lately I have started really using interfaces and now things arent doing what I am expecting.

using entity framework, I have a service for each object that is responsible for interacting with the database and such....on my one service I am passing the collection of objects to my service as an icollection(of contactinfo) before I pass the object, the changetraker has the right states. however in my method, this is not the case and all states are set to unmodified.

Private Sub SaveExecute(ByVal param As Object)
Dim srv As Services.ContactInfoService = GetService(Of Services.IContactInfoService)()

[Code]....

As I said above the Me.contacInfoCollection has the right changetracking states. But Once its passed to the srv.savechanges it reverts to unmodified. I am sure its something silly I am missing...the whole EF thing can be confusing to me...

View 2 Replies

C# - Passing Objects Into Constructor Before Initialized?

Jun 12, 2011

I have the following problem. This is a simple example of some classes I have (each have dependencies on other classes).

public Class1()
{
public Class1(Class2 class2)[code].....

The problem I have is that the assert is always null, even though class1 has been initalized. One condition I do have is that I only want there to be one instance of each class created.

View 3 Replies

Passing An Arraylist Of Objects From One Class To Another?

Aug 19, 2011

I have the following code in Class B

FolderList.add(FolderCategory)

when i do a count it display a list of 25 items in the folderlist.Now i have a main class when i tried to use the following method

Dim MainClass as New ClassB

Console.writeline(MainClass.FolderList.count()) the value reflects as 0 items meaning is empty.i need to retrieve the arraylist from Class B using the MainClass to retrieve those items inside the arraylist.

View 7 Replies

Passing Serializable Objects Through Sockets?

Jul 16, 2009

I have no idea where to begin. I've looked online but haven't been able to find anything.

View 1 Replies

VS 2010 Passing Objects And Sessions?

Aug 21, 2011

I was wondering if someone could tell me if this is "bad practice" or is a perfectly acceptable way to pass an object to another form.I've cut out a lot of the code to summarise what im asking.

[Code]...

Dim myRetrievedObject as myObject = Module1.returnSavedObject()Is this a acceptable way of passing an object between forms or is it a completely bad idea?Ideally i would like to be able to "add" further objects to the initially created object in Form1 but then on reloading of Form1 , retrieve the new version of myObject with the newly added objects within the myObject class.My initial thinking is this creates an almost session like state for the initial object. So you can use the same object over all 3 forms or more and just simply add to it like a shopping cart type of functionality.

View 10 Replies

C# - Preferred Techniques For Passing Objects Which Clients May Invalidate

Jan 31, 2012

I have adopted a technique where I pass existing objects to forms so that they can display the object's content and allow the user to alter it if necessary. The form is not bound to the object, so when it comes time to act, the form sweeps up the content of its controls and puts them into the object. The object is then validated and any issues reported to the user. If the object is valid, it may be handed back to the caller so the caller can refresh a view/list/etc.

So far, so good. However, if the form's content, or lack of, creates an invalid object and the user does not correct it, maybe cancelling the form, there's a chance the form will hand an invalid object back to the caller. This is not good.

Essentially I'm looking for an elegant and efficient way of either leaving the object as it was or rolling back if the user cancels the form/action.

I have considered a range of techniques, each with many pros and cons. I'm keen to consider some other views.

View 3 Replies

Call Method Base Class In Program Passing Sub Class Objects?

Apr 22, 2012

Base class has one field to hold numeric balance value. With 2 methods that accept arguments for adding and subtracting the new input calculating new balance. Sub class has four fields dates, transaction, memo and amount.I have a deposit form, and withdraw form. Each time one transaction is entered it creates an object with sub class fields, then adds to the account collection. My problem is not understanding how to call the deposit/withdraw method and pass the current transaction amount back to the base class to alculate the new balance. Does anyone have any links to information/tutorials on how to perform something like this? As you can see with my code I have tried various different approaches without any success.

[Code]...

View 5 Replies

Make Objects From The ToolBox Using Code Instead Of Changing Existing Objects Invisible Then Visible Later?

Dec 5, 2011

make objects from the ToolBox using code instead of changing existing objects invisible then visible later?

View 7 Replies

Sql - Error The SqlParameterCollection Only Accepts Non-null SqlParameter Type Objects, Not Int32 Objects?

Jun 23, 2012

I am getting this error, Not sure why it is happening "Error The SqlParameterCollection only accepts non-null SqlParameter type objects, not Int32 objects."I have tried with all sorts of possibilties, now try to enter default data as dummy data,

Using connection As New SqlConnection
connection.ConnectionString = ConfigurationManager.ConnectionStrings("DentalDeviceConnectionString").ConnectionString
connection.Open()[code].....

View 1 Replies

Modifying Objects Inside For Each Loop Sets Properties Of All Objects With Values Of Last One?

Jan 29, 2011

I have a program like this.

Module Module1

Public Class Mstr
Public Property Prop1 As String
Public Property Prop2 As String[code]....

But it is not working as I expect it to. You can see it from.The DtlsB properties of all three DtlsA objects are having values from last iteration.

View 1 Replies

Random Objects - Let The User Input Objects To A Richtextbox 1 Object On Each Line?

Jan 6, 2011

I want to let the user input objects to a richtextbox 1 object on each line, and somehow use Random.Next to select pseudorandomly a few objects, the number 'few' inputted in a textbox.

View 9 Replies

The SqlParameterCollection Only Accepts Non-null SqlParameter Type Objects Not String Objects?

Jan 18, 2012

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Using conn As New SqlConnection("Database=Clinic_Management_System;Data Source=.SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|Clinic Management System.mdf")
Dim cmdRecord As SqlCommand

[code]....

View 2 Replies

VS 2008 Inherit ListView - Dispose Of Two Objects When The Form's Disposing Of It's Objects

Feb 7, 2010

I have a user control that inherits the FW ListView and I need to dispose of two objects when the form's disposing of it's objects. Here's what I've concluded already, am I on the right track?

[Code]...

View 3 Replies

Child Objects Raising Events In Parent Objects?

May 1, 2009

long story short, I have created a ListView type control, using UserControls for the parent control and the ListViewItems. Most the of the control is written and works fine, right up to the point where I tried to replicate the 'Control.SelectedItems(0).Index' property and the 'SelectedIndexChanged' event.

Each child object knows its index value, and could pass this value via the SelectedIndexChanged event (assuming this is how it works in a normal ListView control -- user clicks on an item, and that item fires an event updating the selected index value in the parent object).

How does the child object raise an event in the parent object? I have a feeling this could be done with Delegates, but I'm still learning about their usage.

View 1 Replies

ASP.NET Cast ArrayList Of Objects To Custom Objects?

Aug 9, 2011

getting the following error Unable to cast object of type 'System.Object[]' to type 'OrderService.webdirect_WebLinesRow[]'. On the line

webdirect(web_companyID, web_locationCode, web_customerNumber, web_orderNumber, web_orderReference, web_orderDate, webLinesArray.ToArray(), o_Company, o_LocationCode, o_CustomerNumber, o_OrderNumber, o_OrderStatus, o_OrdDescrip, webRespArray)

I created the webLinesArray.ToArray() array as such

Dim webLinesArray As New ArrayList()

Am I missing an additional cast or something ?

View 1 Replies

Compare Two Objects To Check If All The Properites Of Both The Objects Have Same Value Or Not?

Aug 28, 2008

I want to compare two objects to check if all the properites of both the object have same value or not. for this i need to use the reflection to enumarate through all the properties of an object and check the value of the property. To try the code just i have written a Employee Class having Two Properties EmployeeNo and EmployeeName. I am creating an object of the Employee class and need to write a function that can list the values of all the properties in the class.

[Code]...

View 2 Replies

Bind Objects With Nested Objects?

Jul 21, 2009

I am tring to bind a class to a form where the class contains other class variables. For example:

Class Character
Private _name as String
Property Name as String

[code]......

View 5 Replies

Array Of Child Objects In Nested Classes And Accessing Child Objects In .Net

Jan 3, 2012

I have a nested class, let's call it class1 and it has class2 inside it; VB.Net eg:[code]

1) How can I define X number of Class2 objects[let's call it: Node(x) array]** with NEW() subroutine called?' this raises error: dim cls2(n) as new class2 end sub.

2) How can I return actual number of Node() array? [code]Outside my class in main project I define cls1 object:[code]Now an array of class2 is created inside cls1.

3) Now,How can I access All of them[node(x) array which is created inside cls1] with all properties and methods available?

I remember I wrote a ProcessManager class with this functionality in .net 2003, nearly 4 years age, I don't have the code now.

View 1 Replies

Multithreading - Create Custom Objects/list Of Custom Objects In .NET?

Jan 24, 2010

I need two seperate lists, which every item is Integer, String, Bitmap - and one which every item is Integer, String String. However I don't know how to do this, or even where to look - I've googled for custom objects and custom object lists. What I'm trying to do is this.Custom Object1 is Integer, String, Bitmap Custom Object2 is Integer, String, String

In one thread I'll be adding items to List1(Of Object1), and processing them, and adding the results to List2(Of Object2), however I need to be able from other threads to look at the list and say only give me the items where Integer = (my thread ID), is this possible? Any help, or even links to information that would be relevant to this request would be helpful?

View 2 Replies

Can Objects In Objects Be Persistent

Dec 15, 2009

[Code] I want that once I put something in the BigCollection it stays there, I don't want it to be changeable from outside. I want to be able to clear the SmallCollection but it should not be cleared in the BigCollection. Any Ideas?

View 1 Replies

Casting Objects To Other Objects?

Feb 6, 2012

Firstly I need somebody to explain a bit of code to me, I'm a massive newbie at programming so I need an in depth explanation.

Private Sub Box_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Dim C As PictureBox = CType(sender, PictureBox)

[code].....

View 2 Replies

Passing A Value From Vb To Php?

Apr 30, 2012

I'm trying to pass a value from Vb to PHP. So far I have used public property to pass a string value to one form to another

Public _passedText As String
Public Property PassedText() As String
Get

[code]....

I would like the same value to be passed to a php file is this possible?Also I'm using WinForms?

View 2 Replies

Argument Passing In C# And .NET?

Jan 14, 2012

In VB.NET, can we pass an original object as an argument without instantiating it? For example, I have two forms in my project formA and formB. Now I have this code.

[Code]...

Apart from this, in VB.NET in any class like formA, if I type formA, I can see all the objects and controls present there but not in C#. Again, I have to make a new instance to see all the controls. This becomes a problem if I want to manipulate two running and working instances with each other. So what basic thing am I missing here?(I am an amateur programmer migrating from VB.NET to C#. Things are going nice and clean expect for the ones I've recently figured out.)

View 3 Replies

Asp.net - Passing Value Doesn't Appear?

Jun 21, 2012

the code on select.aspx.vb are

Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Configuration

[Code]....

I am trying when select Listbox with ID="lstAuthor" the label box will pass the value but it failed to show.

View 1 Replies

Passing 2D Array To C Dll ?

Aug 3, 2009

I am trying to pass a 2D array into a dll I wrote in C. When I run the program, it crashes at the first line (in the dll) that I try to read the array. It gives an error that it is trying to read protected memory. I'm guessing this means the array was not correctly passed to the dll, so the program is trying to read a memory location that doesn't exist. Is the problem somewhere in my VB code? If not, it must be in my C code, right?

Here is my VB code:

Declaration of the function in the dll:

Code:

Private Declare Function image_processing Lib "image_processingDLL.dll" _
(ByRef image_array As Long, ByVal dpi As Long, _
ByVal xDim As Long, ByVal yDim As Long) As result
Calling the function:

Code:

Call image_processing(hImgArray(0, 0), hImage.HorizontalResolution, _
hFilmPictureBox.Width, hFilmPictureBox.Height)

View 5 Replies

Passing A File From WCF To WCF

May 9, 2011

I have a pdf on one server I need to pass on another server. Both have WCF's published to them.On the 'serving' server, I have the following code (thanks antisanity!):[code]But I have no idea how to actually write the file on my 'receiving' server. I've been playing with System.IO,[code]

View 2 Replies

Passing A Parameter Containing '&'

Feb 16, 2012

I am calling a crystal xi report from a windows form and passing 2 date parameters and a customer name. In some cases this customer name contains '&' eg Brown & Williams

In these cases my report fails and errors. if the name doesn't contain '&' it works. How can I pass the parameter with a & in it ?

View 2 Replies

Passing A Process To A Sub

Mar 23, 2010

I'm writing a program to control another program using redirected input and output. This is a simple sample of what i want to do that works. But since I'll then be adding other commands and waiting for other responses like username: then password: then. I'd like to put the "wait for" and "send" sections in sub routines. My problem is somehow I'd have to pass a reference to the process or at least sIn, sOut and sLog to those routines and I don't know how. Do I dim the process as global or???

[Code]...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved