You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Sanjiva Weerawarana <sa...@opensource.lk> on 2004/02/28 03:31:05 UTC

axis/c++ community (was: Re: Axis c++ for HP-UX)

"Sam Lang" <sl...@mcs.anl.gov> writes:
> Unlikely.  I've submitted patches to get AxisC++ to work on linux with a
> 2.95 or 2.96 compiler, which haven't yet been incorporated into the CVS
> codebase.  From my perspective there are quite a few non-portable C++
> coding practices that have been used when developing AxisC++.  I've
> encouraged the group to define and adopt some portable coding
> guidelines, but there hasn't been much response except that I should
> define them myself.

Sam, this is an open source project. The success of an open source
project is defined by how successful the community is - there is
*no* "us" users vs. "them" developers as your note appears to imply.
The users are part of the community - in fact that's a critical part
of making successful open source projects IMO.

The note from Susantha to you asking for the guidelines was a 
request for help. That's very typical of Apache open source 
projects; maybe you are not familar with that much and expected
a "group" who are responsible for servicing the request of users.
Well, that's not the way it works.

Yes there have been some delays in committing some of the patches.
This project is still very young and we can definitely use more
committers. There are 24 outstanding items in this project right
now - that may seem very high to you, but note that Axis/Java has
206 right now. 

I just looked at Jira and there are indeed several patches you've
submitted. Would you be interested in becoming a committer? I'll
be happy to submit your name for a vote.

Sanjiva.


How significant is constructor of Win32TransService class

Posted by Shiv Kumar <sh...@accelrys.com>.
Hi,
I am trying to compile and run Axis CPP client's window code on Linux 
using MainWin (it gives binary compatible to Linux from Window Source 
code). I am able to compile and run all related projects. When Axis CPP 
Client access constructor of Win32TransService class in Xerces.dll 
(version 2.2) then it fails. 
Can someone tell me what the code of constructor does and how significant 
this code is.
I have attached the constructor code at the end of this mail.

Thanks & Regards
Shiv Kumar

