Geeks With Blogs

News
Paul's Petrov Whiteboard [BizTalk, Enterprise Application Integration, Business Process Automation, SOA, .NET]

After schemas have been published using Web Services Publishing wizard there’s a high chance we’d want to update and re-publish them later on. In the post about web services deployment automation I mention the way of scripting publishing process. Here is some more information on it.

Web Services Publishing wizard creates temp folder under the publishing target directory. There’s a file confusingly named WebServiceDescription.xml (does not have anything to do with WSDL). It contains complete information about web service publishing configuration. We can use this file to edit existing service definition. To load configuration into publishing wizard use this command:

  BTSWebSvcWiz.exe config="<WebServiceDescriptionXmlPath>"

For example you’ve published schema to http://localhost/MyServices where MyService is pointed to local physical path: C:\inetpub\wwwroot\MyServices then WebServiceDescriptionXmlPath would be C:\Inetpub\wwwroot\MyServices \temp\WebServiceDescription.xml. The schema of this xml is straightforward so you can edit manually if you want.

This is all good when we iterate and interactively apply changes to the published schemas during development cycle. For unattended builds it’s better to use web services publishing API programmatically like this:

using Microsoft.BizTalk.WebServices;
using Microsoft.BizTalk.WebServices.Description;

public static void Publish(string path)
{
  WebServiceDescription desc
= WebServiceDescription.LoadXml(path);
  WebServiceBuilder builder
= new WebServiceBuilder();
  builder.WebServiceDescription
= desc;
  builder.ProgressCallback
+= new ProgressEventHandler(OnProgress);
  builder.BuildWebService();

  Trace.WriteLine(
"Completed publishing web services");
}

private static void OnProgress(object sender, ProgressEventArgs e)
{
  Trace.WriteLine(String.Format(
"OnProgress: {0} {1}", e.Value.ToString(), e.Message));
}

As you see we even get an event that can be used for monitoring progress steps.

Posted on Monday, May 22, 2006 5:01 PM BizTalk | Back to top


Comments on this post: BizTalk Schema Publishing Tips: Scripting

# re: BizTalk Schema Publishing Tips: Scripting
Requesting Gravatar...
Great one Paul - glad to see you finally got the time to put those great ideas down!!!
Left by Mick Badran on May 31, 2006 3:49 PM

# re: BizTalk Schema Publishing Tips: Scripting
Requesting Gravatar...
Here's how to do the same thing but with the WCF Publishing Wizard in 2006 R2

http://eddietse.blogspot.com/2008/01/reuse-biztalk-wcf-service-publishing.html
Left by Richard Hallgren on Mar 04, 2008 6:45 AM

# re: BizTalk Schema Publishing Tips: Scripting
Requesting Gravatar...
Thanks, Richard. Yes, very similar.
Left by Paul Petrov on Mar 19, 2008 2:51 PM

Your comment:
 (will show your gravatar)


Copyright © Paul Petrov | Powered by: GeeksWithBlogs.net