Index: kresources/groupwise/kabc_resourcegroupwise.cpp
===================================================================
--- kresources/groupwise/kabc_resourcegroupwise.cpp	(revision 529489)
+++ kresources/groupwise/kabc_resourcegroupwise.cpp	(revision 529541)
@@ -183,8 +183,8 @@
 
     GroupWise::AddressBook::List::ConstIterator it;
     for( it = mAddressBooks.begin(); it != mAddressBooks.end(); ++it ) {
+      reads.append( (*it).id );
       if ( (*it).isPersonal ) {
-        reads.append( (*it).id );
         if ( write.isEmpty() ) write = (*it).id;
       }
       else
@@ -384,6 +384,7 @@
         mPrefs->setLastSequenceNumber( deltaInfo.lastSequence );
         mPrefs->writeConfig();
         emit loadingFinished( this );
+        addressBook()->emitAddressBookChanged();
       }
     }
   }
@@ -400,7 +401,7 @@
   saveCache();
 
   emit loadingFinished( this );
-
+  addressBook()->emitAddressBookChanged();
   mDownloadJob = 0;
   if ( mProgress ) mProgress->setComplete();
   mProgress = 0;
Index: kresources/groupwise/soap/gwconverter.cpp
===================================================================
--- kresources/groupwise/soap/gwconverter.cpp	(revision 529489)
+++ kresources/groupwise/soap/gwconverter.cpp	(revision 529541)
@@ -110,13 +110,15 @@
 
 QDate GWConverter::stringToQDate( std::string* str )
 {
-  return QDate::fromString( QString::fromUtf8( str->c_str() ) );
+  //NB this ISODate may become unnecessary, if GW stops sending in yyyy-mm-dd format again
+  return QDate::fromString( QString::fromLatin1( str->c_str() ), Qt::ISODate );
 }
 
 QDateTime GWConverter::charToQDateTime( const char *str )
 {
   if ( !str ) return QDateTime();
 //  kdDebug() << "charToQDateTime(): " << str << endl;
+  // as above re Qt::ISODate
   QDateTime dt = QDateTime::fromString( QString::fromUtf8( str ), Qt::ISODate );
 //  kdDebug() << "  " << dt.toString() << endl;
   return dt;
Index: kresources/groupwise/soap/incidenceconverter.cpp
===================================================================
--- kresources/groupwise/soap/incidenceconverter.cpp	(revision 529489)
+++ kresources/groupwise/soap/incidenceconverter.cpp	(revision 529541)
@@ -65,19 +65,21 @@
     event->setFloats( true );
 
     if ( appointment->startDay != 0 )
-      event->setDtStart( QDate::fromString( QString::fromUtf8( appointment->startDay->c_str() ), Qt::ISODate ) );
+      event->setDtStart( stringToQDate( appointment->startDay ).addDays( 1 ) );
 
     if ( appointment->endDay != 0 )
-      event->setDtEnd( QDate::fromString( QString::fromUtf8( appointment->endDay->c_str() ), Qt::ISODate ).addDays( -1 ) );
+      event->setDtEnd( stringToQDate( appointment->endDay) );
+    
     kdDebug() << " all day event." << endl;
   }
   else
   {
     event->setFloats( false );
 
-    if ( appointment->startDate != 0 )
+    if ( appointment->startDate != 0 ) {
       event->setDtStart( charToQDateTime( appointment->startDate, mTimezone ) );
-
+    }
+    
     if ( appointment->endDate != 0 )
       event->setDtEnd( charToQDateTime( appointment->endDate, mTimezone ) );
   }