// 
---------------------------------------------------------------------------
//  Win32TransService: Constructors and Destructor
// 
---------------------------------------------------------------------------
Win32TransService::Win32TransService()
{
    fCPMap = new RefHashTableOf<CPMapEntry>(109);

    //
    //  Open up the registry key that contains the info we want. Note 
that,
    //  if this key does not exist, then we just return. It will just mean
    //  that we don't have any support except for intrinsic encodings 
supported
    //  by the parser itself (and the LCP support of course.
    //
    HKEY charsetKey;
    if (::RegOpenKeyExA
    (
        HKEY_CLASSES_ROOT
        , "MIME\\Database\\Charset"
        , 0
        , KEY_READ
        , &charsetKey))
    {
        return;
    }

    //
    //  Read in the registry keys that hold the code page ids. Skip for 
now
    //  those entries which indicate that they are aliases for some other
    //  encodings. We'll come back and do a second round for those and 
look
    //  up the original name and get the code page id.
    //
    //  Note that we have to use A versions here so that this will run on
    //  98, and transcode the strings to Unicode.
    //
    const unsigned int nameBufSz = 1024;
    char nameBuf[nameBufSz + 1];
    unsigned int subIndex = 0;
    unsigned long theSize;
    while (true)
    {
        // Get the name of the next key
        theSize = nameBufSz;
        if (::RegEnumKeyExA
        (
            charsetKey
            , subIndex
            , nameBuf
            , &theSize
            , 0, 0, 0, 0) == ERROR_NO_MORE_ITEMS)
        {
            break;
        }

        // Open this subkey
        HKEY encodingKey;
        if (::RegOpenKeyExA
        (
            charsetKey
            , nameBuf
            , 0
            , KEY_READ
            , &encodingKey))
        {
 XMLPlatformUtils::panic(XMLPlatformUtils::Panic_NoTransService);
        }

        //
        //  Lts see if its an alias. If so, then ignore it in this first
        //  loop. Else, we'll add a new entry for this one.
        //
        if (!isAlias(encodingKey))
        {
            //
            //  Lets get the two values out of this key that we are
            //  interested in. There should be a code page entry and an
            //  IE entry.
            //
            unsigned long theType;
            unsigned int CPId;
            unsigned int IEId;

            theSize = sizeof(unsigned int);
            if (::RegQueryValueExA
            (
                encodingKey
                , "Codepage"
                , 0
                , &theType
                , (unsigned char*)&CPId
                , &theSize) != ERROR_SUCCESS)
            {
 XMLPlatformUtils::panic(XMLPlatformUtils::Panic_NoTransService);
            }

            //
            //  If this is not a valid Id, and it might not be because its
            //  not loaded on this system, then don't take it.
            //
            if (::IsValidCodePage(CPId))
            {
                theSize = sizeof(unsigned int);
                if (::RegQueryValueExA
                (
                    encodingKey
                    , "InternetEncoding"
                    , 0
                    , &theType
                    , (unsigned char*)&IEId
                    , &theSize) != ERROR_SUCCESS)
                {
 XMLPlatformUtils::panic(XMLPlatformUtils::Panic_NoTransService);
                }

                CPMapEntry* newEntry = new CPMapEntry(nameBuf, CPId, 
IEId);
                fCPMap->put((void*)newEntry->getEncodingName(), newEntry);
            }
        }

        // And now close the subkey handle and bump the subkey index
        ::RegCloseKey(encodingKey);
        subIndex++;
    }

    //
    //  Now loop one more time and this time we do just the aliases. For
    //  each one we find, we look up that name in the map we've already
    //  built and add a new entry with this new name and the same id
    //  values we stored for the original.
    //
    subIndex = 0;
    char aliasBuf[nameBufSz + 1];
    while (true)
    {
        // Get the name of the next key
        theSize = nameBufSz;
        if (::RegEnumKeyExA
        (
            charsetKey
            , subIndex
            , nameBuf
            , &theSize
            , 0, 0, 0, 0) == ERROR_NO_MORE_ITEMS)
        {
            break;
        }

        // Open this subkey
        HKEY encodingKey;
        if (::RegOpenKeyExA
        (
            charsetKey
            , nameBuf
            , 0
            , KEY_READ
            , &encodingKey))
        {
 XMLPlatformUtils::panic(XMLPlatformUtils::Panic_NoTransService);
        }

        //
        //  If its an alias, look up the name in the map. If we find it,
        //  then construct a new one with the new name and the aliased
        //  ids.
        //
        if (isAlias(encodingKey, aliasBuf, nameBufSz))
        {
            const unsigned int srcLen = strlen(aliasBuf);
            const unsigned charLen = ::mblen(aliasBuf, MB_CUR_MAX);

            if (charLen != -1) {
                const unsigned int targetLen = srcLen/charLen;

                XMLCh* uniAlias = new XMLCh[targetLen + 1];
                ::mbstowcs(uniAlias, aliasBuf, srcLen);
                uniAlias[targetLen] = 0;
                _wcsupr(uniAlias);

                // Look up the alias name
                CPMapEntry* aliasedEntry = fCPMap->get(uniAlias);
                if (aliasedEntry)
                {
                    const unsigned int srcLen = strlen(nameBuf);
                    const unsigned charLen = ::mblen(nameBuf, MB_CUR_MAX);
                    const unsigned int targetLen = srcLen/charLen;
 
                    XMLCh* uniName = new XMLCh[targetLen + 1];
                    ::mbstowcs(uniName, nameBuf, srcLen);
                    uniName[targetLen] = 0;
                    _wcsupr(uniName);

                    //
                    //  If the name is actually different, then take it.
                    //  Otherwise, don't take it. They map aliases that 
are
                    //  just different case.
                    //
                    if (::wcscmp(uniName, 
aliasedEntry->getEncodingName()))
                    {
                        CPMapEntry* newEntry = new CPMapEntry(uniName, 
aliasedEntry->getWinCP(), aliasedEntry->getIEEncoding());
                        fCPMap->put((void*)newEntry->getEncodingName(), 
newEntry);
                    }

                    delete [] uniName;
                }
                delete [] uniAlias;
            }
        }

        // And now close the subkey handle and bump the subkey index
        ::RegCloseKey(encodingKey);
        subIndex++;
    }

    // And close the main key handle
    ::RegCloseKey(charsetKey);

}

