|
We are currently investigating the use of SOAP as 'intermediate layer' between some complex modules.
.NET makes it very easy to create a 'Soap DLL' that is activated by IIS. Great.
However, we are considering to use this technology to access bigger server-style applications. These applications typically take several minutes to start up, handle a large amount of memory, and therefore cannot simply be recompiled into a kind of 'Soap DLL'.
Browsing through the Microsoft documentation I found an excellent AtlServer example that seems to do what I need. However, it would be much nicer if we could use the more modern .NET technology for this.
So here are the 'million-dollar'-questions:
- Is it possible, using .NET technology, to make a standalone .exe server-application behave like a SOAP-server via the HTTP protocol?
- Is it possible, using .NET technology, to make it accept SOAP requests via a message queue as well?
- If NO on the questions above, is using the AtlServer a step in the good direction or is ATL a dead-end?
- If YES on the questions above, where can I find good .NET examples on writing such a SOAP server?
Because I'm not sure in which forum to post it, I'll post it in 2 or 3 forums. Sorry if you get this multiple times.
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
Patje wrote:
Is it possible, using .NET technology, to make a standalone .exe server-application behave like a SOAP-server via the HTTP protocol?
Patje wrote:
Is it possible, using .NET technology, to make it accept SOAP requests via a message queue as well?
Yes and Yes. Use .NET Remoting.
Patje wrote:
If YES on the questions above, where can I find good .NET examples on writing such a SOAP server?
Check out COM+ Web Services: The Check-Box Route to XML Web Services
You'll also enjoy Soap MQ Transport, the SOAPTransport Sample.
Good luck!
Ian Mariano - Bliki | Blog
"We are all wave equations in the information matrix of the universe" - me
|
|
|
|
|
Thanks,
So far I succeeded in writing:
- a C# stand-alone SOAP server
- a C++ stand-alone SOAP server
Next steps are to write:
- a .NET C++ class (or example class) that can be embedded in our applications to make it a simple SOAP server.
- a .NET C++ class to do the same for SOAP message queue requests.
Why C++? Well, the applications are all written in C++ and for the time being we like to keep our applications as 'compact' as possible. I mean, not a bunch of DLL's or components lying around, but a rock-solid executable file that simply needs to be copied on the system.
From what I understand from C#, the C# compiler cannot simply create an object file that can be linked with the rest of the application. With C++.NET this is still possible.
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
Have a look at gSOAP[^]. Its a clean, fast way to put a SOAP interface onto C/C++ programs. The server code generated is small and fast enough to be used in embedded systems, and has no nasty dependancies.
So, for gSOAP.
- Is it possible, using .NET technology, to make a standalone .exe server-application behave like a SOAP-server via the HTTP protocol?
Yup, HTTPS too.
- Is it possible, using .NET technology, to make it accept SOAP requests via a message queue as well?
Not directly using gSOAP, but you can create asymetric methods. You would need to create a proxy to get them to/from the SOAP service.
Ryan.
|
|
|
|
|
Thanks Ryan,
I looked at gSoap but because of its GPL license we cannot use it in commercial software. Although a commercial license for gSoap exists, I further looked into the .NET classes and since they are free (but tied to the Windows platform which isn't a problem for us) .NET looks the way to go.
So far I made a successful small .NET .exe SOAP server, and I'm looking further into embedding SOAP logic in our server applications that way.
Thanks anyway for your information.
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
Mark mentioned that I should use the XPathDocument rather than the XmlDocument in my code since I was not writing out XML.
Ordinarily I would agree but in this case I am loading an XML file into an XmlDocument and then re-using that same XmlDocument for another purpose. Would creating another XPathDocument to handle the second use of XmlDocument be better? ta
regards,
Paul Watson
Bluegrass
South Africa
Christopher Duncan quoted:
"...that would require my explaining Einstein's Fear of Relatives"
Crikey! ain't life grand?
XmlTransformer, my latest CP article.
|
|
|
|
|
hi
i am new to .net framework and i want to know if there is any site for .net components like the sites for delphi and bcb vcl components(like torry.net)
thanks
|
|
|
|
|
Hello!
Has anybody used any kind of rebains with .NET and C#?
I've got hundreds of dll's and all have the same base address. I tried with rebase, but I think I'm not using it in the proper way. Any help?
Thanks,
Ivan.
Iván Fernández
|
|
|
|
|
See the NGen Overview. You can also "rebase" during compilation by using the /baseaddress compiler option or set it in the VS.NET project settings, or use the rebase tool.
The dox for rebase are here.
Ian Mariano - Bliki | Blog
"We are all wave equations in the information matrix of the universe" - me
|
|
|
|
|
Hello
I'm porting a Service administrator application written in C++ 6 to .Net C#.
This application install, uninstall, start, stop ... services written in .NET C#.
Everything is ok when installing a service.
My problem is on trying to start a service from my application or from the OS service agent, I get a error saying "Acces is denied".
When I use my old C++ 6 application I can install and start the same service without any problem.
Am I missing any security settings or have you any idea ?
Following a piece of the code I'm using:
[Flags]
public enum ServiceControlAccessRights : int
{
StandardRightsRequired = 0xf0000,
Connect = 0x00001,
CreateService = 0x00002,
EnumerateService = 0x00004,
Lock = 0x00008,
QueryLockStatus = 0x00010,
ModifyBootConfig = 0x00020,
AllAccess = 0xf003F
}
[Flags]
public enum ServiceControlType
{
OwnProcess = 0x010,
ShareProcess = 0x020,
KernelDriver = 0x001,
FileSystemDriver = 0x002,
InteractiveProcess = 0x100
}
[Flags]
public enum ServiceStartType
{
BootStart = 0x00,
SystemStart = 0x01,
AutoStart = 0x02,
DemandStart = 0x03,
Disabled = 0x04
}
[Flags]
public enum ServiceErrorType
{
ErrorIgnore = 0x00,
ErrorNormal = 0x01,
ErrorSevere = 0x02,
ErrorCritical = 0x03
}
[Flags]
public enum ServiceSpecificAccessType
{
QueryConfig = 0x0001,
ChangeConfig = 0x0002,
QueryStatus = 0x0004,
EnumerateDependents = 0x0008,
Start = 0x0010,
Stop = 0x0020,
PausContinue = 0x0040,
Interrogate = 0x0080,
UserDefinedControl = 0x0100,
AllAccess = 0xf01FF
}
#region DLLImport
[DllImport( "kernel32.dll", EntryPoint = "GetLastError" )]
public static extern int GetLastError();
[DllImport( "advapi32.dll", EntryPoint = "OpenSCManager" )]
public static extern int OpenSCManager( string machineName, string databaseName, ServiceControlAccessRights desiredAccess );
[DllImport( "advapi32.dll", EntryPoint = "CloseServiceHandle" )]
public static extern bool CloseServiceHandle( int hSCObject );
[DllImport( "advapi32.dll", EntryPoint = "CreateService" )]
public static extern int CreateService( int hSCManager, string serviceName, string displayName,
ServiceControlAccessRights desiredAccess, ServiceControlType serviceType, ServiceStartType startType, ServiceErrorType errorControl, string pathName,
string loadOrderGroup, string tagId, string dependencies, string serviceStartName, string password );
[DllImport( "advapi32.dll", EntryPoint = "OpenService" )]
public static extern int OpenService( int hSCManager, string serviceName, ServiceControlAccessRights desiredAccess );
[DllImport( "advapi32.dll", EntryPoint = "LockServiceDatabase" )]
public static extern int LockServiceDatabase( int handle );
[DllImport( "advapi32.dll", EntryPoint = "UnlockServiceDatabase" )]
public static extern bool UnlockServiceDatabase( int handle );
[DllImport( "advapi32.dll", EntryPoint = "ChangeServiceConfig" )]
public static extern bool ChangeServiceConfig( int hService,
ServiceControlType dwServiceType, int dwStartType, int dwErrorControl,
string lpBinaryPathName, string lpLoadOrderGroup, IntPtr lpdwTagId,
string lpDependencies, string lpServiceStartName, string lpPassword,
string lpDisplayName );
#endregion DLLImport
public bool InstallService( string svcPath, string svcName, string svcDispName )
{
try
{
int hScm = OpenSCManager( null, null, ServiceControlAccessRights.AllAccess );
if( hScm == 0 )
return false;
int hSvc = CreateService( hScm, svcName, svcDispName,
ServiceControlAccessRights.StandardRightsRequired |
ServiceControlAccessRights.CreateService |
ServiceControlAccessRights.ModifyBootConfig,
ServiceControlType.OwnProcess | ServiceControlType.InteractiveProcess,
ServiceStartType.DemandStart,
ServiceErrorType.ErrorNormal,
svcPath,
null, null, null, "LocalSystem", null );
if( hSvc == 0 )
{
int err = GetLastError();
CloseServiceHandle( hSvc );
CloseServiceHandle( hScm );
return false;
}
else
{
CloseServiceHandle( hSvc );
CloseServiceHandle( hScm );
return true;
}
}
catch( Exception e )
{
throw e;
}
}
Thanks
|
|
|
|
|
Hi,
Can we use .NET assemblies in ATL?
Regards
Tarun
Blue Pill or Red Pill........??
|
|
|
|
|
|
Hi,
How do I set background color for status bar?
Direct property not available.
Thankx
Priya
|
|
|
|
|
I don't believe you can. This is from docs (bolding is mine)...
The ProgressBar control displays a bar that fills in from left to right with the system highlight color as an operation progresses.
Jeff Martin
Triple20 Software
|
|
|
|
|
I know this question has been asked many times and althought I have browsed through several message boards, I can see the question but not the answers.
Because of that, I tried to figure out which method or methods the datagrid has to paint the column headers. Using reflection I found out that there are two methods: PaintColumnHeaders and PaintColumnHeaderText.
However, this methods are private and can't be overridden or hidden.
I can't understand why they made these methods private but anyway, does anyone know how to go around this?
also, there is a private method that returns the header rectangle. I was able using the MethodInfo.Invoke method to get this object but I can't do anything with it.
I am just learning to use the Reflection namespace I haven't figured out how to deal with this, any ideas?
|
|
|
|
|
Hi All,
I want to access a web service(methods) from java at runtime.
what are the ways for doing this?
Any Links to some articles on this would be appreciated
Thanks and Regards
Tushar mahajan.
|
|
|
|
|
Tushar mahajan wrote:
from java
Ummmm... You do realise that this is a .NET Framework forum, don't you? You might find your answer if you post your question to a Java related forum.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
|
Can someone direct me to step by step directions on how-to setup my computer (.Net 2002. W2K)so I can begin playing with web applications. I have IIS installed & running along with all the .NET options from the setup. I create a simple asp.net application. I add just a label. When I try to run it (f5) it complains about the debugger. If I start without debugging, I just get unformatted text. I must have the setup messed up.
|
|
|
|
|
Greetings
I am getting this exception from time to time when trying to connect to authorize.net. I can fix the problem by re-cycling the application pool (i.e. re-start IIS) but it only stays fixed for a couple days then it starts happening again. Here is the exact error.
Exception Details: System.EntryPointNotFoundException: Unable to find an entry point named EnumerateSecurityPackagesW in DLL security.dll.
I originally got this error on this serverr when I added this script to the website. I fixed it by adding the "ASPNET" user group to the file permissions for this page and set it to modify control. That got me going but only for a couple days and then it stops. It will process cards just fine when it is not throwing this error.
Very very odd. I cannot believe it is code related because of the sporadic nature and I use this EXACT SAME SCRIPT on another server and it works with zero problems.
By the way, I do not have a custom DLL named security.DLL that would be causing a conflict or any other custom DLL for that matter. I am completely stumped.
Any help out there? Rob
Rob Taylor
www.tconsult.com
|
|
|
|
|
When using P/Invokes, the Framework simply uses the Windows LoadLibraryEx function to load the library. You're therefore constrained by the DLL search order used by LoadLibrary .
I'm not sure exactly whether or when the Framework calls FreeLibrary . From my experience, I don't think it does, except possibly when unloading an AppDomain.
At a guess, I'd say your live server is running Windows 2000 and has a security.dll somewhere on the system - possibly in another virtual directory. When your application starts up, the ASPNET_WP worker process creates an AppDomain for your application. If somehow the current directory for the process is a directory which contains a security.dll , that will get loaded rather than the system's version, because the current directory appears before the system directory on Windows 2000. This problem will also occur on Windows XP before SP1. The default for XP SP1 and Windows Server 2003 is for the system directory to be searched before the current directory, but this can be altered by setting HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode to 0.
I think you could kludge this by P/Invoking the LoadLibrary function to explicitly load security.dll from the Windows directory. If you pass a path to LoadLibrary , that version will be loaded. Subsequently, any use of LoadLibrary without supplying the path information (as P/Invoke does) will use the version that's already loaded.
If you're going to do this - and I make no guarantees it will work - it probably needs to go in global.asax in an override of HttpApplication.Init .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Good Heavens Mike we may have hit the Mother Load.
It is Server 2003 but you really jarred something in me when you said "Security.DLL" somewhere on the system - not necessarily in the web directory. As a result, I did a search of the entire web server and guess what I found? A file named security.dll in one of the other websites on there. It was from a long time ago and was for a web service I was screwing around with like a year ago. Think that could cause it to happen?
I do not know if that will do the trick but I now know the only thing(s) on here named security.DLL are system DLLs. BUT I still have three.
One named "System.Security.DLL" which is in "Microsoft.NET \Framework\v1.1.4322"
One Named "Security.DLL" in the "System32" folder
Another Named "Security.DLL" in "Microsoft.NET \Framework\v1.1.4322\Temporay ASP.NET Files\root\"
How does all that sound?
Rob
Rob Taylor
www.tconsult.com
|
|
|
|
|
Yep, that third one probably did it. I've thought of another way it could happen: if the other security.dll is a managed DLL.
The CLR still uses the LoadLibrary API to load managed DLLs, for compatibility with Managed C++ (in which it's possible to implement DLLs with so-called 'flat' exports) I think. This loads the DLL with an explicit path. If this gets loaded before the P/Invoke (embedded in the depths of System.DLL) happens, LoadLibrary will return a handle to this managed DLL rather than looking for the DLL in System32, even on Windows Server 2003. This could happen if another website in the same application pool which uses that DLL starts before your application does.
My solution of using LoadLibrary explicitly likely wouldn't help in that case.
If you can delete that extra security.dll , that's the easiest solution. I suspect it's being copied back there by a different web application, though. Check the bin directory under your application roots.
If you ever have to deal with a situation where another web application is using a security.dll (or any other name which conflicts with a system DLL), your best bet is probably to create a separate application pool for one of the conflicting applications. This will force it to get a different W3WP worker process (in IIS 6.0), so they won't conflict.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi Mike
What third one did the trick? Are you saying I should leave the security.dll alone that is located
is system32 and delete the other 2? One is in System32 and the other 2 are in "Framework" someplace.
Which should I delete?
I have looked in all the bins on the site and I got the security.DLLs out of there. While they
were not located directly in this application, I hope that was causing the problem.
This is great. I hope it solves the problem.
Rob
Rob Taylor
www.tconsult.com
|
|
|
|
|
http://www.tconsult.com/aspnet/server2003/entry_point_EnumerateSecurityPackagesW.aspx
Rob Taylor
www.tconsult.com
|
|
|
|
|