Skip to content

Commit ba69b7f

Browse files
committed
exchange2007CompatibilityMode flag is now taken into account to create the request SOAP version header. Previously a Exchange2007_SP1 version was always sent as Exchange2007 (with potential problem like no access to PublicFoldersRoot). Now behaviour can be decided than to the flag.
1 parent 5ca2212 commit ba69b7f

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/main/java/microsoft/exchange/webservices/data/ExchangeService.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ public final class ExchangeService extends ExchangeServiceBase implements
6565
*/
6666
private UnifiedMessaging unifiedMessaging;
6767

68-
// private boolean exchange2007CompatibilityMode;
6968
private boolean enableScpLookup = true;
7069

71-
private boolean exchange2007CompatibilityMode;
70+
/**
71+
* When false, used to indicate that we should use "Exchange2007" as the server version String rather than
72+
* Exchange2007_SP1 (@see #getExchange2007CompatibilityMode).
73+
*
74+
*/
75+
private boolean exchange2007CompatibilityMode = false;
7276

7377
/**
7478
* Create response object.
@@ -3833,11 +3837,11 @@ public void setEnableScpLookup(boolean value) {
38333837
* should use "Exchange2007" as the server version String rather than
38343838
* Exchange2007_SP1. </remarks>
38353839
*/
3836-
protected boolean getExchange2007CompatibilityMode() {
3840+
public boolean getExchange2007CompatibilityMode() {
38373841
return this.exchange2007CompatibilityMode;
38383842
}
38393843

3840-
protected void setExchange2007CompatibilityMode(boolean value) {
3844+
public void setExchange2007CompatibilityMode(boolean value) {
38413845
this.exchange2007CompatibilityMode = value;
38423846
}
38433847

src/main/java/microsoft/exchange/webservices/data/ServiceRequestBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ protected void writeToXml(EwsServiceXmlWriter writer) throws Exception {
285285
* @return String representation of requested server version.
286286
*/
287287
private String getRequestedServiceVersionString() {
288-
if (this.service.getRequestedServerVersion() == ExchangeVersion.Exchange2007_SP1) {
288+
if (this.service.getRequestedServerVersion() == ExchangeVersion.Exchange2007_SP1 && this.service.getExchange2007CompatibilityMode()) {
289289
return "Exchange2007";
290290
} else {
291291
return this.service.getRequestedServerVersion().toString();

0 commit comments

Comments
 (0)