Re: axis/c++ community (was: Re: Axis c++ for HP-UX)

Posted by Sam Lang <sl...@mcs.anl.gov>.
On Fri, 2004-02-27 at 20:31, Sanjiva Weerawarana wrote:
> "Sam Lang" <sl...@mcs.anl.gov> writes:
> > Unlikely.  I've submitted patches to get AxisC++ to work on linux with a
> > 2.95 or 2.96 compiler, which haven't yet been incorporated into the CVS
> > codebase.  From my perspective there are quite a few non-portable C++
> > coding practices that have been used when developing AxisC++.  I've
> > encouraged the group to define and adopt some portable coding
> > guidelines, but there hasn't been much response except that I should
> > define them myself.
> 
> Sam, this is an open source project. The success of an open source
> project is defined by how successful the community is - there is
> *no* "us" users vs. "them" developers as your note appears to imply.
> The users are part of the community - in fact that's a critical part
> of making successful open source projects IMO.
> 
> The note from Susantha to you asking for the guidelines was a 
> request for help. That's very typical of Apache open source 
> projects; maybe you are not familar with that much and expected
> a "group" who are responsible for servicing the request of users.
> Well, that's not the way it works.
> 

I agree that open source requires the input and effort of an entire
community, but its also important that a measure of responsibility be in
place that keeps developers in the community honest about the quality of
the code they are committing.  Without this the entire quality of the
project will suffer.  This is why I would argue that a developer who
writes a particular component of code should be directly given bugs that
are submitted for that component.

> Yes there have been some delays in committing some of the patches.
> This project is still very young and we can definitely use more
> committers. There are 24 outstanding items in this project right
> now - that may seem very high to you, but note that Axis/Java has
> 206 right now. 
> 

I am a little unfamaliar with the Axis software lifecycle.  Is there a
period of time after a release where bugs and patches are worked on
instead of trying to constantly add new features? 

> I just looked at Jira and there are indeed several patches you've
> submitted. Would you be interested in becoming a committer? I'll
> be happy to submit your name for a vote.
> 
> Sanjiva.
> 


Re: axis/c++ community (was: Re: Axis c++ for HP-UX)

Posted by Sam Lang <sl...@mcs.anl.gov>.
On Fri, 2004-02-27 at 20:31, Sanjiva Weerawarana wrote:
> "Sam Lang" <sl...@mcs.anl.gov> writes:
> > Unlikely.  I've submitted patches to get AxisC++ to work on linux with a
> > 2.95 or 2.96 compiler, which haven't yet been incorporated into the CVS
> > codebase.  From my perspective there are quite a few non-portable C++
> > coding practices that have been used when developing AxisC++.  I've
> > encouraged the group to define and adopt some portable coding
> > guidelines, but there hasn't been much response except that I should
> > define them myself.
> 
> Sam, this is an open source project. The success of an open source
> project is defined by how successful the community is - there is
> *no* "us" users vs. "them" developers as your note appears to imply.
> The users are part of the community - in fact that's a critical part
> of making successful open source projects IMO.
> 
> The note from Susantha to you asking for the guidelines was a 
> request for help. That's very typical of Apache open source 
> projects; maybe you are not familar with that much and expected
> a "group" who are responsible for servicing the request of users.
> Well, that's not the way it works.
> 

I agree that open source requires the input and effort of an entire
community, but its also important that a measure of responsibility be in
place that keeps developers in the community honest about the quality of
the code they are committing.  Without this the entire quality of the
project will suffer.  This is why I would argue that a developer who
writes a particular component of code should be directly given bugs that
are submitted for that component.

> Yes there have been some delays in committing some of the patches.
> This project is still very young and we can definitely use more
> committers. There are 24 outstanding items in this project right
> now - that may seem very high to you, but note that Axis/Java has
> 206 right now. 
> 

I am a little unfamaliar with the Axis software lifecycle.  Is there a
period of time after a release where bugs and patches are worked on
instead of trying to constantly add new features? 

> I just looked at Jira and there are indeed several patches you've
> submitted. Would you be interested in becoming a committer? I'll
> be happy to submit your name for a vote.
> 
> Sanjiva.
>