SOA Suite 10.1.3 install issue

There is a known bug with the install of the Oracle SOA Suite on Windows Server 2003 whereby the service required to run the Oracle Application Server is not installed (bug note 423366.1). 

To fix the problem you can create the service yourself using sc.exe.

sc create Oracle<Home Name>ProcessManager binPath= "<Home Path>\opmn\bin\opmn.exe -S " DisplayName= Oracleoracleas1ProcessManager

Replace <Home Name> with the name of the Oracle Home (where the application server is installed which can be found in the registry HKLM/SOFTWARE/ORACLE/Key/ORACLE_HOME_NAME), and <Home Path> with application server the install path.  Note that the <Home Name> is case sensitive, also note the space after the binPath and DisplayName options - these are important!

This will create a service named "Oracle<Home Name>ProcessManager" which you can configure to auto start.

Using UDDI v3 from C#

Microsoft support for UDDI seems to have disappeared of late - just try tracking down anything on MSDN and you will see what I mean from all the 404's and mis-leading information you will stumble across.

UDDI is a really useful part of any SOA, and the Oracle Service Registry contained within the Oracle SOA suite (version 10.1.3) supports version 1, 2 and 3 of the specification (by the way installation of the Oracle Service Registry is not the easiest thing you will ever do).  The easiest version of the spec to implement in .NET is the version 3.

Firstly download the WSDl and supporting schema from http://uddi.xml.org.

http://uddi.org/schema/uddi_v3.xsd
http://uddi.org/wsdl/uddi_api_v3_binding.wsdl
http://uddi.org/wsdl/uddi_api_v3_portType.wsdl

download additional supporting schema from http://www.w3.org

http://www.w3.org/2001/xml.xsd
http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd

saving to the same location.

Technorati Tags: ,

Edit xmldsig-core-schema.xsd and comment out the doctype definition - as this declaration makes svcutil barf as described in http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3065329&SiteID=1).

Generate the service proxy using svcutil, making sure to reference all required WSDL and schema.

svcutil /t:code /out:svcuti.cs uddi_api_v3_binding.wsdl uddi_api_v3_portType.wsdl uddi_v3.xsd xml.xsd xmldsig-core-schema.xsd

You will need to amend the svcutil generated config to include the endpoint for the UDDI service (just add the address attribute to the endpoint config). Then you can use the proxy to access the registry.

UDDI_Inquiry_PortTypeClient proxy = new UDDI_Inquiry_PortTypeClient("UDDI_Inquiry_SoapBinding_UDDI_Inquiry_PortType");
 
find_binding fb = new find_binding();
fb.serviceKey = "uddi:systinet.com:uddi:service:v3_inquiry";
 
bindingDetail detail = proxy.find_binding(fb);
foreach (bindingTemplate template in detail.bindingTemplate)
{
   accessPoint ap = template.Item as accessPoint;
   Console.WriteLine(ap.Value);
}

The sample code defines a simple search based on the defined key of a registered service (in this case "uddi:systinet.com:uddi:service:v3_inquiry" which is a key of the UDDI inquiry service as registered in the sample data from the Oracle Service Registry install). The code then enumerates the endpoint address for each registered endpoint listed within the returned binding detail.

For more information on the use of UDDI API read http://www.uddi.org/pubs/uddi_v3.htm

DateTimePicker with nullable DateTime...

More work with nullable DateTimes!

There are oodles of articles out there discussing data binding with the DateTimePicker control attempting to address its limitations for support of nullable types.  Of course you can define your own control, or override the built in to amend the behaviour, but I wanted to see if I could use some of the .NET syntactic sugar to provide a solution that had light impact.

The idea was based on this article http://windowsclient.net/blogs/faqs/archive/2006/05/18/what-is-the-proper-way-to-bind-nullable-datetime-property-to-datetimepicker.aspx, which was obviously posted during the .NET 2 beta as it still uses INullableValue in the implementation.  The basic of this article is to use the Format and Parse events of the Binding to deal with null using the check box.  This is pretty light touch, so I thought I would wrap this in an extension to the DateTimePicker itself.  This is the extension class:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
namespace manik.Windows.Forms
{
    public static class NullableDateTimePickerExtension
    {
        public static void AddNullableBinding(this DateTimePicker picker, Binding binding)
        {
            picker.DataBindings.Add(binding);
 
            binding.Format += new ConvertEventHandler(picker.OnFormatNullableDateTimePicker);
            binding.Parse += new ConvertEventHandler(picker.OnParseNullableDateTimePicker);
        }
 
        public static void OnParseNullableDateTimePicker(this DateTimePicker picker, object sender, ConvertEventArgs e)
        {
            Binding binding = sender as Binding;
 
            if (binding != null)
            {
                DateTimePicker dtp = (binding.Control as DateTimePicker);
 
                if ((dtp != null) && (!dtp.Checked))
                    e.Value = new Nullable<DateTime>();
            }
        }
 
        public static void OnFormatNullableDateTimePicker(this DateTimePicker picker, object sender, ConvertEventArgs e)
        {
            if (e.Value == null)
            {
                Binding binding = sender as Binding;
 
                if (binding != null)
                {
                    DateTimePicker dtp = (binding.Control as DateTimePicker);
 
                    if (dtp != null)
                    {
                        dtp.Checked = false;
                        e.Value = dtp.Value;
                    }
                }
            }
        }
    }
}

The AddNullableBinding extension will take a Binding object and hook up the Parse and Format events to further extension methods on the DateTimePicker.  Usage is really simple:

Binding testDateBinding = new Binding("Value", m_dataObject, "TestDate", true);
dtTestDate.AddNullableBinding(testDateBinding);

Just create a Binding for the date object, then call the extension method (making sure you have the correct using available of course) AddNullableBinding and that's it.  Light impact...