Jump to content
Xtreme .Net Talk

Mister E

Avatar/Signature
  • Posts

    138
  • Joined

  • Last visited

Mister E's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Use the WSDL tool to generate a proxy class. This essentially does the exact same thing as when you add a Web Reference in Visual Studio -- except that you will now have the underlying .cs file. The command line call to do this might look something like this: wsdl /out:MyWebServiceProxy.cs [url]http://localhost/blah/service.asmx[/url]This will build the "MyWebServiceProxy.cs" proxy file. Include this in your project and then open up the file. You will notice that the constructor looks like this: public Service() { this.Url = "http://localhost/blah/service.asmx"; }You will also notice that this is the only location where the Url is set. So I usually just modify the constructor to look something like this: public Service(string server) { this.Url = string.Format("http://{0}/blah/service.asmx", server); }You can also then wrap the class in your own namespace if you want. From here you can now create an instance of the proxy class with something like the following: MyNamespace.ServiceX service = new MyNamespace.ServiceX("localhost"); service.HelloWorld();You can then set the server reference as needed by creating new instances of the proxy class. All should work well provided that all servers share the same version of the Web Service.
  2. Well, pretty much the only way to do this is to ping networks within a certain IP range and see if you get responses back.
  3. Where in the global.asax are you setting the value to blank? Make sure it is not being overwritten with every page load. Put a breakpoint on the Response.Redirect and check the contents of the Session variable right before you actually redirect.
  4. string input = "this is the string I want to test for red and blue"; Regex regex = new Regex("[Rr]ed|[bb]lue"); foreach (Match match in regex.Matches(input)) { Console.WriteLine(match.Value + " at index " + match.Index); }
  5. You can't update the "inserted" table and since the incoming row is violating the FK constraint it is not going to be allowed to be inserted. Your best bet is to adjust the FK value at the application or stored procedure level. There might be a gruesome hack out there somewhere though.
  6. You need to reference the WSDL file (the "Service Description").
  7. Without testing it I would say you could do a match with the following: >([0-9]|,|\.)+< That will at least get you a bunch of candidate strings. You could use a more detailed regex to filter out other non-matches. Check out The Regulator: http://regex.osherove.com/ It is a great tool for testing regular expressions
  8. Use Regular Expressions
  9. It's probably because the local database only sees the local class instance. It does not know requests are being initiated from a remote client.
  10. Your problem is that you need to place your code in a loop. The "AcceptTcpClient" function of the "TcpListener" class returns a socket for the newly established connection (when a remote client connects). This function waits in blocking mode until a client connects. When somebody connects, you need to pass the underlying socket off to some other process (asynchronously). This will allow the loop to continue to its next iteration and start waiting for a new connection. The original port that you designate for the TcpListener is simply the port that the server listens on to establish connections on other ports.
  11. Looks like you have some problematic code in the "DGSReqDGSApp.OrderSummary" class. You should consider implmenting some error handling in this class as it is what is causing your app to blow up.
  12. Not sure what you're looking for but most websites operate this way and are on all of the time.
  13. A Web Service would suit you fine (and be easy and cheap) but it really boils down to your specific needs. You must remember that web service calls are extremely verbose and bulky. If you are sending large data sets (and lots of them) back from the middle tier you might run into problems. If this is a risk you should consider developing your own light weight communications protocol.
  14. Well, you're not going to decrypt it (you can try, but you will fail). So I guess you can't do much.
  15. If it's in the same namespace it should not matter. If it's in a different namespace then you need to call it with MyNamespace.MyClass.MyFunction
×
×
  • Create New...