C# - Refactor Data Contracts In WCF Services?
Feb 11, 2010
We have lots of WCF services that are only used by our own code; the code that uses them is mostly in the same solutions files that contains the services.
However they do not use a shared assembly for the contracts, so each time a data contract is change the reference to the service has to be updated by hand in all projects that use the service. (Then the code needs to be fixed up by hand)
So how do I do a simple refactoring like renamed a data item in a data contract?
Is there a way to update all references to services in a single solution with one command, rather then having to click on each reference in each project?
View 2 Replies
ADVERTISEMENT
Dec 20, 2010
I want to add DataMember attributes for the properties in a class Is there any way to automatically add the attribute maybe some refactoring tool
View 4 Replies
Jan 20, 2012
I have a class with a static list of keys, and I have a static method called Remove() that removes a key from that list.Now what I understand from the contracts post conditions is that as the programmer of the class, I guarantee that the current public method does something specific, in this case : removing the element of the list.
Here's what I've written:
private static List<Keys> m_usedKeys; // private list of keys
public static void Remove(Keys _key)
{
[code]....
What I'm trying to "Ensure" here, is that the Remove() method removes the key for real from the list (Yes this might be a trivial example, but I get the error there.)when I write the Contract.Ensures() line, VS2010 gives me the following error :
Error 3 Detected expression statement evaluated for potential side-effect in contracts of method 'LibJungleTimer.KeyBind.Remove(System.Windows.Forms.Keys)'. (Did you mean to put the expression into a Requires, Ensures, or Invariant call?) C:UsersJoelDocumentsProgrammationJTJungleTimerLibJungleTimerKeyBind.cs 51
I think this error says that the expression m_usedKeys.remove(_key); has a potential side-effect. In fact, it has a side-effect, it removes a key from the list!If I try to write something like this instead :
Contract.Assert(!m_usedKeys.Any(x => x == _key));
well it compiles fine.
View 1 Replies
Jan 11, 2010
How to retrieve data from database using Web services on VB?
View 5 Replies
Jul 31, 2011
Im using linq and im able get get data ouf of it realy easy. but i seem to not be able to update the data. the program does not error on it and it looks likes it has updated but it does not save te changes.
Public Function UpdateAlarmsbyKey(ByVal objKey As Integer, ByVal IdNumber As String) As Boolean
[Code]...
View 1 Replies
Jul 30, 2008
I downloaded and installed Refactor. The install worked fine and Refactor works in VS 2005. However, I also have VS 2008 installed and I cannot get Refactor to appear in that IDE. Is there something I need to do to get Refactor to appear in VS 2005 and VS 2008 on the same machine?
View 7 Replies
Feb 1, 2011
This is a simplified version of a class that I have in my project. Since the Bonus is figured the exact same way in each function I want to remove the obvious code duplication that appears here and make the three different functions into one. However I am not sure how to provide the argument that this new function would require.
For instance I am currently just passing the argument like this from code
lblVolumeBonus.Content = TestClass.VolumeBonusAmountStore(bonus).
I think I have to basically turn this logic around and call it with something like
lblVolumeBonus.Content = TestClass.VolumeBonusAmountStore(BonusTrackerBO.StoreBonus)
but I am not sure of the correct syntax or whether I am on the right track at all.
Public Class TestClass
Public Shared Function StoreBonus(ByVal bonus As BonusTrackerBO.StoreBonus) As Double
[Code]....
Edit: It may not make a difference but I should have made clear that there are other factors in the equation (I was just trying to keep it simple). So is the answer the same when there are other callbacks to the bonus like bonus.MaximumAmount, bonus.MinimumAmount? There are 5 callbacks to the bonus object and the amounts are different depending on whether it is a Store, District or Company asking.
View 2 Replies
Feb 26, 2008
I was fooling around with the toolbars and noticed the Refactor section. So I made a toolbar with all of the refactor buttons and ... they don't do anything.I don't often customize so maybe I'm missing something.
View 6 Replies
May 26, 2010
It looks like they are converted to regular date types in the generated proxy object.I'd like to optionally pass null values for these dates.Other than switching to WCF (no time to learn it right now), what is the best way to handle this situation. It looks like I also cannot pass NULLABLE date types.
View 1 Replies
Oct 17, 2011
I have the following line of code
Dim a As String = ""
And the Refactor suggests replacing the "" with String.Empty
It is a kind of Refactoring but why? Since I am a newbie in the future declarations of mine should I better use the String.Empty ?
View 5 Replies
Jul 17, 2009
how do I refactor all my instance variable to have all the get and set method? I tried RefactorVB but it seems like it can only refactor 1 by 1.
View 2 Replies
Aug 20, 2010
why visual Studio Does not have Refactor tool for vb.net by default ? but it has this tool for c#. for example extract method and etc.
View 2 Replies
Jul 3, 2009
Why doesn't vb.net in Visual Studio 2010 have any Refactor support
View 14 Replies
Jun 27, 2012
I have created a simply Pizza program (for a summer project not education related) that uses check boxes to determine what the customer wants. Basically a simple pizza ordering program.I was wondering as I have used the If statement over and other again for different parameters and variables, is it possible to use multiply arrays to simply the VB Code...I was advised to use Constructors in VB.Net Or is there a more simpler way to go about creating this program...or a better way of programing?What about decreasing the repetition in the code?
[code]...
View 4 Replies
May 26, 2009
Assume you have controls A, B, C, D and E all with a Visibility property. You also have states 1,2,3,4,5 and 6 in which various combinations of your controls would be displayed. Currently this is being handled by switch statements for each state: i.e.
Select Case PageState
case "1"
a.visible = false
b.visible = true
[code]....
As you can imagine, this becomes a pain as every state needs a show/hide statement for each control. How can I refactor this so that adding controls and/or states becomes trivial?My first instinct is to extend the control and add a collection of states that it should display for but this sounds like overkill.
Edit:I was deliberately vague in my question in case this has other implications. In my current instance the "controls" in question are ASP Panels. Does that change anything?
View 4 Replies
Mar 14, 2009
What is ado.net synchronization services and how to use these services
View 1 Replies
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
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
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
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
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
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
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
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
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
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
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
Aug 10, 2010
Can partial classes be used for web-services or there is some other way to implement it ?
View 2 Replies
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
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