Tools to generate WSDL from SOAP Sample?

I need to create client to web services that are documented by providing samples of SOAP messages, but there is no WSDL file available.

I’ve done  a Google search and bookmarked a few links, that can help:

XSLT that transforms from XSD to WSDL and related Spring Web Services(inJava)

Rick Strahl ‘s    Syncing up external WSDL Schemas with a stock .ASMX Web Service?

WSCF – Web services Contract-First, for real

soapUI is a free and open source desktop application for inspecting, invoking, developing, simulating/mocking and functional/load/compliance testing of web services over HTTP

 I also posted a question to webservices group.

I am going to check these links and a few others trying to find a tool to simplify WSDL creation.

Altova  XMLSpy® 2007 includes WSDL Editor and Documentation Generator .  but their Support replied me, that their tool does not have this facility.

I’ve considered to use XSD.EXE to generates an XML schema from an SOAP file and then use WSCF – Web services Contract-First, to generate WSDL from XSD, but my SOAP xml wasn’t acceptable for  XSD.EXE.


WaitAll to support calls from WindowsForms

We have multi-threading application that uses WaitHandle.WaitAll methods. It works fine, when called from ASP.NET, but when it is called from WinForms test harness, it causes the error “WaitAll for multiple handles on an STA thread is not supported.”. I’ve included the workaround and moved code to helper function.

However I needed to call the function with different parameters List<ManualResetEvent> and List<WaitHandle> . Even if ManualResetEvent is derived from WaitHandle, there is no implicit casting. Threads

Question regarding Generics and Inheritance and Casting List<> of derived class to List<> of base class? pointed me to ConvertAll method of List<> generic. And the article Introduction to anonymous methods in C#  helped me to use anonymous delegate to reduce code. 
The final helper class is shown below” 


