David BP
David BP

Reputation: 21

Cannot edit UDDI Provider with Microsoft UDDI3 API using C# and you are not the Provider owner

I have configured one Biztalk Server to run the Microsoft UDDI server. I configured one Active Directory group to be the administrator's group for the UDDI.

When I use the UDDI Web User interface, I can create providers, and also I can view the data (providers, tmodels, etc) owned by other user using the "View data owned by" button.

I used the Microsoft.Uddi3.dll API in C# to create a Windows form dialog to manage the UDDI entries in a client remote application, and I can use it to see the providers created by other users, but any modification on the providers owned by other users are throwing the Microsoft.Uddi3.UserMismatchException (The entity uddi:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is not owned by the publisher) because I'm not the real owner, even when I am an administrator within the UDDI. If I use it against the Provider created by me, the edition is working fine. The problem occurs when my user is not the one that created the provider.

I saw that the Web UI is using a Method called ViewAsPublisher.Set(string username) under the UDDI.Web.DLL that sets the user owner you want to see its data, but I used it on the client machine with unsucessful results. I think this DLL was developed to be used in the server and have no sense to use in clients, but I need some funcionality similar to the one allowed in the Web User Interface.

The Microsoft.Uddi3.dll also providesthe capability to transfer the ownership, but I only need to have the same behavior that in the Web UI, I mean modify the provider directly acting as if I were the real owner just if I belong toan administrator, publisher or coordinator group.

I don't know if it is a configuration problem, or it is a limitation on the Uddi3 API methods.

Can anyone help me?

Upvotes: 0

Views: 120

Answers (2)

spy
spy

Reputation: 3258

David, sounds like this is by design. Ms Uddi does support access control rules. You either have to alert the permissions or sign in as an administrator in order to alter records you don't own.

Upvotes: 0

David BP
David BP

Reputation: 21

here is the code we use to modify the provider (name and description, for example).

We use the _connection parameter which is used with the following info:

    private void ConnectToUddi()
    {
        if (!uddiServer.EndsWith("/"))
            uddiServer = uddiServer + "/";
        string inquireURL = uddiServer + "inquire.asmx";
        string publishURL = uddiServer + "publish.asmx";
        string extensionURL = uddiServer + "extension.asmx";

        UddiSiteLocation location = new UddiSiteLocation(inquireURL, publishURL, extensionURL);
        _connection = new UddiConnection(location);
        _connection.AutoGetAuthToken = true;
        _connection.AuthenticationMode = AuthenticationMode.WindowsAuthentication;
    }

Then, the connection is used here:

            BusinessEntity entity = tree.SelectedNode.Tag as BusinessEntity;
            GetBusinessDetail businessDetails = new GetBusinessDetail(entity.BusinessKey);
            BusinessDetail businessDet = businessDetails.Send(_connection);
            if (businessDet != null && businessDet.BusinessEntities.Count > 0)
            {
                BusinessEntity be = businessDet.BusinessEntities[0];
                ProviderProperties providerProperties = new ProviderProperties(be);
                if (providerProperties.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    be.Names[0].Text = providerProperties.ProviderName;
                    if (providerProperties.ProviderDescription.Length > 0)
                    {
                        Description description = new Description(providerProperties.ProviderDescription);
                        be.Descriptions.Clear();
                        be.Descriptions.Add(description);
                    }
                    else
                        be.Descriptions.Clear();
                    SaveBusiness saveBusiness = new SaveBusiness(be);
                    saveBusiness.Send(_connection);

                    BeginRefresh();  
                }
            }

It works properly for providers created by me, but when a different user tries to modify my provider (name, for example) and uses the API it is throwing the Microsoft.Uddi3.UserMismatchException.

Thanks!!!

Upvotes: 0

Related Questions