.net - Generic .Net Web Services?

Jul 15, 2009

At the moment we're are considering writing a number of .Net web services to export/import data between sites. There are various different types of data involved, relating to multiple database tables. I could write various web services to receive the data being sent, for example

ImportSomeRecord(field1, field2, field3)
ImportSomeRecord2(field1, field2)
ImportSomeRecord3(field1, field2, field3, field4, field5)
and so on...

There could be about 40 of these services, and it's also possible that the fields may change i.e. new fields may be added. The client would be a VB6 application that would call the remote web service, and let that web service update the remote database. The web services will be written in VB.Net 2008.

Would it be advisable to replace all these web services with a single generic service e.g. ImportRecords(recordtype, blobofdata). I think this can be done in theory by just passing an XML string as the blob of data and letting the web service unravel this depending on the record type, but is there actually any advantage to this, and is it good practice to do so? I've read somewhere that passing XML chunks in this way, as a single parameter, isn't recommended, and I can see this also seems to be somewhat contrary to standard web service usage in that in effect I'm bypassing the web service definition.

View 2 Replies


ADVERTISEMENT

Is There A Concept Of "Generic Structure" Similar To Generic Collections, Generic Classes

Dec 16, 2009

We have migrated our Vb6 application to VB.NET using a third party tool. Now we are in a process of Refactoring and introducing object oriented concepts in the application.

In VB6, we were using structures in many places. As a part of introducing object oriented programming,

1. is it a good idea of changing all Structures to Classes? or Is there a concept of "Generic Structure" similar to Generic collections, Generic classes?

2. Can some one guide me any source containing guide lines or best practices for applications that are migrated to VB.NET from VB6 and implementing object oriented programmaing.

View 3 Replies

.net - Can A Generic Version Of A Derived Class Override A Base Method Using The Generic Type

Apr 13, 2012

Consider:

Public MustInherit Class Column
Public ReadOnly Property ReturnSomethingUseful() As Object
Get
'return something useful

[code]....

But this gives the following error:

Public Overrides Function ParseValue(sValue As String) As Boolean'
cannot override 'Public Overridable Function ParseValue(sValue As String) As Object'
because they differ by their return types.

I accept that you can't do this, but I'd like to be able to preserve the semantics of what I'm. trying to do, which is to have an untyped version that deals with Object, but a typed version in derived classes that knows about the specific type T.

View 2 Replies

.net - Determining A Generic Type At Runtime In Non-Generic Class

Aug 14, 2010

I have a Journal that records entries for different types: Journal(Of ParentT)

[Code]....

View 2 Replies

Construct A Generic Interface Class With Generic Functions

Nov 25, 2011

I am trying to construct a generic interface class with generic functions. My goal was to use this to implement multiple worker classes for database interaction that have the same basic functionality. Each class will deal with different object for example, category, product or supplier but unless the the functions in the interface are generic that this won't work.This is the interface code that I have but I don't know if I have done it correctly. [code]

View 2 Replies

What Is Ado.net Synchronization Services And How To Use These Services

Mar 14, 2009

What is ado.net synchronization services and how to use these services

View 1 Replies

.net - Creating A Generic List Of A Generic Type

Jun 30, 2011

I am trying to create a list of a generic type in vb.net 2.0 framework.
This is the generic type definition:

Public Class GenericParamMap(Of T)
Public Sub New(ByVal pParamName As String, ByVal pPropValue As T)
mParamName = pParamName

[Code]....

The compiler does not allow a "T" in the method's parameter because it's not defined, but I'm not sure how or where to define it. I thought it was okay to have a generic method definition.

View 2 Replies

Generic Cannot Instantiate Instance Of The Generic Type With New?

Feb 8, 2012

I am trying to write a generic method, to avoid code duplication, which will create or activate a Form as an MDI children, based on its type. But I have to lines in error (see comments).

[Code]...

View 4 Replies

VS 2008 Accessing Something With A Generic Generic?

Jun 19, 2012