@@ -129,15 +131,29 @@
   if ( event->doesFloat() ) {
     bool *allDayEvent = (bool*)soap_malloc( soap(), 1 );
     (*allDayEvent ) = true;
-
     appointment->allDayEvent = allDayEvent;
 
-    if ( event->dtStart().isValid() )
-//      appointment->startDate = qDateToChar( event->dtStart().date() );
-      appointment->startDay = qDateToString( event->dtStart().date() );
-    if ( event->hasEndDate() )
-//      appointment->endDate = qDateToChar( event->dtEnd().date() );
-      appointment->endDay = qDateToString( event->dtEnd().date() );
+    if ( event->dtStart().isValid() ) {
+/*      kdDebug() << " convertToAppointment() raw start date: " << event->dtStart().toString() << endl;*/
+      QDateTime start = event->dtStart();
+      start.setTime( QTime( 0, 0, 0 ) );
+      appointment->startDate = qDateTimeToChar( start, mTimezone );
+      //appointment->startDay = qDateToString( event->dtStart().date()/*.addDays( -1 )*/ );  
+/*      kdDebug() << "   converted start date: " << appointment->startDate << endl;*/
+    }
+    else
+      kdDebug() << "   event start date not valid " << endl;
+    if ( event->hasEndDate() ) {
+//       kdDebug() << " convertToAppointment() raw end date: " << event->dtEnd().toString() << endl;
+      QDateTime end = event->dtEnd();
+      end = end.addDays( 1 );
+      end.setTime( QTime( 0, 0, 0 ) );
+      appointment->endDate = qDateTimeToChar( end, mTimezone );
+      //appointment->endDay = qDateToString( event->dtEnd().date() );
+//       kdDebug() << "   converted end date:" << appointment->endDate << endl;
+    }
+    else
+      kdDebug() << "   event end date not valid " << endl;
   } else {
     appointment->allDayEvent = 0;
 
@@ -223,6 +239,7 @@
   ngwt__Task* task = soap_new_ngwt__Task( soap(), -1 );
   task->startDate = 0;
   task->dueDate = 0;
+  task->assignedDate = 0;
   task->taskPriority = 0;
   task->completed = 0;
 
@@ -253,18 +270,21 @@
 
 KCal::Journal* IncidenceConverter::convertFromNote( ngwt__Note* note)
 {
+  kdDebug() << "IncidenceConverter::convertFromNote()" << endl;
   if ( !note )
     return 0;
 
   KCal::Journal *journal = new KCal::Journal();
 
   if ( !convertFromCalendarItem( note, journal ) ) {
+    kdDebug() << "Couldn't convert Note to Journal!" << endl;
     delete journal;
     return 0;
   }
 
   if ( note->startDate ) {
-    journal->setDtStart( stringToQDateTime( note->startDate ) );
+    kdDebug() << "Journal start date is: " << note->startDate->c_str() << endl;
+    journal->setDtStart( stringToQDate( note->startDate ) );
   }
 
   return journal;
@@ -318,6 +338,8 @@
   item->hasAttachment = false;
   item->size = 0;
   item->subType = 0;
+  item->nntpOrImap = 0;
+  item->smimeType = 0;
   // ngwt__BoxEntry
   item->status = 0;
   item->thread = 0;
@@ -458,6 +480,7 @@
   }
   item->distribution->to = qStringToString( to );
   item->distribution->cc = 0;
+  item->distribution->bc = 0;
 }
 
 ngwt__Recipient *IncidenceConverter::createRecipient( const QString &name,
@@ -481,7 +504,8 @@
     recipient->email = 0;
   }
   recipient->distType = TO;
-  recipient->recipType = User;
+  recipient->recipType = User_;
+  recipient->acceptLevel = 0;
   return recipient;
 }
 
@@ -496,11 +520,14 @@
 
   kdDebug() << "SUMMARY: " << incidence->summary() << endl;
 
-  if ( item->created )
+  if ( item->created ) {
+    kdDebug() << "item created at " << item->created << endl;
     incidence->setCreated( charToQDateTime( item->created, mTimezone ) );
-
-  if ( item->modified != 0 )
+  }
+  if ( item->modified != 0 ) {
+    kdDebug() << "item modified at " << item->created << endl;
     incidence->setLastModified( charToQDateTime( item->modified, mTimezone ) );
+  }
 
   getItemDescription( item, incidence );
   getAttendees( item, incidence );
@@ -572,7 +599,7 @@
     part->contentType = str;
 
     part->length = 0; // this is optional and sending the actual length of the source string truncates the data.
-
+    part->offset = 0; // optional
     message->part.push_back( part );
 
     item->message = message;