public class ThreadingHelper


        public static bool WaitAll(List<ManualResetEvent> eventList , int millisecondsTimeout)

        {//Casting List<> of derived class to List<> of base class? see

            //new Converter<ManualResetEvent, WaitHandle>(ConvertDelegate));



            List<WaitHandle> waitHandles = eventList.ConvertAll<WaitHandle>( 

                    delegate(ManualResetEvent ev) { return (WaitHandle)ev; });

           return WaitAll( waitHandles, millisecondsTimeout);


        public static bool WaitAll(List<WaitHandle> waitHandles, int millisecondsTimeout)


            bool bRet=true;

            //to avoid “WaitAll for multiple handles on an STA thread is not supported.” SEE

            //alternative solutions described in

            if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA)

            {//usually happens when tested from TestHarness or NUnit

                foreach (WaitHandle handle in waitHandles)


                    bRet |=handle.WaitOne();





                if (millisecondsTimeout > 0)


                    bRet=WaitHandle.WaitAll(waitHandles.ToArray(), millisecondsTimeout, false);//








            return bRet;




Reference to different database in “Database Mirroring” environment

We have a stored procedure in one database that (among other things) insert a row to another database on the same server -something like

INSERT INTO OtherDatabase.dbo.LogTable.

We are using “Database Mirroring”  feature of SQL Server 2005 having mirror on another server. However failover switch happens for each database separately and it can be situations, when one database run on the same principle server, but another switched to the mirror server. For this situation the mentioned above SP failed, and the design is not acceptable.

The recommended design is to keep all tables in the same database and avoid cross-database calls, Assumption that databases are always on the same server is not valid in “mirriring” environment.
To copy/syncronize data between databases use some replication/DTS procedures that are asyncronous to main transactions.

UPDATE: After writing the post I found that it is documented in MSDN: Database Mirroring and Cross-Database Transactions and in MS support KB Using database mirroring for cross-database transactions 

Ways to store bookmarks/favorites.

When I have a new task/project, it is often required to research existing solutions on internet.
Usually I do a Google search, open a few links, quickly browse them and want to save urls for future references.
The simple and convenient way is in IE create favorites subfolder for the project and save URLs as favorite.
However it has two disadvantages- 1. Favorites are stored locally on the computer and not easily shared between home and office or with collegues/friends. 2. You can’t add extra notes for the link.
There is a web FURL tool to create shared/private favorites, but UI is not user-friendly enough.
Update: I am using and it is acceptable, but not as simple as IE favorites  and not as flexible , as your own document with links and free format comments.(See also similar link-sharing  sites like DZone )
The best approach that I found is to create a Word document, copy and paste links that I consider interesting and add extra notes or group links as you wish.
Alternatively I am using Gmail drafts or Google documents to create the post, that is accessable from different computers and has autosave facility.
When finish the first draft, post it to blog and then it will be available for myself from other locations, as well as for others who is interested in the same topic. The examples of such notes are my posts My notes about MyGeneration Templates, Links for Code Generator/ and O/R mappers for ASP.NET application , Schedule/Calendar Asp.NET controls with Source Code,  ASP.Net Ajax UpdatePanel links.
I’ve noticed that Google recently added “Note this”(Notebook link to their search results, that looks quite good, but I didn’t use it yet.

No Copy Constructor support in .Net framework.

I have a base class with a lot of data members and I wanted to create a constructor in derived class, that will take a base class as a parameter and assign all data members values from the parameter:

class Derived: Base
    Derived(Base baseClass)
      //Assign all data

The function is almost like  Copy Constructor, so I tried to search Google for it.
There is a discussion on MBR IT/.NET 247 : how to implement a C# copy constructor .

where Jeffrey Tan from Microsoft Support suggested :
public extendeddatagrid(MyDataGrid obj)
this=obj.Clone() as DataGrid;

Unfortunately, it is not allowed to assign object to this in .Net.
I’ve also found a good article on — Copy Constructors vs ICloneable. 

But .Net framework doesn’t have a facility to assign all members like MemberwiseClone Method does for copying.

So developer has to write code to assign all data members from passed object. It is quite annoying for big classes like I have.

The related topisc are discussed in article Copying, Cloning, and Marshalling in .NET

Update: See my post Implement Copy constructor using Serialization or Reflecton

Dynamic menu in ASP.NET 1.1.

My friend asked me, how to built dynamic 2 -lelels menu in VS 2003. Items coming from database amd mainly are hyperlinks to HTML document.

I haven’t written myself dynamic menu in ASP.NET.

My application was based on DotNetNuke and used DNNMenu See

However I am not sure, is it possible to use it stand-alone without DNN.

The author of DNNMenu Jon Henning had separate SolPart menu ,but unfortunately the link

In ASP.NET 2.0 there is standard Menu Control . seems not working any more.

Start Transaction from ASP.Net application can cause unexpected locks on the database.

I have the ASP.Net application, that uses SqlTransaction.BeginTransaction before the call to Update SP and commit after the call.If any exception would happened, transaction should be Rollback. 
The code snippet is the following: 
using (SqlTransaction trans = conn.BeginTransaction())
            ds = SqlHelper.ExecuteDataset(trans, CommandType.StoredProcedure, SPName);
      catch (Exception ex)
//Log the error
We noticed that during update of web.config the ASP.NET appDomain was recycled (or restarted) and it seems that at the time transaction was left open(neither Commit nor Rollback). And it caused  timeout for all subsequent updates to the locked table.
I beleive that the best approach is to remove transactions from .Net code and implement them inside each SP.
It is a fair amount of t-SQL coding, but thanks to SQL Server 2005 TRY/CATCH feature it can be done  easier.
 See TRY...CATCH in SQL Server 2005: An Easier Approach to Rolling Back Transactions in the Face of an Error
The article Managing Transactions in SQL Server Stored Procedures suggests for simple batch statements that are known at compile time I tend to use stored procedures. However when I need to issue a series of atomic statements but I don’t know what statements will need to be executed, exactly, until runtime ADO.NET transactions should be used.
In MSDN the article “Improving .NET Application Performance and Scalability” suggests 
  • Use SQL transactions for server-controlled transactions on a single data store.
  • Use ADO.NET transactions for client-controlled transactions on a single data store.
  • Use DTC for transactions that span multiple data stores.

    Other related links:

    I found the  article Tips On How to Minimize SQL Server Blocking  very useful. In particular it pointed to the commands
    DBCC OPENTRAN and DBCC INPUTBUFFER ( session_id [ , request_id ] ) 

    Schedule/Calendar Asp.NET controls with Source Code

    I wanted to find a Schedule Asp.NET control with Source Code as astart point for my development.

    I found in CodeProject , but they have LGPL license,that is not acceptable in my commercial application

    DayPilot Pro  looks the most closed to what we need,in particular combination of and

    Intersting sections to extend functionality is  Custom event rendering .

    ComponentOne WebSchedule for ASP.NET  looks nice, but it seems that they do not sale source code.

    Other links that I’ve browsed





    Controls: monthly view 

    Databound Schedule controls – The Code Project – ASP.NET



    TFS build Notes

    There are a few links related to TFS build and Source control 

    Customizing Team Foundation Build 

    Add Continuous Integration Capabilities to Team Foundation Server

    I’ve got  a few useful tips from  Mitch Denny:

    To remove incorrect subsctiptions:

    TFS has a table (tbl_subscriptions) in the TfsIntegration database which lists all these endpoints. Don’t ever edit this table directly. You can  look at the subscription ID and then use the bissubscribe.exe tool to unsubscribe those event registrations.

    Make sure that the files that TFS Integrator is replicating are no checked out – this will cause it to fall over.
    Use the TFS Sidekick tool to remove the locks/checkouts.

    TFS Source Control Tools

    Team Foundation Server Power Tool has History  with /followbranches option
    More power: New power toy release (tfpt) includes VSS-style project difference

    Other TFS links:
    Changing the Local Path in Team Foundation Server Source Control

    renaming files in TFS

    ASP.Net Ajax UpdatePanel links.

    I’ve tried to investigate slow load of UpdatePanel. It works quick enough in FireFox, slow in IE 7 and even more slower in IE6.

    I found a few related links:

    In production make sure that <compilation debug=false> is in your web.config(tip from

    Delayed load with an UpdatePanel and similar post.

    The top 10 mistakes when using AJAX recommends do not  put everything in a UpdatePanel.
    Are you making these 3 common ASP.NET AJAX mistakes?” suggest to use  IsPostBack, IsInAsyncPostBack and __EVENTTARGET to avoid redundant execution of code during partial postbacks.

    The article “Build Google IG like Ajax Start Page in 7 days using ASP.NET Ajax and .NET 3.0” shows(among other intersting things) how to consider what to include into UpdatePanes.

    Dynamic User Control, Ajaxify your controls suggests an alternative to UpdatePanel without instantiation the full page ,but the user control CANNOT depend on the page it lives in.

    Loading UserControl Dynamically in UpdatePanel

    Post “How to solve slow reponse with ASP.NET AJAX in IE 6?” suggests(among others)  to apply IIS compression to imporove the loading time.(NOT SURE HOW?) 

     UpdatePanel: having fun with errors describes 3 techniques to handle errors. I prefer server logging using OnAsyncPostBackError=”HandleError” . The ideas are detailed in Customizing Error Handling for ASP.NET UpdatePanel Controls. See also Ajax Exception Logging and How to improve ASP.NET AJAX error handling


    Avoid calling unneseccary procedures during partial Update:

                ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
                if ((scriptManager != null) && (scriptManager.IsInAsyncPostBack))
                { //ASSUMPTION: the control is not included in AJAX UpdatePanel

    Update after Damian Edwards‘s presentation “ASP.NET AJAX Tips and Tricks”
    1. Always specify <UpdatePanel UpdateMode=”conditional”>
    2. If there is no UpdatePanel on the page, specify ScriptManager.EnablePartialRendering=”false”.
    3. Specify ChildrenAsTriggers=false, if you want to specify triggers explicitely
    3. JavaScript calls _doPostBack(‘<%=btnTrigger.UniqueID %>