If i have an object that implements an interface (and don't know the exact object) i can call a sub (DoSomething) by going:

vb
Dim iObj = trycast(something, iInterface)
if iObj isnot nothing then
iObj.DoSomething()
end if

How can I do this for a Generic? such as...

vb
Public Class TestClass(of T)
Public sub DoSomething()
....
end class

View 2 Replies

Multithreading - Modify A Generic Invoke Method To A Generic BeginInvoke Method?

Oct 7, 2010

I have been using a pretty slick generic invoke method for UI updating from background threads. I forget where I copied it from (converted it to VB.NET from C#), but here it is: Public Sub InvokeControl(Of T As Control)(ByVal Control As t, ByVal Action As Action(Of t))

[Code]....

View 1 Replies

Overload Operator In Generic Class With Generic Interface Of Super Class And Inherit Class?

Jan 21, 2010

I can do this without problem.

Class A
End Class
Class B : Inherit A
End Class
Dim Obj1 As A = New B

View 4 Replies

.Net Exchange Web Services?

Aug 31, 2011

I created an application using the Exchange Web Services, everything works fine, but after running 3 or 4 times, I suddenly get the error:

There was an error downloading "whatever/ews/services.wsdl"The remove name could not be resolved:There was an error downloading "whatever/ews/services.wsdl/$metadata"That gets me is its working find for a while, then it just stops working. I do an update and get the error. wait a little longer, try to browse it through browser and it prompts me for a user name and password, even though I checked the box "Remember".

View 1 Replies

Accessing Services Using WMI

Nov 12, 2009

I am trying to access a remote 2003 server using WMI. I can connect but when I try things like listing the services for that server I get the following: Access is denied. (Exception from HRESULT: 0x80070005(E_ACESSDENIED). Using the same code, I can connect and get a list of services a remote 2008 server. Here is the code to connect to the server (which gets me connected):

[Code]...

View 1 Replies

Consuming Web Services In .NET?

Feb 19, 2010

I am testing web services in .NET for the first time. I am almost there, but I can't seem to consume the web service. I know this post is similar to about 5-6 other posts on this site, but I have reviewed them, and still can't get the syntax correct.So far, I have:Create a simple web service that creates a directoryWorked in development environment, but took some trouble shooting to get to work on live server I can pull up the "automagically" generated .NET we service page.Added web service reference - can now see the reference in my solution explorer and in intellisense.

[Code]...

View 4 Replies

Ews (Exchange Web Services)?

Jun 12, 2009

I'm looking at using ews to move new emails to a sub folder and download attachments to a network drive. I was wondering if anyone had any experience with this particually using VB.net but all and any advice?

View 1 Replies

Using Ews (Exchange Web Services?

Mar 11, 2009

I'm looking at using ews to move new emails to a sub folder and download attachments to a network drive. I was wondering if anyone had any experience with this particually using VB.net but

View 2 Replies

VS 2008 WCF For Web Services?

Oct 18, 2010

I am .net windows programmer and new to web services.I want to start with web services using .net.Should I directly jump to WCF. What was there for developing web services in .net before WCF. Is there more to web services than WCF ?Basically I need some guidance to start such that I get to know the concepts as well as start developing web services using latest .net classes.

View 3 Replies

VS 2010 Web Services / WCF?

Jul 13, 2010

many posts about the security risks of app.config file...ncrypted or not... for storing the connection strings of a remote database.OK! I agree with this... but... how can i make a VB.NET Application to connect to my database thru WebService or WCF as long my server is Centos with MySQL ? How can i make the connection strings of MySQL Connector to work with WebServices or WCF ? I did not find any solution for this problem.

View 1 Replies

Web Services For Dummies

Mar 9, 2009

I'm mainly a VB6 developer, but am currently trying to write a web service using VB.Net to allow for communication between our product and a third-party. The third-party software will invoke our web service to update various data.I've read up various things on how to do this, and have successfully generated a prototype web service. What I'm now concerned about is how to do this properly. Our clients want us to provide the WSDL and XSD for our web service, so they can implement it on their end, so I want to make sure I get it right. Therefore, I have the following assumptions/questions:The web service will receive various fields that should be updated. To keep this flexible, I thought that this could be a single XML parameter. I'm guessing this is why our clients want the XSD. Is this assumption correct? Is it good practice to pass an XML input parameter?I created a simple class with a sample of the fields that should be updated (Title, Address1, Address2 and so on) then generated an XSD from that using XSD.Exe. This made me think - should my input parameter be an instance of this class, rather than an XML document based on the XSD?

For example, the fields to be updated relate to client data. There are many possible fields that can be updated, but only a few will probably be updated at a time. Clearly, I don't want a method with 40 parameters for each possible field, and I was also asked to only provide a single method. My idea was therefore to have a parameter naming the fields to be updated, and their values. It seemed sensible to use XML for this parameter. My assumption regarding the request from our clients for the XSD came about so that we can make sure that the XML parameter will only include valid fields. But at the same time, I generated an XSD using Visual Studio based on a sample class I created. But now I'm not sure which is best to use i.e. either:

a) XML: cliData As Xml.XmlDocument: Appears in WSDL, but how would I generate an XSD to make sure the XML is valid? Manually?

b) Class: cliData As ClientData: Serialised in WSDL so each field appears as a separate element. Presumably no need for an XSD, but I don't think this gives me the option to only includes a few fields, and isn't this equivalent to having loads of parameters?

c) String: cliData As String: Pass in some sort of string, unravel it manually, but then no validation.

I initially planned to return the status of the web service (e.g. "OK" or some failure message), though I've seen reference elsewhere to SOAP Faults. There were some links to an MSDN article discussing this, but the links seemed to be broken.

View 3 Replies

Web Services Not In Assembly

Jun 9, 2012

I've converted a 2005 project to 2010. As I was debugging some issues I noticed that my compiles didn't seem to change anything so I deleted the bin directory and recompiled. Now all of my Web Services "ServiceName.asmx.vb" are no longer in the assembly and when I try to run them in the debugger, I get the following error:

Could not create type 'MyWebService.MyNamespace.MyService'.

I have verified that the Class and Codebehind are correct in the 'MyService.asmx' file.

I have verified that the MyService.asmx.vb file is marked to Compile and that the asmx file is Content.

View 1 Replies

Asp.net - Retrieve Data Using Web Services In .NET?

Jan 11, 2010

How to retrieve data from database using Web services on VB?

View 5 Replies

Asynchronous Web Services Between Different Platforms

Oct 12, 2010

I am writing web services with VB.NET (2.0). The client side will use different technologies such as Java and Siebel. So, if I write asynchronous web services, is it possible for different platforms to consume them? I know it is quite easy with a consumer having .NET platform, but not sure for different platforms. Is it enough for them to have asynchronous ability, or should it be a similar platform?

View 3 Replies

C# - Can Partial Classes Be Used For Web-services

Aug 10, 2010

Can partial classes be used for web-services or there is some other way to implement it ?

View 2 Replies

Check On Several Services To See If They're Running?

May 15, 2011

I need to check on several services to see if they're running on several servers. I would like the program to tell me if a specific service is or is not running and if it is to reply with a msg stating which service is running, same if it is not running.

this is what i have so far:

Private Sub CheckServiceButton_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckServiceButton.Click
' This will check if the service is running '

[Code]....

View 3 Replies

Create A Component Services For A DLL?

Jan 24, 2009

when is the neccisity to create a component services for a DLL.

i ask because , i have a dll and the website runs fine if i just register the dll.
so when should i go for componet services

View 1 Replies

Error With Services References

Jan 11, 2011

I am getting the following error when I add a service references that points to a web service.

'System.ServiceModel.XmlSerializerFormatAttribute' is not accessible in this context because it is 'Friend' in the Reference.vb file.

I have not gotten it in other projects that I have done that point to the same web service. I have recently add some code that I downloaded and cleaned up the errors in to my project and this seems to be what broke it. This code uses several new features that I am not familiar with, mainly the "Friend" declaration and also uses name spaces in the code it self. Also I converted the code from C# using an utility that I downloaded, that untility was not 100% in it's conversion, hence the clean up that was needed.

View 2 Replies

Have To Write A GetRetailerContext For Each Of The Web Services?

Aug 12, 2009

<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:EN-GB;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->

I am working on a system that calls several different web service to integrate in to a 3rd party system. each one of these web service contains a object called RetailerContext which is a type of security object that is required to get and set data.

My problem is the example code I was give in a document says you should crate a function called GetRetailerContext that set up the object for you, but because the object is defined in each of the web services that I have referenced the compiler tells the that RetailerContext is ambiguous. is there a way round this or do I have to write a GetRetailerContext for each of the web services?

Private Function GetRetailerType(securityInfo) as RetailerContext
Set up object
End Function

View 1 Replies

Hosting A WCF In Windows Services

May 10, 2011

I have a working WCF, it is written in VB. I need to host it in Windows Services on a remote server. I cannot use IIS (they uninstalled after I had it installed). Specs are to host in Windows Services, the only way I can get around that is to quit.

[Code]...

View 1 Replies

Hosting Of WCF And Windows Services?

May 9, 2011

I've created a WCF service and, with help of others from this site and the department I work in, the WCF service is running as a service on my development machine. Tested it with a console app and it works.But, it's not supposed to be on my development machine. It needs to be on a different server.This is difficult because the server it is supposed to reside on DOES NOT have Visual Studio installed on it.So I cannot run the VS 2008 Command Prompt with installutil to run the WCF service as a service on that server.

View 3 Replies

How To Control Windows Services

Sep 27, 2008

i want to make a simple application to stop or start the Services in Windows XP. I'm using Vb.net 2005. I've googling and find that I should use "System.ServiceProcess.ServiceController". Does anyone have example for this?

View 2 Replies







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