@@ -617,7 +644,7 @@
 void IncidenceConverter::setRecurrence( KCal::Incidence * incidence, ngwt__CalendarItem * item )
 {
   kdDebug() << k_funcinfo << endl;
-  ngwt__Frequency * freq;
+  ngwt__Frequency * freq = 0;
   const KCal::Recurrence * recur = incidence->recurrence();
 
   if ( incidence->doesRecur() )
@@ -629,6 +656,7 @@
     item->rrule->interval = 0; //
     item->rrule->byDay = 0;
     item->rrule->byYearDay = 0;
+    item->rrule->byMonthDay = 0;
     item->rrule->byMonth = 0;
     freq = (ngwt__Frequency *)soap_malloc( soap(), sizeof( ngwt__Frequency ) );
     // interval
@@ -694,16 +722,17 @@
 #endif
   {
     kdDebug() << "incidence recurs weekly" << endl;
+#if 1 //trying out byDay recurrence
     *freq = Weekly;
     item->rrule->frequency = freq;
     // now change the bitArray of the days of the week that it recurs on to a ngwt__DayOfWeekList *
     QBitArray ba = recur->days();
-    ngwt__DayOfWeekList * weeklyDays = soap_new_ngwt__DayOfWeekList( soap(), -1 );
+    ngwt__DayOfYearWeekList * weeklyDays = soap_new_ngwt__DayOfYearWeekList( soap(), -1 );
     for ( int i = 0; i < 7; ++i )
     {
       if ( ba[i] )
       {
-        ngwt__DayOfWeek * day = soap_new_ngwt__DayOfWeek( soap(), -1 );
+        ngwt__DayOfYearWeek * day = soap_new_ngwt__DayOfYearWeek( soap(), -1 );
         day->occurrence = 0;
         switch( i )
         {
@@ -734,6 +763,7 @@
     }
     // add the list of days to the recurrence rule
     item->rrule->byDay = weeklyDays;
+#endif
   }
 #if LIBKCAL_IS_VERSION( 1, 3, 0 )
    else if ( incidence->recurrenceType() == KCal::Recurrence::rMonthlyDay )
Index: kresources/groupwise/soap/groupwiseserver.cpp
===================================================================
--- kresources/groupwise/soap/groupwiseserver.cpp	(revision 529489)
+++ kresources/groupwise/soap/groupwiseserver.cpp	(revision 529541)
@@ -33,6 +33,7 @@
 #include <kio/job.h>
 #include <kio/jobclasses.h>
 #include <kio/netaccess.h>
+#include <kprotocolmanager.h>
 #include <ktempfile.h>
 #include <kdebug.h>
 #include <klocale.h>
@@ -111,6 +112,7 @@
   if ( mSSL ) {
 //    kdDebug() << "Creating KSSLSocket()" << endl;
     m_sock = new KSSLSocket();
+    m_sock->setTimeout( KProtocolManager::connectTimeout() );
     connect( m_sock, SIGNAL( sslFailure() ), SLOT( slotSslError() ) );
   } else {
     m_sock = new KExtendedSocket();
@@ -126,8 +128,16 @@
   int rc = m_sock->connect();
   if ( rc != 0 ) {
     kdError() << "gSoapOpen: connect failed " << rc << endl;
-    mError = i18n("Connect failed: %1.").arg( rc );
-    if ( rc == -1 ) perror( 0 );
+    QString errorMessage;
+    if ( rc == -1 ) {
+      errorMessage = QString::fromLatin1( strerror( errno ) );
+      perror( 0 );
+    }
+    else {
+      if ( rc == -3 )
+        errorMessage = QString::fromLatin1( "Connection timed out.  Check host and port number" );
+    }
+    mError = i18n("Connect failed: %1.").arg( errorMessage );
     return SOAP_INVALID_SOCKET;
   }
   m_sock->enableRead( true );
@@ -308,7 +318,7 @@
 
   if ( !checkResponse( result, loginResp.status ) ) return false;
 
-  mSession = loginResp.session;
+  mSession = *(loginResp.session);
 
   if ( mSession.size() == 0 ) // workaround broken loginResponse error reporting
   {
@@ -329,6 +339,7 @@
     mUserName = conv.stringToQString( userinfo->name );
     if ( userinfo->email ) mUserEmail = conv.stringToQString( userinfo->email );
     if ( userinfo->uuid ) mUserUuid = conv.stringToQString( userinfo->uuid );
+    // can also get userid here in GW7 (userinfo->userid)
   }
 
   kdDebug() << "USER: name: " << mUserName << " email: " << mUserEmail <<
@@ -744,7 +755,7 @@
       std::vector<class ngwt__Folder * >::const_iterator it;
       for ( it = folders->begin(); it != folders->end(); ++it ) {
         ngwt__SystemFolder * fld = dynamic_cast<ngwt__SystemFolder *>( *it );
-        if ( fld && fld->folderType == Calendar )
+        if ( fld && *(fld->folderType) == Calendar )
           if ( !fld->id ) {
             kdError() << "No folder id" << endl;
           } else {
@@ -1042,6 +1053,7 @@
   request.updates->_delete = 0;
   request.updates->update = item;
   request.notification = 0;
+  request.recurrenceAllInstances = 0;
   _ngwm__modifyItemResponse response;
   mSoap->header->ngwt__session = mSession;
 
@@ -1172,10 +1184,13 @@
   request.retractingAllInstances = (bool*)soap_malloc( mSoap, 1 );
   request.retractCausedByResend = ( cause == DueToResend );
   request.retractingAllInstances = true;
-  request.retractType = allMailboxes;
+  ngwt__RetractType * rt = new ngwt__RetractType;
+  *rt = allMailboxes;
+  request.retractType = rt;
 
   int result = soap_call___ngw__retractRequest( mSoap, mUrl.latin1(), 0,
                                                     &request, &response );
+  delete rt;
   return checkResponse( result, response.status );
 }
 
@@ -1231,6 +1246,7 @@
   request.updates->_delete = 0;
   request.updates->update = contact;
   request.notification = 0;
+  request.recurrenceAllInstances = 0;
 
   _ngwm__modifyItemResponse response;
   mSoap->header->ngwt__session = mSession;
@@ -1366,11 +1382,11 @@
         if ( blocks ) {
           std::vector<class ngwt__FreeBusyBlock *>::const_iterator it2;
           for( it2 = blocks->begin(); it2 != blocks->end(); ++it2 ) {
-            QDateTime blockStart = conv.charToQDateTime( (*it2)->startDate, KPimPrefs::timezone() );
-            QDateTime blockEnd = conv.charToQDateTime( (*it2)->endDate, KPimPrefs::timezone() );
+            QDateTime blockStart = conv.charToQDateTime( (*it2)->startDate );
+            QDateTime blockEnd = conv.charToQDateTime( (*it2)->endDate );
             ngwt__AcceptLevel acceptLevel = *(*it2)->acceptLevel;
 
-            /* we need to support these as people use it for checking others' calendars */ 
+            /* TODO: show Free/Busy subject in diagram - we need to support these as people use it for checking others' calendars */ 
 /*            if ( (*it2)->subject )
               std::string subject = *(*it2)->subject;*/
   //          kdDebug() << "BLOCK Subject: " << subject.c_str() << endl;
Index: kresources/groupwise/soap/gwjobs.cpp
===================================================================
--- kresources/groupwise/soap/gwjobs.cpp	(revision 529489)
+++ kresources/groupwise/soap/gwjobs.cpp	(revision 529541)
@@ -366,13 +366,13 @@
               totalItems += count;
             }
             kdDebug() << "Folder " <<  (*(*it)->id).c_str() << ", containing " << count << " items." << endl;
-            if ( fld->folderType == Calendar ) {
+            if ( *(fld->folderType) == Calendar ) {
               kdDebug() << "Reading folder " <<  (*(*it)->id).c_str() << ", of type Calendar, physically containing " << count << " items." << endl;
               readCalendarFolder( *(*it)->id, itemCounts );
               haveReadFolder = true;
               *mCalendarFolder = *((*it)->id);
             }
-            else if ( fld->folderType == Checklist ) {
+            else if ( *(fld->folderType) == Checklist ) {
               kdDebug() << "Reading folder " <<  (*(*it)->id).c_str() << ", of type Checklist, physically containing " << count << " items." << endl;
               readCalendarFolder( *(*it)->id, itemCounts );
               haveReadFolder = true;
@@ -562,6 +562,7 @@
           else {
             ngwt__Note *n = dynamic_cast<ngwt__Note *>( *it );
             if ( n ) {
+              kdDebug() << "found a Note" << endl;
               i = conv.convertFromNote( n );
               counts.notes++;
             }
@@ -646,17 +647,19 @@
   soap_call___ngw__getDeltasRequest( mSoap, mUrl.latin1(),
                                               NULL, &request, &response);
   soap_print_fault( mSoap, stderr );
-
-  std::vector<class ngwt__Item * > *items = &response.items->item;
-  if ( items ) {
+  response.items->item;
+  
+  
+  if ( response.items ) {
+    std::vector<class ngwt__Item * > items = response.items->item;
 #if 1
-    kdDebug() << "ReadAddressBooksJob::UpdateAddressBooksJob() - got " << items->size() << "contacts" << endl;
+    kdDebug() << "ReadAddressBooksJob::UpdateAddressBooksJob() - got " << items.size() << "contacts" << endl;
 #endif
     KABC::Addressee::List contacts;
     ContactConverter converter( mSoap );
 
     std::vector<class ngwt__Item * >::const_iterator it;
-    for ( it = items->begin(); it != items->end(); ++it ) {
+    for ( it = items.begin(); it != items.end(); ++it ) {
       ngwt__Item *item = *it;
 
 #if 1
Index: kresources/groupwise/soap/incidenceconverter.h
===================================================================
--- kresources/groupwise/soap/incidenceconverter.h	(revision 529489)
+++ kresources/groupwise/soap/incidenceconverter.h	(revision 529541)
@@ -61,7 +61,7 @@
     void setRecurrence( KCal::Incidence *, ngwt__CalendarItem * );
 
     // used for converting weekly recurrences from GW
-    QBitArray getDayBitArray( ngwt__DayOfWeekList * );
+//     QBitArray getDayBitArray( ngwt__DayOfWeekList * );
 
     ngwt__Recipient *createRecipient( const QString &name,
       const QString &email, const QString &uuid = QString::null );
Index: kresources/groupwise/soap/contactconverter.cpp
===================================================================
--- kresources/groupwise/soap/contactconverter.cpp	(revision 529489)
+++ kresources/groupwise/soap/contactconverter.cpp	(revision 529541)
@@ -35,7 +35,7 @@
 
   ngwt__Contact* contact = soap_new_ngwt__Contact( soap(), -1 );
 
-  // ngwt_Contact
+  // ngwt__Contact
   contact->fullName = 0;
   contact->emailList = 0;
   contact->imList = 0;
@@ -43,9 +43,14 @@
   contact->officeInfo = 0;
   contact->personalInfo = 0;
   contact->referenceInfo = 0;
-  // ngwt_AddressBookItem
+  // ngwt__AddressBookItem
   contact->uuid = 0;
   contact->comment = 0;
+  contact->sync = 0;
+  contact->domain = 0;
+  contact->postOffice = 0;
+  contact->distinguishedName = 0;
+  contact->userid = 0;
   // ngwt__ContainerItem
   contact->categories = 0;
   contact->created = 0;
Index: kresources/groupwise/kioslave/groupwise.cpp
===================================================================
--- kresources/groupwise/kioslave/groupwise.cpp	(revision 529489)
+++ kresources/groupwise/kioslave/groupwise.cpp	(revision 529541)
@@ -114,7 +114,7 @@
       getAddressbook( url );
   } else {
     QString error = i18n("Unknown path. Known paths are '/freebusy/', "
-      "'/calendar/' and '/addressbook/'.");
+        "'/calendar/' and '/addressbook/'.") + QString(" path was %1" ).arg( url.url() );
     errorMessage( error );
   }
   
@@ -134,8 +134,7 @@
   if ( url.port() ) 
     u += QString::number( url.port() );
   else {
-    if ( useSsl ) u += "8201";
-    else u += "7181";
+    u += "7191";
   }
 
   // check for a soap path in the URL
