Working Wizard

This commit is contained in:
Yann Diorcet 2012-08-02 11:24:13 +02:00
parent 02809b3644
commit c34f09e2d1
97 changed files with 12758 additions and 149 deletions

View file

@ -266,6 +266,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
}
#pragma mark - Keyboard Event Functions
- (void)keyboardWillHide:(NSNotification *)notif {

View file

@ -122,22 +122,19 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)registrationUpdate:(LinphoneRegistrationState)state {
switch (state) {
case LinphoneRegistrationOk:
{
case LinphoneRegistrationOk: {
[[LinphoneManager instance].settingsStore setBool:false forKey:@"enable_first_login_view_preference"];
[self.waitView setHidden:true];
[waitView setHidden:true];
[[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]];
break;
}
case LinphoneRegistrationNone:
case LinphoneRegistrationCleared:
{
[self.waitView setHidden:true];
case LinphoneRegistrationCleared: {
[waitView setHidden:true];
break;
}
case LinphoneRegistrationFailed:
{
[self.waitView setHidden:true];
case LinphoneRegistrationFailed: {
[waitView setHidden:true];
//default behavior if no registration delegates
/*UIAlertView* error = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"Registration failure for user %@", usernameField.text]
@ -153,7 +150,7 @@ static UICompositeViewDescription *compositeDescription = nil;
break;
}
case LinphoneRegistrationProgress: {
[self.waitView setHidden:false];
[waitView setHidden:false];
break;
}
default: break;

View file

@ -82,6 +82,7 @@ typedef struct _LinphoneCallAppData {
+ (BOOL)isNotIphone3G;
+ (NSString *)getPreferenceForCodec: (const char*) name withRate: (int) rate;
+ (NSSet *)unsupportedCodecs;
+ (NSString *)getUserAgent;
- (void)startLibLinphone;
- (void)destroyLibLinphone;

View file

@ -138,6 +138,14 @@ struct codec_name_pref_table codec_pref_table[]={
return result;
}
+ (NSString *)getUserAgent {
return [NSString stringWithFormat:@"LinphoneIphone/%@ (Linphone/%s; Apple %@/%@)",
[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey],
linphone_core_get_version(),
[UIDevice currentDevice].systemName,
[UIDevice currentDevice].systemVersion];
}
+ (LinphoneManager*)instance {
if(theLinphoneManager == nil) {
theLinphoneManager = [LinphoneManager alloc];

View file

@ -378,7 +378,7 @@
// Update rotation
UIInterfaceOrientation correctOrientation = [self getCorrectInterfaceOrientation:[[UIDevice currentDevice] orientation]];
if(currentOrientation != correctOrientation) {
[PhoneMainView forceOrientation:correctOrientation];
[PhoneMainView forceOrientation:correctOrientation animated:currentOrientation!=UIDeviceOrientationUnknown];
}
currentOrientation = correctOrientation;
[self updateInterfaceOrientation:correctOrientation];

View file

@ -60,7 +60,7 @@
- (void)showStateBar:(BOOL)show;
- (void)showTabBar:(BOOL)show;
- (void)fullScreen:(BOOL)enabled;
+ (void)forceOrientation:(UIInterfaceOrientation)orientation;
+ (void)forceOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated;
+ (PhoneMainView*) instance;

View file

@ -172,7 +172,7 @@ static PhoneMainView* phoneMainViewInstance=nil;
/*
Will simulate a device rotation
*/
+ (void)forceOrientation:(UIInterfaceOrientation)orientation {
+ (void)forceOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
for(UIWindow *window in [[UIApplication sharedApplication] windows]) {
UIView *view = window;
UIViewController *controller = nil;
@ -182,9 +182,16 @@ static PhoneMainView* phoneMainViewInstance=nil;
view = controller.view;
}
UIInterfaceOrientation oldOrientation = controller.interfaceOrientation;
[controller willRotateToInterfaceOrientation:orientation duration:0.3];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3];
NSTimeInterval animationDuration = 0.0;
if(animated) {
animationDuration = 0.3f;
}
[controller willRotateToInterfaceOrientation:orientation duration:animationDuration];
if(animated) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:animationDuration];
}
switch (orientation) {
case UIInterfaceOrientationPortrait:
[view setTransform: CGAffineTransformMakeRotation(0)];
@ -204,8 +211,10 @@ static PhoneMainView* phoneMainViewInstance=nil;
if([window isKindOfClass:[UILinphoneWindow class]]) {
[view setFrame:frame];
}
[controller willAnimateRotationToInterfaceOrientation:orientation duration:0.3];
[UIView commitAnimations];
[controller willAnimateRotationToInterfaceOrientation:orientation duration:animationDuration];
if(animated) {
[UIView commitAnimations];
}
[controller didRotateFromInterfaceOrientation:oldOrientation];
}
[[UIApplication sharedApplication] setStatusBarOrientation:orientation animated:TRUE];

View file

@ -0,0 +1,16 @@
ARCHS = $(ARCHS_STANDARD_32_64_BIT)
VALID_ARCHS = i386 ppc x86_64
SDKROOT = macosx10.6
RUN_CLANG_STATIC_ANALYZER = YES
GCC_C_LANGUAGE_STANDARD = gnu99
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_MODEL_TUNING = G5
GCC_WARN_ABOUT_MISSING_NEWLINE = YES
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_UNUSED_VARIABLE = YES
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = NO
GCC_TREAT_WARNINGS_AS_ERRORS = YES

View file

@ -0,0 +1,6 @@
#include "Common.xcconfig"
DEBUG_INFORMATION_FORMAT = dwarf
GCC_DYNAMIC_NO_PIC = NO
GCC_OPTIMIZATION_LEVEL = 0

View file

@ -0,0 +1,3 @@
#include "Common.xcconfig"
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym

View file

@ -0,0 +1,12 @@
PRODUCT_NAME = XMLRPC
INFOPLIST_FILE = Resources/Property Lists/XMLRPC-Info.plist
FRAMEWORK_VERSION = A
DYLIB_CURRENT_VERSION = 1
DYLIB_COMPATIBILITY_VERSION = 1
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_PREFIX_HEADER = XMLRPC.pch
GCC_ENABLE_OBJC_GC = supported
INSTALL_PATH = @loader_path/../Frameworks

View file

@ -0,0 +1,2 @@
#include "XMLRPC.xcconfig"
#include "CommonDevelopment.xcconfig"

View file

@ -0,0 +1,2 @@
#include "XMLRPC.xcconfig"
#include "CommonRelease.xcconfig"

View file

@ -0,0 +1,7 @@
PRODUCT_NAME = XMLRPCUnitTests
INFOPLIST_FILE = Resources/Property Lists/XMLRPCUnitTests-Info.plist
WRAPPER_EXTENSION=octest
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_PREFIX_HEADER = XMLRPC.pch

View file

@ -0,0 +1,2 @@
#include "XMLRPCUnitTests.xcconfig"
#include "CommonDevelopment.xcconfig"

View file

@ -0,0 +1,2 @@
#include "XMLRPCUnitTests.xcconfig"
#include "CommonRelease.xcconfig"

23
Classes/Utils/XMLRPC/LICENSE.md Executable file
View file

@ -0,0 +1,23 @@
# License
## The Cocoa XML-RPC Framework is distributed under the MIT License:
Copyright (c) 2012 Eric Czarny <eczarny@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,42 @@
//
// NSData+Base64.h
// base64
//
// Created by Matt Gallagher on 2009/06/03.
// Copyright 2009 Matt Gallagher. All rights reserved.
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software. Permission is granted to anyone to
// use this software for any purpose, including commercial applications, and to
// alter it and redistribute it freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source
// distribution.
//
#import <Foundation/Foundation.h>
void *NewBase64Decode(
const char *inputBuffer,
size_t length,
size_t *outputLength);
char *NewBase64Encode(
const void *inputBuffer,
size_t length,
bool separateLines,
size_t *outputLength);
@interface NSData (Base64)
+ (NSData *)dataFromBase64String:(NSString *)aString;
- (NSString *)base64EncodedString;
@end

View file

@ -0,0 +1,313 @@
//
// NSData+Base64.m
// base64
//
// Created by Matt Gallagher on 2009/06/03.
// Copyright 2009 Matt Gallagher. All rights reserved.
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software. Permission is granted to anyone to
// use this software for any purpose, including commercial applications, and to
// alter it and redistribute it freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source
// distribution.
//
#import "NSData+Base64.h"
//
// Mapping from 6 bit pattern to ASCII character.
//
static unsigned char base64EncodeLookup[65] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
//
// Definition for "masked-out" areas of the base64DecodeLookup mapping
//
#define xx 65
//
// Mapping from ASCII character to 6 bit pattern.
//
static unsigned char base64DecodeLookup[256] =
{
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 62, xx, xx, xx, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, xx, xx, xx, xx, xx, xx,
xx, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, xx, xx, xx, xx, xx,
xx, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
};
//
// Fundamental sizes of the binary and base64 encode/decode units in bytes
//
#define BINARY_UNIT_SIZE 3
#define BASE64_UNIT_SIZE 4
//
// NewBase64Decode
//
// Decodes the base64 ASCII string in the inputBuffer to a newly malloced
// output buffer.
//
// inputBuffer - the source ASCII string for the decode
// length - the length of the string or -1 (to specify strlen should be used)
// outputLength - if not-NULL, on output will contain the decoded length
//
// returns the decoded buffer. Must be free'd by caller. Length is given by
// outputLength.
//
void *NewBase64Decode(
const char *inputBuffer,
size_t length,
size_t *outputLength)
{
if (length == -1)
{
length = strlen(inputBuffer);
}
size_t outputBufferSize =
((length+BASE64_UNIT_SIZE-1) / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE;
unsigned char *outputBuffer = (unsigned char *)malloc(outputBufferSize);
size_t i = 0;
size_t j = 0;
while (i < length)
{
//
// Accumulate 4 valid characters (ignore everything else)
//
unsigned char accumulated[BASE64_UNIT_SIZE];
size_t accumulateIndex = 0;
while (i < length)
{
unsigned char decode = base64DecodeLookup[inputBuffer[i++]];
if (decode != xx)
{
accumulated[accumulateIndex] = decode;
accumulateIndex++;
if (accumulateIndex == BASE64_UNIT_SIZE)
{
break;
}
}
}
//
// Store the 6 bits from each of the 4 characters as 3 bytes
//
// (Uses improved bounds checking suggested by Alexandre Colucci)
//
if(accumulateIndex >= 2)
outputBuffer[j] = (accumulated[0] << 2) | (accumulated[1] >> 4);
if(accumulateIndex >= 3)
outputBuffer[j + 1] = (accumulated[1] << 4) | (accumulated[2] >> 2);
if(accumulateIndex >= 4)
outputBuffer[j + 2] = (accumulated[2] << 6) | accumulated[3];
j += accumulateIndex - 1;
}
if (outputLength)
{
*outputLength = j;
}
return outputBuffer;
}
//
// NewBase64Encode
//
// Encodes the arbitrary data in the inputBuffer as base64 into a newly malloced
// output buffer.
//
// inputBuffer - the source data for the encode
// length - the length of the input in bytes
// separateLines - if zero, no CR/LF characters will be added. Otherwise
// a CR/LF pair will be added every 64 encoded chars.
// outputLength - if not-NULL, on output will contain the encoded length
// (not including terminating 0 char)
//
// returns the encoded buffer. Must be free'd by caller. Length is given by
// outputLength.
//
char *NewBase64Encode(
const void *buffer,
size_t length,
bool separateLines,
size_t *outputLength)
{
const unsigned char *inputBuffer = (const unsigned char *)buffer;
#define MAX_NUM_PADDING_CHARS 2
#define OUTPUT_LINE_LENGTH 64
#define INPUT_LINE_LENGTH ((OUTPUT_LINE_LENGTH / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE)
#define CR_LF_SIZE 2
//
// Byte accurate calculation of final buffer size
//
size_t outputBufferSize =
((length / BINARY_UNIT_SIZE)
+ ((length % BINARY_UNIT_SIZE) ? 1 : 0))
* BASE64_UNIT_SIZE;
if (separateLines)
{
outputBufferSize +=
(outputBufferSize / OUTPUT_LINE_LENGTH) * CR_LF_SIZE;
}
//
// Include space for a terminating zero
//
outputBufferSize += 1;
//
// Allocate the output buffer
//
char *outputBuffer = (char *)malloc(outputBufferSize);
if (!outputBuffer)
{
return NULL;
}
size_t i = 0;
size_t j = 0;
const size_t lineLength = separateLines ? INPUT_LINE_LENGTH : length;
size_t lineEnd = lineLength;
while (true)
{
if (lineEnd > length)
{
lineEnd = length;
}
for (; i + BINARY_UNIT_SIZE - 1 < lineEnd; i += BINARY_UNIT_SIZE)
{
//
// Inner loop: turn 48 bytes into 64 base64 characters
//
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2];
outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4)
| ((inputBuffer[i + 1] & 0xF0) >> 4)];
outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i + 1] & 0x0F) << 2)
| ((inputBuffer[i + 2] & 0xC0) >> 6)];
outputBuffer[j++] = base64EncodeLookup[inputBuffer[i + 2] & 0x3F];
}
if (lineEnd == length)
{
break;
}
//
// Add the newline
//
outputBuffer[j++] = '\r';
outputBuffer[j++] = '\n';
lineEnd += lineLength;
}
if (i + 1 < length)
{
//
// Handle the single '=' case
//
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2];
outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4)
| ((inputBuffer[i + 1] & 0xF0) >> 4)];
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i + 1] & 0x0F) << 2];
outputBuffer[j++] = '=';
}
else if (i < length)
{
//
// Handle the double '=' case
//
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2];
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0x03) << 4];
outputBuffer[j++] = '=';
outputBuffer[j++] = '=';
}
outputBuffer[j] = 0;
//
// Set the output length and return the buffer
//
if (outputLength)
{
*outputLength = j;
}
return outputBuffer;
}
@implementation NSData (Base64)
//
// dataFromBase64String:
//
// Creates an NSData object containing the base64 decoded representation of
// the base64 string 'aString'
//
// Parameters:
// aString - the base64 string to decode
//
// returns the autoreleased NSData representation of the base64 string
//
+ (NSData *)dataFromBase64String:(NSString *)aString
{
NSData *data = [aString dataUsingEncoding:NSASCIIStringEncoding];
size_t outputLength;
void *outputBuffer = NewBase64Decode([data bytes], [data length], &outputLength);
NSData *result = [NSData dataWithBytes:outputBuffer length:outputLength];
free(outputBuffer);
return result;
}
//
// base64EncodedString
//
// Creates an NSString object that contains the base 64 encoding of the
// receiver's data. Lines are broken at 64 characters long.
//
// returns an autoreleased NSString being the base 64 representation of the
// receiver.
//
- (NSString *)base64EncodedString
{
size_t outputLength;
char *outputBuffer =
NewBase64Encode([self bytes], [self length], true, &outputLength);
NSString *result =[[NSString alloc] initWithBytes:outputBuffer
length:outputLength
encoding:NSASCIIStringEncoding];
#if ! __has_feature(objc_arc)
[result autorelease];
#endif
free(outputBuffer);
return result;
}
@end

View file

@ -0,0 +1,13 @@
#import <Foundation/Foundation.h>
@interface NSString (NSStringAdditions)
+ (NSString *)stringByGeneratingUUID;
#pragma mark -
- (NSString *)unescapedString;
- (NSString *)escapedString;
@end

View file

@ -0,0 +1,46 @@
#import "NSStringAdditions.h"
@implementation NSString (NSStringAdditions)
+ (NSString *)stringByGeneratingUUID {
CFUUIDRef UUIDReference = CFUUIDCreate(nil);
CFStringRef temporaryUUIDString = CFUUIDCreateString(nil, UUIDReference);
CFRelease(UUIDReference);
#if ! __has_feature(objc_arc)
return [NSMakeCollectable(temporaryUUIDString) autorelease];
#else
return (__bridge_transfer NSString*)temporaryUUIDString;
#endif
}
#pragma mark -
- (NSString *)unescapedString {
NSMutableString *string = [NSMutableString stringWithString: self];
[string replaceOccurrencesOfString: @"&amp;" withString: @"&" options: NSLiteralSearch range: NSMakeRange(0, [string length])];
[string replaceOccurrencesOfString: @"&quot;" withString: @"\"" options: NSLiteralSearch range: NSMakeRange(0, [string length])];
[string replaceOccurrencesOfString: @"&#x27;" withString: @"'" options: NSLiteralSearch range: NSMakeRange(0, [string length])];
[string replaceOccurrencesOfString: @"&#x39;" withString: @"'" options: NSLiteralSearch range: NSMakeRange(0, [string length])];
[string replaceOccurrencesOfString: @"&#x92;" withString: @"'" options: NSLiteralSearch range: NSMakeRange(0, [string length])];
[string replaceOccurrencesOfString: @"&#x96;" withString: @"'" options: NSLiteralSearch range: NSMakeRange(0, [string length])];
[string replaceOccurrencesOfString: @"&gt;" withString: @">" options: NSLiteralSearch range: NSMakeRange(0, [string length])];
[string replaceOccurrencesOfString: @"&lt;" withString: @"<" options: NSLiteralSearch range: NSMakeRange(0, [string length])];
return [NSString stringWithString: string];
}
- (NSString *)escapedString {
NSMutableString *string = [NSMutableString stringWithString: self];
// NOTE: we use unicode entities instead of &amp; &gt; &lt; etc. since some hosts (powweb, fatcow, and similar)
// have a weird PHP/libxml2 combination that ignores regular entities
[string replaceOccurrencesOfString: @"&" withString: @"&#38;" options: NSLiteralSearch range: NSMakeRange(0, [string length])];
[string replaceOccurrencesOfString: @">" withString: @"&#62;" options: NSLiteralSearch range: NSMakeRange(0, [string length])];
[string replaceOccurrencesOfString: @"<" withString: @"&#60;" options: NSLiteralSearch range: NSMakeRange(0, [string length])];
return [NSString stringWithString: string];
}
@end

87
Classes/Utils/XMLRPC/README.md Executable file
View file

@ -0,0 +1,87 @@
# The Cocoa XML-RPC Framework
The Cocoa XML-RPC Framework is a simple, and lightweight, XML-RPC client framework written in Objective-C.
# Requirements
The Cocoa XML-RPC Framework has been built, and designed, for Mac OS X 10.5 or later. This release should provide basic iPhone and iPod touch support.
This version of the Cocoa XML-RPC Framework includes a new event-based XML parser. The previous tree-based XML parser still exists, but is no longer the default XML-RPC response parser nor included in the Xcode build. This should hopefully provide better compatibility with the iPhone SDK.
# Usage
The following example of the Cocoa XML-RPC Framework assumes that the included XML-RPC test server is available. More information on the test server can be found in the README under:
XMLRPC\Tools\Test Server
Please review this document before moving forward.
## Invoking XML-RPC requests through the XML-RPC connection manager
Invoking an XML-RPC request through the XML-RPC connection manager is easy:
NSURL *URL = [NSURL URLWithString: @"http://127.0.0.1:8080/"];
XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithURL: URL];
XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager];
[request setMethod: @"Echo.echo" withParameter: @"Hello World!"];
NSLog(@"Request body: %@", [request body]);
[manager spawnConnectionWithXMLRPCRequest: request delegate: self];
[request release];
This spawns a new XML-RPC connection, assigning that connection with a unique identifer and returning it to the sender. This unique identifier, a UUID expressed as an NSString, can then be used to obtain the XML-RPC connection from the XML-RPC connection manager, as long as it is still active.
The XML-RPC connection manager has been designed to ease the management of active XML-RPC connections. For example, the following method obtains an NSArray of active XML-RPC connection identifiers:
- (NSArray *)activeConnectionIdentifiers;
The NSArray returned by this method contains a list of each active connection identifier. Provided with a connection identifier, the following method will return an instance of the requested XML-RPC connection:
- (XMLRPCConnection *)connectionForIdentifier: (NSString *)connectionIdentifier;
Finally, for a delegate to receive XML-RPC responses, authentication challenges, or errors, the XMLRPCConnectionDelegate protocol must be implemented. For example, the following will handle successful XML-RPC responses:
- (void)request: (XMLRPCRequest *)request didReceiveResponse: (XMLRPCResponse *)response {
if ([response isFault]) {
NSLog(@"Fault code: %@", [response faultCode]);
NSLog(@"Fault string: %@", [response faultString]);
} else {
NSLog(@"Parsed response: %@", [response object]);
}
NSLog(@"Response body: %@", [response body]);
}
Refer to XMLRPCConnectionDelegate.h for a full list of methods a delegate must implement. Each of these delegate methods plays a role in the life of an active XML-RPC connection.
## Sending synchronous XML-RPC requests
There are situations where it may be desirable to invoke XML-RPC requests synchronously in another thread or background process. The following method declared in XMLRPCConnection.h will invoke an XML-RPC request synchronously:
+ (XMLRPCResponse *)sendSynchronousXMLRPCRequest: (XMLRPCRequest *)request error: (NSError **)error;
If there is a problem sending the XML-RPC request expect nil to be returned.
# What if I find a bug, or what if I want to help?
Please, contact me with any questions, comments, suggestions, or problems. I try to make the time to answer every request.
Those wishing to contribute to the project should begin by obtaining the latest source with Git. The project is hosted on GitHub, making it easy for anyone to make contributions. Simply create a fork and make your changes.
# Acknowledgments
The Base64 encoder/decoder found in NSData+Base64 is created by [Matt Gallagher](http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html).
The idea for this framework came from examples provided by Brent Simmons, the creator of NetNewsWire.
# License
Copyright (c) 2012 Eric Czarny.
The Cocoa XML-RPC Framework should be accompanied by a LICENSE file, this file contains the license relevant to this distribution.
If no LICENSE exists please contact Eric Czarny <eczarny@gmail.com>.

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AlternativeDateFormatsTestCase</key>
<array>
<date>2009-12-02T01:49:00Z</date>
<date>2009-12-02T01:50:00Z</date>
</array>
<key>DefaultTypeTestCase</key>
<string>Hello World!</string>
<key>EmptyBooleanTestCase</key>
<integer>0</integer>
<key>EmptyDataTestCase</key>
<data></data>
<key>EmptyDoubleTestCase</key>
<integer>0</integer>
<key>EmptyIntegerTestCase</key>
<integer>0</integer>
<key>EmptyStringTestCase</key>
<string></string>
<key>SimpleArrayTestCase</key>
<array>
<string>Hello World!</string>
<integer>42</integer>
<real>3.14</real>
<integer>1</integer>
<date>2009-07-18T21:34:00Z</date>
<data>eW91IGNhbid0IHJlYWQgdGhpcyE=</data>
</array>
<key>SimpleStructTestCase</key>
<dict>
<key>Name</key>
<string>Eric Czarny</string>
<key>Birthday</key>
<date>1984-04-15T05:00:00Z</date>
<key>Age</key>
<integer>25</integer>
</dict>
</dict>
</plist>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>XMLRPC</string>
<key>CFBundleIdentifier</key>
<string>com.divisiblebyzero.XMLRPC</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>XMLRPC</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>
<string>ZERO</string>
<key>CFBundleVersion</key>
<string>2.2.1</string>
<key>CFBundleShortVersionString</key>
<string>2.2.1</string>
</dict>
</plist>

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.divisiblebyzero.XMLRPCUnitTests</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>XMLRPCUnitTests</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>ZERO</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
</dict>
</plist>

View file

@ -0,0 +1,15 @@
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value><dateTime.iso8601>20091201T20:49:00</dateTime.iso8601></value>
<value><dateTime.iso8601>2009-12-01T20:50:00</dateTime.iso8601></value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>

View file

@ -0,0 +1,8 @@
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value>Hello World!</value>
</param>
</params>
</methodResponse>

View file

@ -0,0 +1,8 @@
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value><boolean></boolean></value>
</param>
</params>
</methodResponse>

View file

@ -0,0 +1,8 @@
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value><base64></base64></value>
</param>
</params>
</methodResponse>

View file

@ -0,0 +1,8 @@
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value><double></double></value>
</param>
</params>
</methodResponse>

View file

@ -0,0 +1,8 @@
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value><i4></i4></value>
</param>
</params>
</methodResponse>

View file

@ -0,0 +1,8 @@
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value></value>
</param>
</params>
</methodResponse>

View file

@ -0,0 +1,19 @@
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value><string>Hello World!</string></value>
<value><int>42</int></value>
<value><double>3.14</double></value>
<value><boolean>1</boolean></value>
<value><dateTime.iso8601>20090718T17:34:00</dateTime.iso8601></value>
<value><base64>eW91IGNhbid0IHJlYWQgdGhpcyE=</base64></value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>

View file

@ -0,0 +1,23 @@
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>Name</name>
<value><string>Eric Czarny</string></value>
</member>
<member>
<name>Birthday</name>
<value><dateTime.iso8601>1984-04-15T00:00:00</dateTime.iso8601></value>
</member>
<member>
<name>Age</name>
<value><i4>25</i4></value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>

View file

@ -0,0 +1,14 @@
ARCHS = $(ARCHS_STANDARD_32_64_BIT)
VALID_ARCHS = i386 ppc x86_64
SDKROOT = macosx10.6
PREBINDING = NO
GCC_C_LANGUAGE_STANDARD = gnu99
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_MODEL_TUNING = G5
GCC_WARN_ABOUT_MISSING_NEWLINE = YES
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_UNUSED_VARIABLE = YES
GCC_TREAT_WARNINGS_AS_ERRORS = YES

View file

@ -0,0 +1,7 @@
#include "Common.xcconfig"
ONLY_ACTIVE_ARCH = YES
DEBUG_INFORMATION_FORMAT = dwarf
GCC_OPTIMIZATION_LEVEL = 0

View file

@ -0,0 +1,5 @@
#include "Common.xcconfig"
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
GCC_OPTIMIZATION_LEVEL = s

View file

@ -0,0 +1,7 @@
PRODUCT_NAME = Test Client
INFOPLIST_FILE = TestClient-Info.plist
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_PREFIX_HEADER = TestClient.pch
INSTALL_PATH = /Applications

View file

@ -0,0 +1,2 @@
#include "TestClient.xcconfig"
#include "CommonDevelopment.xcconfig"

View file

@ -0,0 +1,2 @@
#include "TestClient.xcconfig"
#include "CommonRelease.xcconfig"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,401 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
070043021144653D000D05B6 /* TestClient.xib in Resources */ = {isa = PBXBuildFile; fileRef = 070043001144653D000D05B6 /* TestClient.xib */; };
070043051144656D000D05B6 /* TestClientXMLParserWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 070043031144656D000D05B6 /* TestClientXMLParserWindow.xib */; };
0700430C11446593000D05B6 /* TestClientMainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0700430A11446593000D05B6 /* TestClientMainWindow.xib */; };
070043131144667B000D05B6 /* TestClientApplicationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0700430E1144667B000D05B6 /* TestClientApplicationController.m */; };
070043141144667B000D05B6 /* TestClientMainWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 070043101144667B000D05B6 /* TestClientMainWindowController.m */; };
070043151144667B000D05B6 /* TestClientXMLParserWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 070043121144667B000D05B6 /* TestClientXMLParserWindowController.m */; };
07E6DAB013679C6E00454D31 /* XMLRPC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07E6DAA513679B7600454D31 /* XMLRPC.framework */; };
07E6DAB213679F3000454D31 /* XMLRPC.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 07E6DAA513679B7600454D31 /* XMLRPC.framework */; };
2DC70E311004D90100BBEEA6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2DC70E2F1004D90100BBEEA6 /* InfoPlist.strings */; };
2DC70E381004D90F00BBEEA6 /* Common.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 2DC70E321004D90F00BBEEA6 /* Common.xcconfig */; };
2DC70E391004D90F00BBEEA6 /* CommonDevelopment.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 2DC70E331004D90F00BBEEA6 /* CommonDevelopment.xcconfig */; };
2DC70E3A1004D90F00BBEEA6 /* CommonRelease.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 2DC70E341004D90F00BBEEA6 /* CommonRelease.xcconfig */; };
2DC70E3B1004D90F00BBEEA6 /* TestClientDevelopment.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 2DC70E351004D90F00BBEEA6 /* TestClientDevelopment.xcconfig */; };
2DC70E3C1004D90F00BBEEA6 /* TestClientRelease.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 2DC70E361004D90F00BBEEA6 /* TestClientRelease.xcconfig */; };
2DC70E3D1004D90F00BBEEA6 /* TestClient.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 2DC70E371004D90F00BBEEA6 /* TestClient.xcconfig */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
07E6DAB113679F1400454D31 /* Copy Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
07E6DAB213679F3000454D31 /* XMLRPC.framework in Copy Frameworks */,
);
name = "Copy Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
070043011144653D000D05B6 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Languages/English.lproj/TestClient.xib; sourceTree = "<group>"; };
070043041144656D000D05B6 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Languages/English.lproj/TestClientXMLParserWindow.xib; sourceTree = "<group>"; };
0700430B11446593000D05B6 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Languages/English.lproj/TestClientMainWindow.xib; sourceTree = "<group>"; };
0700430D1144667B000D05B6 /* TestClientApplicationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestClientApplicationController.h; sourceTree = "<group>"; };
0700430E1144667B000D05B6 /* TestClientApplicationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestClientApplicationController.m; sourceTree = "<group>"; };
0700430F1144667B000D05B6 /* TestClientMainWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestClientMainWindowController.h; sourceTree = "<group>"; };
070043101144667B000D05B6 /* TestClientMainWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestClientMainWindowController.m; sourceTree = "<group>"; };
070043111144667B000D05B6 /* TestClientXMLParserWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestClientXMLParserWindowController.h; sourceTree = "<group>"; };
070043121144667B000D05B6 /* TestClientXMLParserWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestClientXMLParserWindowController.m; sourceTree = "<group>"; };
0759A73511434C0D000DFE98 /* XMLRPCEventBasedParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLRPCEventBasedParser.h; path = ../../XMLRPCEventBasedParser.h; sourceTree = SOURCE_ROOT; };
0759A73C11434C3C000DFE98 /* XMLRPCEventBasedParserDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLRPCEventBasedParserDelegate.h; path = ../../XMLRPCEventBasedParserDelegate.h; sourceTree = SOURCE_ROOT; };
07E6DAA513679B7600454D31 /* XMLRPC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XMLRPC.framework; path = "../../../../../../Library/Developer/Xcode/DerivedData/XMLRPC-gcawxlhfrkyvgjeolligeasrfeux/Build/Products/Development/XMLRPC.framework"; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
2DC70E301004D90100BBEEA6 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = Languages/English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
2DC70E321004D90F00BBEEA6 /* Common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Common.xcconfig; path = Configurations/Common.xcconfig; sourceTree = "<group>"; };
2DC70E331004D90F00BBEEA6 /* CommonDevelopment.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CommonDevelopment.xcconfig; path = Configurations/CommonDevelopment.xcconfig; sourceTree = "<group>"; };
2DC70E341004D90F00BBEEA6 /* CommonRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CommonRelease.xcconfig; path = Configurations/CommonRelease.xcconfig; sourceTree = "<group>"; };
2DC70E351004D90F00BBEEA6 /* TestClientDevelopment.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = TestClientDevelopment.xcconfig; path = Configurations/TestClientDevelopment.xcconfig; sourceTree = "<group>"; };
2DC70E361004D90F00BBEEA6 /* TestClientRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = TestClientRelease.xcconfig; path = Configurations/TestClientRelease.xcconfig; sourceTree = "<group>"; };
2DC70E371004D90F00BBEEA6 /* TestClient.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = TestClient.xcconfig; path = Configurations/TestClient.xcconfig; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* TestClient.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestClient.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* TestClient-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "TestClient-Info.plist"; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* Test Client.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Test Client.app"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8D11072E0486CEB800E47090 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
07E6DAB013679C6E00454D31 /* XMLRPC.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
0759A75B11434CC8000DFE98 /* Private Headers */ = {
isa = PBXGroup;
children = (
0759A73511434C0D000DFE98 /* XMLRPCEventBasedParser.h */,
0759A73C11434C3C000DFE98 /* XMLRPCEventBasedParserDelegate.h */,
);
name = "Private Headers";
sourceTree = "<group>";
};
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
0700430D1144667B000D05B6 /* TestClientApplicationController.h */,
0700430E1144667B000D05B6 /* TestClientApplicationController.m */,
0700430F1144667B000D05B6 /* TestClientMainWindowController.h */,
070043101144667B000D05B6 /* TestClientMainWindowController.m */,
070043111144667B000D05B6 /* TestClientXMLParserWindowController.h */,
070043121144667B000D05B6 /* TestClientXMLParserWindowController.m */,
);
name = Classes;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
07E6DAA513679B7600454D31 /* XMLRPC.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* Test Client.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* Test Client */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
0759A75B11434CC8000DFE98 /* Private Headers */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = "Test Client";
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
29B97316FDCFA39411CA2CEA /* main.m */,
32CA4F630368D1EE00C91783 /* TestClient.pch */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
2DC70E201004D85400BBEEA6 /* Configurations */,
2DC70E211004D85C00BBEEA6 /* Interface Builder */,
2DC70E221004D86F00BBEEA6 /* Localized Strings */,
2DC70E231004D87A00BBEEA6 /* Property Lists */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
2DC70E201004D85400BBEEA6 /* Configurations */ = {
isa = PBXGroup;
children = (
2DC70E321004D90F00BBEEA6 /* Common.xcconfig */,
2DC70E331004D90F00BBEEA6 /* CommonDevelopment.xcconfig */,
2DC70E341004D90F00BBEEA6 /* CommonRelease.xcconfig */,
2DC70E351004D90F00BBEEA6 /* TestClientDevelopment.xcconfig */,
2DC70E361004D90F00BBEEA6 /* TestClientRelease.xcconfig */,
2DC70E371004D90F00BBEEA6 /* TestClient.xcconfig */,
);
name = Configurations;
sourceTree = "<group>";
};
2DC70E211004D85C00BBEEA6 /* Interface Builder */ = {
isa = PBXGroup;
children = (
070043001144653D000D05B6 /* TestClient.xib */,
0700430A11446593000D05B6 /* TestClientMainWindow.xib */,
070043031144656D000D05B6 /* TestClientXMLParserWindow.xib */,
);
name = "Interface Builder";
sourceTree = "<group>";
};
2DC70E221004D86F00BBEEA6 /* Localized Strings */ = {
isa = PBXGroup;
children = (
2DC70E2F1004D90100BBEEA6 /* InfoPlist.strings */,
);
name = "Localized Strings";
sourceTree = "<group>";
};
2DC70E231004D87A00BBEEA6 /* Property Lists */ = {
isa = PBXGroup;
children = (
8D1107310486CEB800E47090 /* TestClient-Info.plist */,
);
name = "Property Lists";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* Test Client */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Test Client" */;
buildPhases = (
8D1107290486CEB800E47090 /* Resources */,
07E6DAB113679F1400454D31 /* Copy Frameworks */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
0759A72C11434B8D000DFE98 /* Run Script: Include Git commit hash */,
);
buildRules = (
);
dependencies = (
);
name = "Test Client";
productInstallPath = "$(HOME)/Applications";
productName = "XMLRPC Client";
productReference = 8D1107320486CEB800E47090 /* Test Client.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Test Client" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* Test Client */;
projectDirPath = "";
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* Test Client */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2DC70E381004D90F00BBEEA6 /* Common.xcconfig in Resources */,
2DC70E391004D90F00BBEEA6 /* CommonDevelopment.xcconfig in Resources */,
2DC70E3A1004D90F00BBEEA6 /* CommonRelease.xcconfig in Resources */,
2DC70E311004D90100BBEEA6 /* InfoPlist.strings in Resources */,
2DC70E3D1004D90F00BBEEA6 /* TestClient.xcconfig in Resources */,
070043021144653D000D05B6 /* TestClient.xib in Resources */,
2DC70E3B1004D90F00BBEEA6 /* TestClientDevelopment.xcconfig in Resources */,
0700430C11446593000D05B6 /* TestClientMainWindow.xib in Resources */,
2DC70E3C1004D90F00BBEEA6 /* TestClientRelease.xcconfig in Resources */,
070043051144656D000D05B6 /* TestClientXMLParserWindow.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
0759A72C11434B8D000DFE98 /* Run Script: Include Git commit hash */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script: Include Git commit hash";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /usr/bin/ruby;
shellScript = "raise \"Must be executed from within Xcode.\" unless ENV['XCODE_VERSION_ACTUAL']\n\ninfo_plist = \"#{ENV['BUILT_PRODUCTS_DIR']}/#{ENV['WRAPPER_NAME']}/Contents/Info.plist\"\n\nif !File.exist?('/usr/local/bin/git')\n exit\nend\n\ncommit = `/usr/local/bin/git rev-parse --short HEAD`.chomp!\n\nif commit.nil? or commit.empty?\n exit\nend\n\nlines = IO.readlines(info_plist).join\n\nlines.gsub! /(<key>CFBundleShortVersionString<\\/key>\\n\\t)<string>(\\d+\\.\\d+(?:\\.\\d)*[a-z])<\\/string>/, \"\\\\1<string>\\\\2 rev. #{commit}</string>\"\n\nFile.open(info_plist, 'w') { |f| f.puts lines }";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072D0486CEB800E47090 /* main.m in Sources */,
070043131144667B000D05B6 /* TestClientApplicationController.m in Sources */,
070043141144667B000D05B6 /* TestClientMainWindowController.m in Sources */,
070043151144667B000D05B6 /* TestClientXMLParserWindowController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
070043001144653D000D05B6 /* TestClient.xib */ = {
isa = PBXVariantGroup;
children = (
070043011144653D000D05B6 /* English */,
);
name = TestClient.xib;
sourceTree = "<group>";
};
070043031144656D000D05B6 /* TestClientXMLParserWindow.xib */ = {
isa = PBXVariantGroup;
children = (
070043041144656D000D05B6 /* English */,
);
name = TestClientXMLParserWindow.xib;
sourceTree = "<group>";
};
0700430A11446593000D05B6 /* TestClientMainWindow.xib */ = {
isa = PBXVariantGroup;
children = (
0700430B11446593000D05B6 /* English */,
);
name = TestClientMainWindow.xib;
sourceTree = "<group>";
};
2DC70E2F1004D90100BBEEA6 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
2DC70E301004D90100BBEEA6 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
C01FCF4B08A954540054247B /* Development */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 2DC70E351004D90F00BBEEA6 /* TestClientDevelopment.xcconfig */;
buildSettings = {
INFOPLIST_FILE = "TestClient-Info.plist";
};
name = Development;
};
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 2DC70E361004D90F00BBEEA6 /* TestClientRelease.xcconfig */;
buildSettings = {
INFOPLIST_FILE = "TestClient-Info.plist";
};
name = Release;
};
C01FCF4F08A954540054247B /* Development */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 2DC70E331004D90F00BBEEA6 /* CommonDevelopment.xcconfig */;
buildSettings = {
};
name = Development;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 2DC70E341004D90F00BBEEA6 /* CommonRelease.xcconfig */;
buildSettings = {
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Test Client" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4B08A954540054247B /* Development */,
C01FCF4C08A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Test Client" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Development */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Test Client</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.divisiblebyzero.Test Client</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Test Client</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>ZERO</string>
<key>CFBundleVersion</key>
<string>100.0</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0d</string>
<key>NSMainNibFile</key>
<string>TestClient</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View file

@ -0,0 +1,4 @@
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#import <XMLRPC/XMLRPC.h>
#endif

View file

@ -0,0 +1,11 @@
#import <Cocoa/Cocoa.h>
@interface TestClientApplicationController : NSObject {
}
- (void)toggleTestClientWindow: (id)sender;
- (void)toggleXMLParserWindow: (id)sender;
@end

View file

@ -0,0 +1,21 @@
#import "TestClientApplicationController.h"
#import "TestClientMainWindowController.h"
#import "TestClientXMLParserWindowController.h"
@implementation TestClientApplicationController
- (void)applicationDidFinishLaunching: (NSNotification *)notification {
[self toggleTestClientWindow: self];
}
#pragma mark -
- (void)toggleTestClientWindow: (id)sender {
[[TestClientMainWindowController sharedController] toggleTestClientWindow: self];
}
- (void)toggleXMLParserWindow: (id)sender {
[[TestClientXMLParserWindowController sharedController] toggleXMLParserWindow: self];
}
@end

View file

@ -0,0 +1,48 @@
#import <Cocoa/Cocoa.h>
@interface TestClientMainWindowController : NSWindowController<XMLRPCConnectionDelegate> {
XMLRPCResponse *myResponse;
IBOutlet NSTextField *myRequestURL;
IBOutlet NSTextField *myMethod;
IBOutlet NSTextField *myParameter;
IBOutlet NSProgressIndicator *myProgressIndicator;
IBOutlet NSTextField *myActiveConnection;
IBOutlet NSButton *mySendRequest;
IBOutlet NSTextView *myRequestBody;
IBOutlet NSTextView *myResponseBody;
IBOutlet NSOutlineView *myParsedResponse;
}
+ (TestClientMainWindowController *)sharedController;
#pragma mark -
- (void)showTestClientWindow: (id)sender;
- (void)hideTestClientWindow: (id)sender;
#pragma mark -
- (void)toggleTestClientWindow: (id)sender;
#pragma mark -
- (void)sendRequest: (id)sender;
@end
#pragma mark -
@interface TestClientMainWindowController (XMLRPCConnectionDelegate)
- (void)request: (XMLRPCRequest *)request didReceiveResponse: (XMLRPCResponse *)response;
- (void)request: (XMLRPCRequest *)request didFailWithError: (NSError *)error;
- (void)request: (XMLRPCRequest *)request didReceiveAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge;
- (void)request: (XMLRPCRequest *)request didCancelAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge;
- (BOOL)request: (XMLRPCRequest *)request canAuthenticateAgainstProtectionSpace: (NSURLProtectionSpace *)protectionSpace;
@end

View file

@ -0,0 +1,241 @@
#import "TestClientMainWindowController.h"
@implementation TestClientMainWindowController
static TestClientMainWindowController *sharedInstance = nil;
- (id)init {
if ((self = [super initWithWindowNibName: @"TestClientMainWindow"])) {
myResponse = nil;
}
return self;
}
#pragma mark -
+ (id)allocWithZone: (NSZone *)zone {
@synchronized(self) {
if (!sharedInstance) {
sharedInstance = [super allocWithZone: zone];
return sharedInstance;
}
}
return nil;
}
#pragma mark -
+ (TestClientMainWindowController *)sharedController {
@synchronized(self) {
if (!sharedInstance) {
[[self alloc] init];
}
}
return sharedInstance;
}
#pragma mark -
- (void)awakeFromNib {
[[self window] center];
}
#pragma mark -
- (void)showTestClientWindow: (id)sender {
[self showWindow: sender];
}
- (void)hideTestClientWindow: (id)sender {
[self close];
}
#pragma mark -
- (void)toggleTestClientWindow: (id)sender {
if ([[self window] isKeyWindow]) {
[self hideTestClientWindow: sender];
} else {
[self showTestClientWindow: sender];
}
}
#pragma mark -
- (void)sendRequest: (id)sender {
NSURL *URL = [NSURL URLWithString: [myRequestURL stringValue]];
XMLRPCRequest *request = [[[XMLRPCRequest alloc] initWithURL: URL] autorelease];
NSString *connectionIdentifier;
[request setMethod: [myMethod stringValue] withParameter: [myParameter stringValue]];
[myProgressIndicator startAnimation: self];
[myRequestBody setString: [request body]];
connectionIdentifier = [[XMLRPCConnectionManager sharedManager] spawnConnectionWithXMLRPCRequest: request delegate: self];
[myActiveConnection setHidden: NO];
[myActiveConnection setStringValue: [NSString stringWithFormat: @"Active Connection: %@", connectionIdentifier]];
[mySendRequest setEnabled: NO];
}
#pragma mark -
- (void)dealloc {
[myResponse release];
[super dealloc];
}
#pragma mark -
#pragma mark Outline View Data Source Methods
#pragma mark -
- (id)outlineView: (NSOutlineView *)outlineView child: (NSInteger)index ofItem: (id)item {
if (item == nil) {
item = [myResponse object];
}
if ([item isKindOfClass: [NSDictionary class]]) {
return [item objectForKey: [[item allKeys] objectAtIndex: index]];
} else if ([item isKindOfClass: [NSArray class]]) {
return [item objectAtIndex: index];
}
return item;
}
- (BOOL)outlineView: (NSOutlineView *)outlineView isItemExpandable: (id)item {
if ([item isKindOfClass: [NSDictionary class]] || [item isKindOfClass: [NSArray class]]) {
if ([item count] > 0) {
return YES;
}
}
return NO;
}
- (NSInteger)outlineView: (NSOutlineView *)outlineView numberOfChildrenOfItem: (id)item {
if (item == nil) {
item = [myResponse object];
}
if ([item isKindOfClass: [NSDictionary class]] || [item isKindOfClass: [NSArray class]]) {
return [item count];
} else if (item != nil) {
return 1;
}
return 0;
}
- (id)outlineView: (NSOutlineView *)outlineView objectValueForTableColumn: (NSTableColumn *)tableColumn byItem: (id)item {
NSString *columnIdentifier = (NSString *)[tableColumn identifier];
if ([columnIdentifier isEqualToString: @"type"]) {
id parentObject = [outlineView parentForItem: item] ? [outlineView parentForItem: item] : [myResponse object];
if ([parentObject isKindOfClass: [NSDictionary class]]) {
return [[parentObject allKeysForObject: item] objectAtIndex: 0];
} else if ([parentObject isKindOfClass: [NSArray class]]) {
return [NSString stringWithFormat: @"Item %d", [parentObject indexOfObject: item]];
} else if ([item isKindOfClass: [NSString class]]) {
return @"String";
} else {
return @"Object";
}
} else {
if ([item isKindOfClass: [NSDictionary class]] || [item isKindOfClass: [NSArray class]]) {
return [NSString stringWithFormat: @"%d items", [item count]];
} else {
return item;
}
}
return nil;
}
#pragma mark -
#pragma mark XMLRPC Connection Delegate Methods
#pragma mark -
- (void)request: (XMLRPCRequest *)request didReceiveResponse: (XMLRPCResponse *)response {
[myProgressIndicator stopAnimation: self];
[myActiveConnection setHidden: YES];
[mySendRequest setEnabled: YES];
if ([response isFault]) {
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert addButtonWithTitle: @"OK"];
[alert setMessageText: @"The XML-RPC response returned a fault."];
[alert setInformativeText: [NSString stringWithFormat: @"Fault String: %@", [response faultString]]];
[alert setAlertStyle: NSCriticalAlertStyle];
[alert runModal];
} else {
[response retain];
[myResponse release];
myResponse = response;
}
[myParsedResponse reloadData];
[myResponseBody setString: [response body]];
}
- (void)request: (XMLRPCRequest *)request didFailWithError: (NSError *)error {
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[[NSApplication sharedApplication] requestUserAttention: NSCriticalRequest];
[alert addButtonWithTitle: @"OK"];
[alert setMessageText: @"The request failed!"];
[alert setInformativeText: @"The request failed to return a valid response."];
[alert setAlertStyle: NSCriticalAlertStyle];
[alert runModal];
[myParsedResponse reloadData];
[myProgressIndicator stopAnimation: self];
[myActiveConnection setHidden: YES];
[mySendRequest setEnabled: YES];
}
- (void)request: (XMLRPCRequest *)request didReceiveAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge {
if ([challenge previousFailureCount] == 0) {
NSURLCredential *credential = [NSURLCredential credentialWithUser: @"user" password: @"password" persistence: NSURLCredentialPersistenceNone];
[[challenge sender] useCredential: credential forAuthenticationChallenge: challenge];
} else {
[[challenge sender] cancelAuthenticationChallenge: challenge];
}
}
- (void)request: (XMLRPCRequest *)request didCancelAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge {
}
- (BOOL)request: (XMLRPCRequest *)request canAuthenticateAgainstProtectionSpace: (NSURLProtectionSpace *)protectionSpace {
return NO;
}
@end

View file

@ -0,0 +1,25 @@
#import <Cocoa/Cocoa.h>
@interface TestClientXMLParserWindowController : NSWindowController {
id myParsedObject;
IBOutlet NSTextView *myXML;
IBOutlet NSOutlineView *myParserResult;
}
+ (TestClientXMLParserWindowController *)sharedController;
#pragma mark -
- (void)showXMLParserWindow: (id)sender;
- (void)hideXMLParserWindow: (id)sender;
#pragma mark -
- (void)toggleXMLParserWindow: (id)sender;
#pragma mark -
- (void)parse: (id)sender;
@end

View file

@ -0,0 +1,215 @@
#import "TestClientXMLParserWindowController.h"
#import "XMLRPCEventBasedParser.h"
@interface TestClientXMLParserWindowController (TestClientXMLParserWindowControllerPrivate)
- (NSString *)typeForItem: (id)item;
@end
#pragma mark -
@implementation TestClientXMLParserWindowController
static TestClientXMLParserWindowController *sharedInstance = nil;
- (id)init {
if (self = [super initWithWindowNibName: @"TestClientXMLParserWindow"]) {
myParsedObject = nil;
}
return self;
}
#pragma mark -
+ (id)allocWithZone: (NSZone *)zone {
@synchronized(self) {
if (!sharedInstance) {
sharedInstance = [super allocWithZone: zone];
return sharedInstance;
}
}
return nil;
}
#pragma mark -
+ (TestClientXMLParserWindowController *)sharedController {
@synchronized(self) {
if (!sharedInstance) {
[[self alloc] init];
}
}
return sharedInstance;
}
#pragma mark -
- (void)awakeFromNib {
[[self window] center];
}
#pragma mark -
- (void)showXMLParserWindow: (id)sender {
[self showWindow: sender];
}
- (void)hideXMLParserWindow: (id)sender {
[self close];
}
#pragma mark -
- (void)toggleXMLParserWindow: (id)sender {
if ([[self window] isKeyWindow]) {
[self hideXMLParserWindow: sender];
} else {
[self showXMLParserWindow: sender];
}
}
#pragma mark -
- (void)parse: (id)sender {
NSData *data = [[myXML string] dataUsingEncoding: NSUTF8StringEncoding];
XMLRPCEventBasedParser *parser = (XMLRPCEventBasedParser *)[[XMLRPCEventBasedParser alloc] initWithData: data];
if (!parser) {
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert addButtonWithTitle: @"OK"];
[alert setMessageText: @"The parser encountered an error."];
[alert setInformativeText: @"There was a problem creating the XML parser."];
[alert setAlertStyle: NSCriticalAlertStyle];
[alert runModal];
return;
}
[myParsedObject release];
myParsedObject = [[parser parse] retain];
NSError *parserError = [[[parser parserError] retain] autorelease];
[parser release];
if (!myParsedObject) {
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert addButtonWithTitle: @"OK"];
[alert setMessageText: @"The parser encountered an error."];
[alert setInformativeText: [parserError localizedDescription]];
[alert setAlertStyle: NSCriticalAlertStyle];
[alert runModal];
return;
}
[myParserResult reloadData];
}
#pragma mark -
#pragma mark Outline View Data Source Methods
#pragma mark -
- (id)outlineView: (NSOutlineView *)outlineView child: (NSInteger)index ofItem: (id)item {
if (item == nil) {
item = myParsedObject;
}
if ([item isKindOfClass: [NSDictionary class]]) {
return [item objectForKey: [[item allKeys] objectAtIndex: index]];
} else if ([item isKindOfClass: [NSArray class]]) {
return [item objectAtIndex: index];
}
return item;
}
- (BOOL)outlineView: (NSOutlineView *)outlineView isItemExpandable: (id)item {
if ([item isKindOfClass: [NSDictionary class]] || [item isKindOfClass: [NSArray class]]) {
if ([item count] > 0) {
return YES;
}
}
return NO;
}
- (NSInteger)outlineView: (NSOutlineView *)outlineView numberOfChildrenOfItem: (id)item {
if (item == nil) {
item = myParsedObject;
}
if ([item isKindOfClass: [NSDictionary class]] || [item isKindOfClass: [NSArray class]]) {
return [item count];
} else if (item != nil) {
return 1;
}
return 0;
}
- (id)outlineView: (NSOutlineView *)outlineView objectValueForTableColumn: (NSTableColumn *)tableColumn byItem: (id)item {
NSString *columnIdentifier = (NSString *)[tableColumn identifier];
if ([columnIdentifier isEqualToString: @"type"]) {
id parentObject = [outlineView parentForItem: item] ? [outlineView parentForItem: item] : myParsedObject;
if ([parentObject isKindOfClass: [NSDictionary class]]) {
return [NSString stringWithFormat: @"\"%@\", %@", [[parentObject allKeysForObject: item] objectAtIndex: 0], [self typeForItem: item]];
} else if ([parentObject isKindOfClass: [NSArray class]]) {
return [NSString stringWithFormat: @"Item %d, %@", [parentObject indexOfObject: item], [self typeForItem: item]];
} else {
return [self typeForItem: item];
}
} else {
if ([item isKindOfClass: [NSDictionary class]] || [item isKindOfClass: [NSArray class]]) {
return [NSString stringWithFormat: @"%d items", [item count]];
} else {
return [NSString stringWithFormat: @"\"%@\"", item];
}
}
return nil;
}
@end
#pragma mark -
@implementation TestClientXMLParserWindowController (TestClientXMLParserWindowControllerPrivate)
- (NSString *)typeForItem: (id)item {
NSString *type;
if ([item isKindOfClass: [NSArray class]]) {
type = @"Array";
} else if ([item isKindOfClass: [NSDictionary class]]) {
type = @"Dictionary";
} else if ([item isKindOfClass: [NSString class]]) {
type = @"String";
} else if ([item isKindOfClass: [NSNumber class]]) {
type = @"Number";
} else if ([item isKindOfClass: [NSDate class]]) {
type = @"Date";
} else if ([item isKindOfClass: [NSData class]]) {
type = @"Data";
} else {
type = @"Object";
}
return type;
}
@end

View file

@ -0,0 +1,5 @@
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[]) {
return NSApplicationMain(argc, (const char **)argv);
}

View file

@ -0,0 +1,51 @@
# The XML-RPC Test Server
The XML-RPC test server is written in Java and utilizes the Apache XML-RPC server library. This test server can be useful when debugging problems with the XML-RPC framework.
# Usage
To start the server simply call Ant from the XML-RPC test server directory:
$ ant <target>
This will invoke Ant with the default target. The default target will issue the following targets in the following order, the last target is the default invoked by Ant:
- init
- compile
- pre-jar
- jar
- run
These targets each play a role in building and running the Java project. The details of each target can be found in the Ant build script.
Finally, the XML-RPC test server should now be running. To start the server simply click on the "Start" button. This will start the test server on port 8080, available for any incoming XML-RPC requests.
## Creating XML-RPC server handlers
The XML-RPC test server exposes XML-RPC methods through server handlers. Each server handler is simply a Java class that is registered with the Apache XML-RPC library. Here is an example of the Echo handler provided in the distribution:
public class Echo {
public String echo(String message) {
return message;
}
}
This handler simply takes a message provided in the XML-RPC request and returns it in the XML-RPC response. To register this handler with the XML-RPC server simply add it to the propertyHandlerMapping in Server.java:
try {
propertyHandlerMapping.addHandler("Echo", Echo.class);
this.embeddedXmlRpcServer.setHandlerMapping(propertyHandlerMapping);
} catch (Exception e) {
this.controlPanel.addLogMessage(e.getMessage());
}
The handler is now available to any incoming XML-RPC requests.
# License
Copyright (c) 2012 Eric Czarny.
The Cocoa XML-RPC Framework should be accompanied by a LICENSE file, this file contains the license relevant to this distribution.
If no LICENSE exists please contact Eric Czarny <eczarny@gmail.com>.

View file

@ -0,0 +1,17 @@
project.name = test-server
project.main = com.divisiblebyzero.xmlrpc.Application
project.base.directory = .
project.source.directory = ${project.base.directory}/src
project.libraries = commons-logging-1.1.1.jar log4j-1.2.15.jar ws-commons-util-1.0.2.jar xmlrpc-common-3.1.jar xmlrpc-server-3.1.jar
build.directory = ${project.base.directory}
build.classes.directory = ${build.directory}/classes
distribution.directory = ${project.base.directory}/lib
distribution.jar = ${distribution.directory}/${project.name}.jar
resources.directory = ${project.base.directory}/resources
jar.compress = true
compiler.debug = true

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="test-server" default="run">
<property file="build.properties" />
<target name="init">
<mkdir dir="${build.classes.directory}" />
</target>
<target name="compile" depends="init">
<javac srcdir="${project.source.directory}" destdir="${build.classes.directory}" debug="${compiler.debug}">
<classpath>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>
<target name="-pre-jar">
<mkdir dir="${distribution.directory}" />
</target>
<target name="jar" depends="compile, -pre-jar">
<jar jarfile="${distribution.jar}" basedir="${build.classes.directory}" compress="${jar.compress}">
<fileset dir="${resources.directory}">
<include name="handlers.properties" />
<include name="log4j.xml" />
</fileset>
<manifest>
<attribute name="Main-Class" value="${project.main}" />
<attribute name="Class-Path" value=". ${project.libraries}" />
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java jar="${distribution.jar}" fork="yes" />
</target>
<target name="install" depends="jar">
<echo>Stub for project installation.</echo>
</target>
<target name="clean">
<delete dir="${build.classes.directory}" />
<delete file="${distribution.jar}" />
</target>
</project>

Binary file not shown.

View file

@ -0,0 +1,5 @@
#
# XML-RPC Server Handlers
#
Echo=com.divisiblebyzero.xmlrpc.model.handlers.Echo

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="xmlrpc-server" class="org.apache.log4j.FileAppender">
<param name="file" value="logs/server.log" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%-6p] %c - %m%n" />
</layout>
</appender>
<root>
<priority value="trace" />
<appender-ref ref="xmlrpc-server" />
</root>
</log4j:configuration>

View file

@ -0,0 +1,3 @@
#!/bin/sh
java -jar lib/test-server.jar $*

View file

@ -0,0 +1,25 @@
package com.divisiblebyzero.xmlrpc;
import javax.swing.UIManager;
import org.apache.log4j.Logger;
import com.divisiblebyzero.xmlrpc.view.XmlRpcServerControlPanel;
class Application {
private static Logger logger = Logger.getLogger(Application.class);
private Application() {
new XmlRpcServerControlPanel();
}
public static void main(String args[]) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
logger.error("Unable to modify application look and feel.");
}
new Application();
}
}

View file

@ -0,0 +1,67 @@
package com.divisiblebyzero.xmlrpc.controller;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.divisiblebyzero.xmlrpc.model.Server;
import com.divisiblebyzero.xmlrpc.view.XmlRpcServerControlPanel;
public class XmlRpcServerControlPanelController implements ActionListener {
private XmlRpcServerControlPanel controlPanel;
private Server xmlRpcServer;
public XmlRpcServerControlPanelController(XmlRpcServerControlPanel controlPanel) {
this.controlPanel = controlPanel;
this.xmlRpcServer = new Server(this.controlPanel);
}
public void actionPerformed(ActionEvent actionEvent) {
String actionCommand = actionEvent.getActionCommand();
if (actionCommand.equals("Start")) {
this.startXmlRpcServer();
} else if (actionCommand.equals("Stop")) {
this.stopXmlRpcServer();
} else if (actionCommand.equals("Restart")) {
this.restartXmlRpcServer();
}
this.controlPanel.refreshControls();
}
public boolean isXmlRpcServerRunning() {
return this.xmlRpcServer.isRunning();
}
private void startXmlRpcServer() {
this.controlPanel.addLogMessage("Starting the XML-RPC server.");
this.xmlRpcServer.startEmbeddedWebServer();
}
private void stopXmlRpcServer() {
if (this.xmlRpcServer == null) {
this.controlPanel.addLogMessage("Unable to stop the XML-RPC server, none could be found.");
return;
}
this.controlPanel.addLogMessage("Stopping the XML-RPC server.");
this.xmlRpcServer.stopEmbeddedWebServer();
}
private void restartXmlRpcServer() {
if (this.xmlRpcServer == null) {
this.controlPanel.addLogMessage("Unable to restart the XML-RPC server, none could be found.");
return;
}
this.controlPanel.addLogMessage("Restarting the XML-RPC server.");
this.xmlRpcServer.stopEmbeddedWebServer();
this.xmlRpcServer.startEmbeddedWebServer();
}
}

View file

@ -0,0 +1,60 @@
package com.divisiblebyzero.xmlrpc.model;
import com.divisiblebyzero.xmlrpc.view.XmlRpcServerControlPanel;
import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.server.XmlRpcServer;
import org.apache.xmlrpc.webserver.WebServer;
public class Server {
private static final int port = 8080;
private WebServer embeddedWebServer;
private XmlRpcServer embeddedXmlRpcServer;
private boolean running;
private XmlRpcServerControlPanel controlPanel;
public Server(XmlRpcServerControlPanel controlPanel) {
this.embeddedWebServer = new WebServer(Server.port);
this.embeddedXmlRpcServer = this.embeddedWebServer.getXmlRpcServer();
this.running = false;
this.controlPanel = controlPanel;
PropertyHandlerMapping propertyHandlerMapping = new PropertyHandlerMapping();
try {
propertyHandlerMapping.load(Thread.currentThread().getContextClassLoader(), "handlers.properties");
} catch (Exception e) {
this.controlPanel.addLogMessage(e.getMessage());
}
this.embeddedXmlRpcServer.setHandlerMapping(propertyHandlerMapping);
}
public void startEmbeddedWebServer() {
try {
this.embeddedWebServer.start();
this.controlPanel.addLogMessage("The XML-RPC server has been started on port " + Server.port + ".");
} catch (Exception e) {
this.controlPanel.addLogMessage(e.getMessage());
}
this.running = true;
}
public void stopEmbeddedWebServer() {
try {
this.embeddedWebServer.shutdown();
this.controlPanel.addLogMessage("The XML-RPC server has been stopped.");
} catch (Exception e) {
this.controlPanel.addLogMessage(e.getMessage());
}
this.running = false;
}
public boolean isRunning() {
return this.running;
}
}

View file

@ -0,0 +1,7 @@
package com.divisiblebyzero.xmlrpc.model.handlers;
public class Echo {
public String echo(String message) {
return message;
}
}

View file

@ -0,0 +1,155 @@
package com.divisiblebyzero.xmlrpc.view;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Toolkit;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import com.divisiblebyzero.xmlrpc.controller.XmlRpcServerControlPanelController;
public class XmlRpcServerControlPanel extends JFrame {
private static final long serialVersionUID = -7835812670356078909L;
private XmlRpcServerControlPanelController xmlRpcServerControlPanelController;
private JTextPane logMessageTextPane;
private JButton startButton;
private JButton stopButton;
private JButton restartButton;
public XmlRpcServerControlPanel() {
super("Control Panel");
this.xmlRpcServerControlPanelController = new XmlRpcServerControlPanelController(this);
int x = Toolkit.getDefaultToolkit().getScreenSize().width;
int y = Toolkit.getDefaultToolkit().getScreenSize().height;
int width, height;
width = 500;
height = 500;
this.setBounds(((x - (width)) / 2), ((y - (height)) / 2) - (height / 4), width, height);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.initialize();
this.setVisible(true);
}
private void initialize() {
Container container = this.getContentPane();
container.setLayout(new BorderLayout());
/* North Panel */
container.add(new JPanel(), BorderLayout.NORTH);
/* East Panel */
container.add(new JPanel(), BorderLayout.EAST);
/* Center Panel */
JPanel center = new JPanel();
center.setBorder(BorderFactory.createTitledBorder(" " + "Server Log" + " "));
this.logMessageTextPane = new JTextPane();
this.logMessageTextPane.setEditable(false);
this.logMessageTextPane.setBackground(Color.WHITE);
this.logMessageTextPane.setFont(new Font("Monospaced", Font.PLAIN, 12));
this.logMessageTextPane.setText("Server awaiting action...");
JScrollPane scrollableTextPane = new JScrollPane(this.logMessageTextPane);
scrollableTextPane.setBorder(BorderFactory.createLineBorder(Color.GRAY));
scrollableTextPane.setPreferredSize(new Dimension(435, 374));
center.add(scrollableTextPane);
container.add(center, BorderLayout.CENTER);
/* South Panel */
container.add(this.createSouthernPanel(), BorderLayout.SOUTH);
/* West Panel */
container.add(new JPanel(), BorderLayout.WEST);
}
private JPanel createSouthernPanel() {
JPanel south = new JPanel();
south.setPreferredSize(new Dimension(425, 47));
/* Start & Stop Panel */
JPanel startAndStopPanel = new JPanel();
startButton = new JButton("Start");
startButton.setPreferredSize(new Dimension(85, 25));
startButton.addActionListener(this.xmlRpcServerControlPanelController);
startAndStopPanel.add(startButton);
startAndStopPanel.add(new JLabel(" / "));
stopButton = new JButton("Stop");
stopButton.setPreferredSize(new Dimension(85, 25));
stopButton.addActionListener(this.xmlRpcServerControlPanelController);
startAndStopPanel.add(stopButton);
south.add(startAndStopPanel);
JPanel padding = new JPanel();
padding.setPreferredSize(new Dimension(150, 25));
south.add(padding);
/* Restart Panel */
JPanel restartPanel = new JPanel();
restartButton = new JButton("Restart");
restartButton.setPreferredSize(new Dimension(95, 25));
restartButton.addActionListener(this.xmlRpcServerControlPanelController);
restartPanel.add(restartButton);
south.add(restartPanel);
this.refreshControls();
return south;
}
public void addLogMessage(String message) {
String existingLogMessages = this.logMessageTextPane.getText() + "\n";
this.logMessageTextPane.setText(existingLogMessages + message);
}
public void refreshControls() {
if (this.xmlRpcServerControlPanelController.isXmlRpcServerRunning()) {
this.startButton.setEnabled(false);
this.stopButton.setEnabled(true);
this.restartButton.setEnabled(true);
} else {
this.startButton.setEnabled(true);
this.stopButton.setEnabled(false);
this.restartButton.setEnabled(false);
}
}
}

View file

@ -0,0 +1,9 @@
#import <SenTestingKit/SenTestingKit.h>
@interface XMLRPCParserTest : SenTestCase {
NSDictionary *myTestCases;
}
- (void)testEventBasedParser;
@end

View file

@ -0,0 +1,150 @@
#import "XMLRPCParserTest.h"
#import "XMLRPCEventBasedParser.h"
@interface XMLRPCParserTest (XMLRPCParserTestPrivate)
- (NSBundle *)unitTestBundle;
#pragma mark -
- (NSDictionary *)testCases;
#pragma mark -
- (BOOL)parsedResult: (id)parsedResult isEqualToTestCaseResult: (id)testCaseResult;
#pragma mark -
- (BOOL)parsedResult: (id)parsedResult isEqualToArray: (NSArray *)array;
- (BOOL)parsedResult: (id)parsedResult isEqualToDictionary: (NSDictionary *)dictionary;
@end
#pragma mark -
@implementation XMLRPCParserTest
- (void)setUp {
myTestCases = [[self testCases] retain];
}
#pragma mark -
- (void)testEventBasedParser {
NSEnumerator *testCaseEnumerator = [myTestCases keyEnumerator];
id testCaseName;
while (testCaseName = [testCaseEnumerator nextObject]) {
NSString *testCase = [[self unitTestBundle] pathForResource: testCaseName ofType: @"xml"];
NSData *testCaseData =[[[NSData alloc] initWithContentsOfFile: testCase] autorelease];
XMLRPCEventBasedParser *parser = [[[XMLRPCEventBasedParser alloc] initWithData: testCaseData] autorelease];
id testCaseResult = [myTestCases objectForKey: testCaseName];
id parsedResult = [parser parse];
STAssertTrue([self parsedResult: parsedResult isEqualToTestCaseResult: testCaseResult], @"The test case failed: %@", testCaseName);
}
}
#pragma mark -
- (void)tearDown {
[myTestCases release];
}
@end
#pragma mark -
@implementation XMLRPCParserTest (XMLRPCParserTestPrivate)
- (NSBundle *)unitTestBundle {
return [NSBundle bundleForClass: [XMLRPCParserTest class]];
}
#pragma mark -
- (NSDictionary *)testCases {
NSString *file = [[self unitTestBundle] pathForResource: @"TestCases" ofType: @"plist"];
NSDictionary *testCases = [[[NSDictionary alloc] initWithContentsOfFile: file] autorelease];
return testCases;
}
#pragma mark -
- (BOOL)parsedResult: (id)parsedResult isEqualToTestCaseResult: (id)testCaseResult {
if ([testCaseResult isKindOfClass: [NSArray class]]) {
return [self parsedResult: parsedResult isEqualToArray: testCaseResult];
} else if ([testCaseResult isKindOfClass: [NSDictionary class]]) {
return [self parsedResult: parsedResult isEqualToDictionary: testCaseResult];
}
if ([testCaseResult isKindOfClass: [NSNumber class]]) {
return [parsedResult isEqualToNumber: testCaseResult];
} else if ([testCaseResult isKindOfClass: [NSString class]]) {
return [parsedResult isEqualToString: testCaseResult];
} else if ([testCaseResult isKindOfClass: [NSDate class]]) {
return [parsedResult isEqualToDate: testCaseResult];
} else if ([testCaseResult isKindOfClass: [NSData class]]) {
return [parsedResult isEqualToData: testCaseResult];
}
return YES;
}
#pragma mark -
- (BOOL)parsedResult: (id)parsedResult isEqualToArray: (NSArray *)array {
NSEnumerator *arrayEnumerator = [array objectEnumerator];
id arrayElement;
if (![parsedResult isKindOfClass: [NSArray class]]) {
return NO;
}
if ([parsedResult count] != [array count]) {
return NO;
}
if ([parsedResult isEqualToArray: array]) {
return YES;
}
while (arrayElement = [arrayEnumerator nextObject]) {
NSInteger index = [array indexOfObject: arrayElement];
if (![self parsedResult: [parsedResult objectAtIndex: index] isEqualToTestCaseResult: arrayElement]) {
return NO;
}
}
return YES;
}
- (BOOL)parsedResult: (id)parsedResult isEqualToDictionary: (NSDictionary *)dictionary {
NSEnumerator *keyEnumerator = [dictionary keyEnumerator];
id key;
if (![parsedResult isKindOfClass: [NSDictionary class]]) {
return NO;
}
if ([parsedResult count] != [dictionary count]) {
return NO;
}
if ([parsedResult isEqualToDictionary: dictionary]) {
return YES;
}
while (key = [keyEnumerator nextObject]) {
if (![self parsedResult: [parsedResult objectForKey: key] isEqualToTestCaseResult: [dictionary objectForKey: key]]) {
return NO;
}
}
return YES;
}
@end

5
Classes/Utils/XMLRPC/XMLRPC.h Executable file
View file

@ -0,0 +1,5 @@
#import <XMLRPC/XMLRPCConnection.h>
#import <XMLRPC/XMLRPCConnectionDelegate.h>
#import <XMLRPC/XMLRPCConnectionManager.h>
#import <XMLRPC/XMLRPCResponse.h>
#import <XMLRPC/XMLRPCRequest.h>

View file

@ -0,0 +1,3 @@
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif

View file

@ -0,0 +1,931 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
033836831527905D00EF8E8A /* NSData+Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 033836811527905D00EF8E8A /* NSData+Base64.h */; };
033836841527905D00EF8E8A /* NSData+Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 033836811527905D00EF8E8A /* NSData+Base64.h */; settings = {ATTRIBUTES = (Public, ); }; };
033836851527905D00EF8E8A /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 033836821527905D00EF8E8A /* NSData+Base64.m */; };
033836861527905D00EF8E8A /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 033836821527905D00EF8E8A /* NSData+Base64.m */; };
0707047810114B9400CB7702 /* XMLRPCEventBasedParserDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0707047610114B9400CB7702 /* XMLRPCEventBasedParserDelegate.h */; };
0707047910114B9400CB7702 /* XMLRPCEventBasedParserDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0707047710114B9400CB7702 /* XMLRPCEventBasedParserDelegate.m */; };
07075BAE10C5FE3800589A27 /* AlternativeDateFormatsTestCase.xml in Resources */ = {isa = PBXBuildFile; fileRef = 07075BAD10C5FE3800589A27 /* AlternativeDateFormatsTestCase.xml */; };
07452BE30E469C9000A57686 /* XMLRPCConnectionDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07452BE20E469C9000A57686 /* XMLRPCConnectionDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
075137FB0E429E560019E4F6 /* XMLRPCConnectionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 075137F90E429E560019E4F6 /* XMLRPCConnectionManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
075137FC0E429E560019E4F6 /* XMLRPCConnectionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 075137FA0E429E560019E4F6 /* XMLRPCConnectionManager.m */; };
0759A6F31143495E000DFE98 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0759A6F11143495E000DFE98 /* InfoPlist.strings */; };
0799AF270F6724E300B71B22 /* XMLRPC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* XMLRPC.framework */; };
0799AF5E0F67266400B71B22 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0799AF5D0F67266400B71B22 /* SenTestingKit.framework */; };
07A0A9071016A51000CEE3C7 /* EmptyBooleanTestCase.xml in Resources */ = {isa = PBXBuildFile; fileRef = 07A0A9021016A51000CEE3C7 /* EmptyBooleanTestCase.xml */; };
07A0A9081016A51000CEE3C7 /* EmptyDataTestCase.xml in Resources */ = {isa = PBXBuildFile; fileRef = 07A0A9031016A51000CEE3C7 /* EmptyDataTestCase.xml */; };
07A0A9091016A51000CEE3C7 /* EmptyDoubleTestCase.xml in Resources */ = {isa = PBXBuildFile; fileRef = 07A0A9041016A51000CEE3C7 /* EmptyDoubleTestCase.xml */; };
07A0A90A1016A51000CEE3C7 /* EmptyIntegerTestCase.xml in Resources */ = {isa = PBXBuildFile; fileRef = 07A0A9051016A51000CEE3C7 /* EmptyIntegerTestCase.xml */; };
07A0A90B1016A51000CEE3C7 /* EmptyStringTestCase.xml in Resources */ = {isa = PBXBuildFile; fileRef = 07A0A9061016A51000CEE3C7 /* EmptyStringTestCase.xml */; };
07B0C6070E33A659006453B4 /* NSStringAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C5F80E33A659006453B4 /* NSStringAdditions.h */; };
07B0C6080E33A659006453B4 /* NSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B0C5F90E33A659006453B4 /* NSStringAdditions.m */; };
07B0C6090E33A659006453B4 /* XMLRPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C5FA0E33A659006453B4 /* XMLRPC.h */; settings = {ATTRIBUTES = (Public, ); }; };
07B0C60A0E33A659006453B4 /* XMLRPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C5FB0E33A659006453B4 /* XMLRPCConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
07B0C60B0E33A659006453B4 /* XMLRPCConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B0C5FC0E33A659006453B4 /* XMLRPCConnection.m */; };
07B0C60E0E33A659006453B4 /* XMLRPCDefaultEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C5FF0E33A659006453B4 /* XMLRPCDefaultEncoder.h */; };
07B0C60F0E33A659006453B4 /* XMLRPCDefaultEncoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B0C6000E33A659006453B4 /* XMLRPCDefaultEncoder.m */; };
07B0C6100E33A659006453B4 /* XMLRPCRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C6010E33A659006453B4 /* XMLRPCRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
07B0C6110E33A659006453B4 /* XMLRPCRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B0C6020E33A659006453B4 /* XMLRPCRequest.m */; };
07B0C6120E33A659006453B4 /* XMLRPCResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C6030E33A659006453B4 /* XMLRPCResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
07B0C6130E33A659006453B4 /* XMLRPCResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B0C6040E33A659006453B4 /* XMLRPCResponse.m */; };
07B0C6170E33A672006453B4 /* XMLRPC.pch in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C6160E33A672006453B4 /* XMLRPC.pch */; };
07B52BE7101004670015AD8B /* SimpleArrayTestCase.xml in Resources */ = {isa = PBXBuildFile; fileRef = 07B52BE5101004670015AD8B /* SimpleArrayTestCase.xml */; };
07B52BE8101004670015AD8B /* SimpleStructTestCase.xml in Resources */ = {isa = PBXBuildFile; fileRef = 07B52BE6101004670015AD8B /* SimpleStructTestCase.xml */; };
07B52BEA101004810015AD8B /* TestCases.plist in Resources */ = {isa = PBXBuildFile; fileRef = 07B52BE9101004810015AD8B /* TestCases.plist */; };
07B52C03101008670015AD8B /* XMLRPCParserTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B52C02101008670015AD8B /* XMLRPCParserTest.m */; };
07BB09891316B65A00E1911C /* DefaultTypeTestCase.xml in Resources */ = {isa = PBXBuildFile; fileRef = 07BB09881316B65A00E1911C /* DefaultTypeTestCase.xml */; };
07E761001011788B00E9BDEE /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
07EF453B0E721A5D009F2708 /* XMLRPCEventBasedParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EF45390E721A5D009F2708 /* XMLRPCEventBasedParser.h */; };
07EF453C0E721A5D009F2708 /* XMLRPCEventBasedParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 07EF453A0E721A5D009F2708 /* XMLRPCEventBasedParser.m */; };
2DCADEDB1529E24300B47A4F /* XMLRPCEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DCADED91529E06900B47A4F /* XMLRPCEncoder.h */; settings = {ATTRIBUTES = (Public, ); }; };
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
903B0DC212F7581200BD6E09 /* NSStringAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C5F80E33A659006453B4 /* NSStringAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
903B0DC312F7581200BD6E09 /* NSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B0C5F90E33A659006453B4 /* NSStringAdditions.m */; };
903B0DC412F7581200BD6E09 /* XMLRPCConnectionDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07452BE20E469C9000A57686 /* XMLRPCConnectionDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
903B0DC512F7581200BD6E09 /* XMLRPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C5FA0E33A659006453B4 /* XMLRPC.h */; settings = {ATTRIBUTES = (Public, ); }; };
903B0DC612F7581200BD6E09 /* XMLRPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C5FB0E33A659006453B4 /* XMLRPCConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
903B0DC712F7581200BD6E09 /* XMLRPCConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B0C5FC0E33A659006453B4 /* XMLRPCConnection.m */; };
903B0DC812F7581200BD6E09 /* XMLRPCConnectionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 075137F90E429E560019E4F6 /* XMLRPCConnectionManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
903B0DC912F7581200BD6E09 /* XMLRPCConnectionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 075137FA0E429E560019E4F6 /* XMLRPCConnectionManager.m */; };
903B0DCA12F7581200BD6E09 /* XMLRPCDefaultEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C5FF0E33A659006453B4 /* XMLRPCDefaultEncoder.h */; settings = {ATTRIBUTES = (Public, ); }; };
903B0DCB12F7581200BD6E09 /* XMLRPCDefaultEncoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B0C6000E33A659006453B4 /* XMLRPCDefaultEncoder.m */; };
903B0DCC12F7581200BD6E09 /* XMLRPCEventBasedParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EF45390E721A5D009F2708 /* XMLRPCEventBasedParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
903B0DCD12F7581200BD6E09 /* XMLRPCEventBasedParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 07EF453A0E721A5D009F2708 /* XMLRPCEventBasedParser.m */; };
903B0DCE12F7581200BD6E09 /* XMLRPCEventBasedParserDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0707047610114B9400CB7702 /* XMLRPCEventBasedParserDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
903B0DCF12F7581200BD6E09 /* XMLRPCEventBasedParserDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0707047710114B9400CB7702 /* XMLRPCEventBasedParserDelegate.m */; };
903B0DD012F7581200BD6E09 /* XMLRPCRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C6010E33A659006453B4 /* XMLRPCRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
903B0DD112F7581200BD6E09 /* XMLRPCRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B0C6020E33A659006453B4 /* XMLRPCRequest.m */; };
903B0DD212F7581200BD6E09 /* XMLRPCResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C6030E33A659006453B4 /* XMLRPCResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
903B0DD312F7581200BD6E09 /* XMLRPCResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B0C6040E33A659006453B4 /* XMLRPCResponse.m */; };
903B0DD412F7581F00BD6E09 /* XMLRPC.pch in Headers */ = {isa = PBXBuildFile; fileRef = 07B0C6160E33A672006453B4 /* XMLRPC.pch */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
0799AF180F67240B00B71B22 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
remoteInfo = XMLRPC;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
033836811527905D00EF8E8A /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Base64.h"; sourceTree = "<group>"; };
033836821527905D00EF8E8A /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Base64.m"; sourceTree = "<group>"; };
0707047610114B9400CB7702 /* XMLRPCEventBasedParserDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLRPCEventBasedParserDelegate.h; sourceTree = "<group>"; };
0707047710114B9400CB7702 /* XMLRPCEventBasedParserDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLRPCEventBasedParserDelegate.m; sourceTree = "<group>"; };
07075BAD10C5FE3800589A27 /* AlternativeDateFormatsTestCase.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = AlternativeDateFormatsTestCase.xml; path = "Resources/Test Cases/AlternativeDateFormatsTestCase.xml"; sourceTree = "<group>"; };
07127C580F4266F4009C7476 /* Common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Common.xcconfig; path = Configurations/Common.xcconfig; sourceTree = "<group>"; };
07127C590F4266F4009C7476 /* CommonDevelopment.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CommonDevelopment.xcconfig; path = Configurations/CommonDevelopment.xcconfig; sourceTree = "<group>"; };
07127C5A0F4266F4009C7476 /* CommonRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CommonRelease.xcconfig; path = Configurations/CommonRelease.xcconfig; sourceTree = "<group>"; };
07452BE20E469C9000A57686 /* XMLRPCConnectionDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLRPCConnectionDelegate.h; sourceTree = "<group>"; };
075137F90E429E560019E4F6 /* XMLRPCConnectionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLRPCConnectionManager.h; sourceTree = "<group>"; };
075137FA0E429E560019E4F6 /* XMLRPCConnectionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLRPCConnectionManager.m; sourceTree = "<group>"; };
0759A6F21143495E000DFE98 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = Languages/English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
0799AF030F6721FF00B71B22 /* XMLRPCUnitTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XMLRPCUnitTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
0799AF040F6721FF00B71B22 /* XMLRPCUnitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "XMLRPCUnitTests-Info.plist"; path = "Resources/Property Lists/XMLRPCUnitTests-Info.plist"; sourceTree = "<group>"; };
0799AF0A0F67227F00B71B22 /* XMLRPCUnitTests.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = XMLRPCUnitTests.xcconfig; path = Configurations/XMLRPCUnitTests.xcconfig; sourceTree = "<group>"; };
0799AF0B0F67227F00B71B22 /* XMLRPCUnitTestsDevelopment.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = XMLRPCUnitTestsDevelopment.xcconfig; path = Configurations/XMLRPCUnitTestsDevelopment.xcconfig; sourceTree = "<group>"; };
0799AF0C0F67227F00B71B22 /* XMLRPCUnitTestsRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = XMLRPCUnitTestsRelease.xcconfig; path = Configurations/XMLRPCUnitTestsRelease.xcconfig; sourceTree = "<group>"; };
0799AF0F0F6722D600B71B22 /* XMLRPC.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = XMLRPC.xcconfig; path = Configurations/XMLRPC.xcconfig; sourceTree = "<group>"; };
0799AF100F6722D600B71B22 /* XMLRPCDevelopment.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = XMLRPCDevelopment.xcconfig; path = Configurations/XMLRPCDevelopment.xcconfig; sourceTree = "<group>"; };
0799AF110F6722D600B71B22 /* XMLRPCRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = XMLRPCRelease.xcconfig; path = Configurations/XMLRPCRelease.xcconfig; sourceTree = "<group>"; };
0799AF280F67254B00B71B22 /* XMLRPC-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "XMLRPC-Info.plist"; path = "Resources/Property Lists/XMLRPC-Info.plist"; sourceTree = "<group>"; };
0799AF5D0F67266400B71B22 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
07A0A9021016A51000CEE3C7 /* EmptyBooleanTestCase.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = EmptyBooleanTestCase.xml; path = "Resources/Test Cases/EmptyBooleanTestCase.xml"; sourceTree = "<group>"; };
07A0A9031016A51000CEE3C7 /* EmptyDataTestCase.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = EmptyDataTestCase.xml; path = "Resources/Test Cases/EmptyDataTestCase.xml"; sourceTree = "<group>"; };
07A0A9041016A51000CEE3C7 /* EmptyDoubleTestCase.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = EmptyDoubleTestCase.xml; path = "Resources/Test Cases/EmptyDoubleTestCase.xml"; sourceTree = "<group>"; };
07A0A9051016A51000CEE3C7 /* EmptyIntegerTestCase.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = EmptyIntegerTestCase.xml; path = "Resources/Test Cases/EmptyIntegerTestCase.xml"; sourceTree = "<group>"; };
07A0A9061016A51000CEE3C7 /* EmptyStringTestCase.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = EmptyStringTestCase.xml; path = "Resources/Test Cases/EmptyStringTestCase.xml"; sourceTree = "<group>"; };
07B0C5F80E33A659006453B4 /* NSStringAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSStringAdditions.h; sourceTree = "<group>"; };
07B0C5F90E33A659006453B4 /* NSStringAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSStringAdditions.m; sourceTree = "<group>"; };
07B0C5FA0E33A659006453B4 /* XMLRPC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLRPC.h; sourceTree = "<group>"; };
07B0C5FB0E33A659006453B4 /* XMLRPCConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLRPCConnection.h; sourceTree = "<group>"; };
07B0C5FC0E33A659006453B4 /* XMLRPCConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLRPCConnection.m; sourceTree = "<group>"; };
07B0C5FF0E33A659006453B4 /* XMLRPCDefaultEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLRPCDefaultEncoder.h; sourceTree = "<group>"; };
07B0C6000E33A659006453B4 /* XMLRPCDefaultEncoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLRPCDefaultEncoder.m; sourceTree = "<group>"; };
07B0C6010E33A659006453B4 /* XMLRPCRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLRPCRequest.h; sourceTree = "<group>"; };
07B0C6020E33A659006453B4 /* XMLRPCRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLRPCRequest.m; sourceTree = "<group>"; };
07B0C6030E33A659006453B4 /* XMLRPCResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLRPCResponse.h; sourceTree = "<group>"; };
07B0C6040E33A659006453B4 /* XMLRPCResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLRPCResponse.m; sourceTree = "<group>"; };
07B0C6160E33A672006453B4 /* XMLRPC.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLRPC.pch; sourceTree = "<group>"; };
07B52BE5101004670015AD8B /* SimpleArrayTestCase.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = SimpleArrayTestCase.xml; path = "Resources/Test Cases/SimpleArrayTestCase.xml"; sourceTree = "<group>"; };
07B52BE6101004670015AD8B /* SimpleStructTestCase.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = SimpleStructTestCase.xml; path = "Resources/Test Cases/SimpleStructTestCase.xml"; sourceTree = "<group>"; };
07B52BE9101004810015AD8B /* TestCases.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = TestCases.plist; path = "Resources/Property Lists/TestCases.plist"; sourceTree = "<group>"; };
07B52C01101008670015AD8B /* XMLRPCParserTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLRPCParserTest.h; path = "Unit Tests/XMLRPCParserTest.h"; sourceTree = "<group>"; };
07B52C02101008670015AD8B /* XMLRPCParserTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMLRPCParserTest.m; path = "Unit Tests/XMLRPCParserTest.m"; sourceTree = "<group>"; };
07BB09881316B65A00E1911C /* DefaultTypeTestCase.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = DefaultTypeTestCase.xml; path = "Resources/Test Cases/DefaultTypeTestCase.xml"; sourceTree = "<group>"; };
07EF45390E721A5D009F2708 /* XMLRPCEventBasedParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLRPCEventBasedParser.h; sourceTree = "<group>"; };
07EF453A0E721A5D009F2708 /* XMLRPCEventBasedParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLRPCEventBasedParser.m; sourceTree = "<group>"; };
0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
2DCADED91529E06900B47A4F /* XMLRPCEncoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XMLRPCEncoder.h; sourceTree = "<group>"; };
8DC2EF5B0486A6940098B216 /* XMLRPC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XMLRPC.framework; sourceTree = BUILT_PRODUCTS_DIR; };
903B0DB612F7574800BD6E09 /* libXMLRPC.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libXMLRPC.a; sourceTree = BUILT_PRODUCTS_DIR; };
D2F7E79907B2D74100F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
0799AF000F6721FF00B71B22 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
07E761001011788B00E9BDEE /* Cocoa.framework in Frameworks */,
0799AF5E0F67266400B71B22 /* SenTestingKit.framework in Frameworks */,
0799AF270F6724E300B71B22 /* XMLRPC.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8DC2EF560486A6940098B216 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
903B0DB412F7574800BD6E09 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
034768DFFF38A50411DB9C8B /* Products */ = {
isa = PBXGroup;
children = (
8DC2EF5B0486A6940098B216 /* XMLRPC.framework */,
0799AF030F6721FF00B71B22 /* XMLRPCUnitTests.octest */,
903B0DB612F7574800BD6E09 /* libXMLRPC.a */,
);
name = Products;
sourceTree = "<group>";
};
07127C570F4266E2009C7476 /* Configurations */ = {
isa = PBXGroup;
children = (
07127C580F4266F4009C7476 /* Common.xcconfig */,
07127C590F4266F4009C7476 /* CommonDevelopment.xcconfig */,
07127C5A0F4266F4009C7476 /* CommonRelease.xcconfig */,
0799AF0F0F6722D600B71B22 /* XMLRPC.xcconfig */,
0799AF100F6722D600B71B22 /* XMLRPCDevelopment.xcconfig */,
0799AF110F6722D600B71B22 /* XMLRPCRelease.xcconfig */,
0799AF0A0F67227F00B71B22 /* XMLRPCUnitTests.xcconfig */,
0799AF0B0F67227F00B71B22 /* XMLRPCUnitTestsDevelopment.xcconfig */,
0799AF0C0F67227F00B71B22 /* XMLRPCUnitTestsRelease.xcconfig */,
);
name = Configurations;
sourceTree = "<group>";
};
07452BDC0E469C6900A57686 /* Delegates */ = {
isa = PBXGroup;
children = (
07452BE20E469C9000A57686 /* XMLRPCConnectionDelegate.h */,
);
name = Delegates;
sourceTree = "<group>";
};
074E8A200F6D8D6E00BE0B22 /* Localized Strings */ = {
isa = PBXGroup;
children = (
0759A6F11143495E000DFE98 /* InfoPlist.strings */,
);
name = "Localized Strings";
sourceTree = "<group>";
};
074E8A220F6D8D8300BE0B22 /* Property Lists */ = {
isa = PBXGroup;
children = (
07B52BE9101004810015AD8B /* TestCases.plist */,
0799AF280F67254B00B71B22 /* XMLRPC-Info.plist */,
0799AF040F6721FF00B71B22 /* XMLRPCUnitTests-Info.plist */,
);
name = "Property Lists";
sourceTree = "<group>";
};
0799AF2F0F67258600B71B22 /* Unit Tests */ = {
isa = PBXGroup;
children = (
07B52C01101008670015AD8B /* XMLRPCParserTest.h */,
07B52C02101008670015AD8B /* XMLRPCParserTest.m */,
);
name = "Unit Tests";
sourceTree = "<group>";
};
07B0C6140E33A65E006453B4 /* Additions */ = {
isa = PBXGroup;
children = (
033836811527905D00EF8E8A /* NSData+Base64.h */,
033836821527905D00EF8E8A /* NSData+Base64.m */,
07B0C5F80E33A659006453B4 /* NSStringAdditions.h */,
07B0C5F90E33A659006453B4 /* NSStringAdditions.m */,
);
name = Additions;
sourceTree = "<group>";
};
07B52BE4101004270015AD8B /* Test Cases */ = {
isa = PBXGroup;
children = (
07075BAD10C5FE3800589A27 /* AlternativeDateFormatsTestCase.xml */,
07BB09881316B65A00E1911C /* DefaultTypeTestCase.xml */,
07A0A9021016A51000CEE3C7 /* EmptyBooleanTestCase.xml */,
07A0A9031016A51000CEE3C7 /* EmptyDataTestCase.xml */,
07A0A9041016A51000CEE3C7 /* EmptyDoubleTestCase.xml */,
07A0A9051016A51000CEE3C7 /* EmptyIntegerTestCase.xml */,
07A0A9061016A51000CEE3C7 /* EmptyStringTestCase.xml */,
07B52BE5101004670015AD8B /* SimpleArrayTestCase.xml */,
07B52BE6101004670015AD8B /* SimpleStructTestCase.xml */,
);
name = "Test Cases";
sourceTree = "<group>";
};
0867D691FE84028FC02AAC07 /* XMLRPC */ = {
isa = PBXGroup;
children = (
08FB77AEFE84172EC02AAC07 /* Classes */,
32C88DFF0371C24200C91783 /* Other Sources */,
089C1665FE841158C02AAC07 /* Resources */,
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
034768DFFF38A50411DB9C8B /* Products */,
);
name = XMLRPC;
sourceTree = "<group>";
};
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */,
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */,
);
name = "External Frameworks and Libraries";
sourceTree = "<group>";
};
089C1665FE841158C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
07127C570F4266E2009C7476 /* Configurations */,
074E8A200F6D8D6E00BE0B22 /* Localized Strings */,
074E8A220F6D8D8300BE0B22 /* Property Lists */,
07B52BE4101004270015AD8B /* Test Cases */,
);
name = Resources;
sourceTree = "<group>";
};
08FB77AEFE84172EC02AAC07 /* Classes */ = {
isa = PBXGroup;
children = (
07B0C6140E33A65E006453B4 /* Additions */,
07452BDC0E469C6900A57686 /* Delegates */,
07B0C5FA0E33A659006453B4 /* XMLRPC.h */,
07B0C5FB0E33A659006453B4 /* XMLRPCConnection.h */,
07B0C5FC0E33A659006453B4 /* XMLRPCConnection.m */,
075137F90E429E560019E4F6 /* XMLRPCConnectionManager.h */,
075137FA0E429E560019E4F6 /* XMLRPCConnectionManager.m */,
2DCADED91529E06900B47A4F /* XMLRPCEncoder.h */,
07B0C5FF0E33A659006453B4 /* XMLRPCDefaultEncoder.h */,
07B0C6000E33A659006453B4 /* XMLRPCDefaultEncoder.m */,
07EF45390E721A5D009F2708 /* XMLRPCEventBasedParser.h */,
07EF453A0E721A5D009F2708 /* XMLRPCEventBasedParser.m */,
0707047610114B9400CB7702 /* XMLRPCEventBasedParserDelegate.h */,
0707047710114B9400CB7702 /* XMLRPCEventBasedParserDelegate.m */,
07B0C6010E33A659006453B4 /* XMLRPCRequest.h */,
07B0C6020E33A659006453B4 /* XMLRPCRequest.m */,
07B0C6030E33A659006453B4 /* XMLRPCResponse.h */,
07B0C6040E33A659006453B4 /* XMLRPCResponse.m */,
);
name = Classes;
sourceTree = "<group>";
};
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */,
0799AF5D0F67266400B71B22 /* SenTestingKit.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
0867D6A5FE840307C02AAC07 /* AppKit.framework */,
D2F7E79907B2D74100F64583 /* CoreData.framework */,
0867D69BFE84028FC02AAC07 /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
32C88DFF0371C24200C91783 /* Other Sources */ = {
isa = PBXGroup;
children = (
0799AF2F0F67258600B71B22 /* Unit Tests */,
07B0C6160E33A672006453B4 /* XMLRPC.pch */,
);
name = "Other Sources";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
8DC2EF500486A6940098B216 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
07B0C6070E33A659006453B4 /* NSStringAdditions.h in Headers */,
07B0C6090E33A659006453B4 /* XMLRPC.h in Headers */,
07B0C6170E33A672006453B4 /* XMLRPC.pch in Headers */,
07B0C60A0E33A659006453B4 /* XMLRPCConnection.h in Headers */,
07452BE30E469C9000A57686 /* XMLRPCConnectionDelegate.h in Headers */,
075137FB0E429E560019E4F6 /* XMLRPCConnectionManager.h in Headers */,
07B0C60E0E33A659006453B4 /* XMLRPCDefaultEncoder.h in Headers */,
07EF453B0E721A5D009F2708 /* XMLRPCEventBasedParser.h in Headers */,
0707047810114B9400CB7702 /* XMLRPCEventBasedParserDelegate.h in Headers */,
07B0C6100E33A659006453B4 /* XMLRPCRequest.h in Headers */,
07B0C6120E33A659006453B4 /* XMLRPCResponse.h in Headers */,
033836831527905D00EF8E8A /* NSData+Base64.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
903B0DB212F7574800BD6E09 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
903B0DC212F7581200BD6E09 /* NSStringAdditions.h in Headers */,
903B0DC412F7581200BD6E09 /* XMLRPCConnectionDelegate.h in Headers */,
903B0DC512F7581200BD6E09 /* XMLRPC.h in Headers */,
903B0DC612F7581200BD6E09 /* XMLRPCConnection.h in Headers */,
903B0DC812F7581200BD6E09 /* XMLRPCConnectionManager.h in Headers */,
2DCADEDB1529E24300B47A4F /* XMLRPCEncoder.h in Headers */,
903B0DCA12F7581200BD6E09 /* XMLRPCDefaultEncoder.h in Headers */,
903B0DCC12F7581200BD6E09 /* XMLRPCEventBasedParser.h in Headers */,
903B0DCE12F7581200BD6E09 /* XMLRPCEventBasedParserDelegate.h in Headers */,
903B0DD012F7581200BD6E09 /* XMLRPCRequest.h in Headers */,
903B0DD212F7581200BD6E09 /* XMLRPCResponse.h in Headers */,
903B0DD412F7581F00BD6E09 /* XMLRPC.pch in Headers */,
033836841527905D00EF8E8A /* NSData+Base64.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
0799AF020F6721FF00B71B22 /* XMLRPCUnitTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 0799AF070F67220000B71B22 /* Build configuration list for PBXNativeTarget "XMLRPCUnitTests" */;
buildPhases = (
0799AEFE0F6721FF00B71B22 /* Resources */,
0799AEFF0F6721FF00B71B22 /* Sources */,
0799AF000F6721FF00B71B22 /* Frameworks */,
0799AF010F6721FF00B71B22 /* ShellScript */,
);
buildRules = (
);
dependencies = (
0799AF190F67240B00B71B22 /* PBXTargetDependency */,
);
name = XMLRPCUnitTests;
productName = XMLRPCUnitTests;
productReference = 0799AF030F6721FF00B71B22 /* XMLRPCUnitTests.octest */;
productType = "com.apple.product-type.bundle";
};
8DC2EF4F0486A6940098B216 /* XMLRPC */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "XMLRPC" */;
buildPhases = (
8DC2EF500486A6940098B216 /* Headers */,
8DC2EF520486A6940098B216 /* Resources */,
8DC2EF540486A6940098B216 /* Sources */,
8DC2EF560486A6940098B216 /* Frameworks */,
0715852011432A78003D3454 /* Run Script: Include Git commit hash */,
);
buildRules = (
);
dependencies = (
);
name = XMLRPC;
productInstallPath = "$(HOME)/Library/Frameworks";
productName = XMLRPC;
productReference = 8DC2EF5B0486A6940098B216 /* XMLRPC.framework */;
productType = "com.apple.product-type.framework";
};
903B0DB512F7574800BD6E09 /* libXMLRPC */ = {
isa = PBXNativeTarget;
buildConfigurationList = 903B0DB912F7577B00BD6E09 /* Build configuration list for PBXNativeTarget "libXMLRPC" */;
buildPhases = (
903B0DB212F7574800BD6E09 /* Headers */,
903B0DB312F7574800BD6E09 /* Sources */,
903B0DB412F7574800BD6E09 /* Frameworks */,
903B0DFB12F75B2300BD6E09 /* ShellScript */,
);
buildRules = (
);
dependencies = (
);
name = libXMLRPC;
productName = iOSXMLRPC;
productReference = 903B0DB612F7574800BD6E09 /* libXMLRPC.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0440;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "XMLRPC" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 0867D691FE84028FC02AAC07 /* XMLRPC */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
8DC2EF4F0486A6940098B216 /* XMLRPC */,
903B0DB512F7574800BD6E09 /* libXMLRPC */,
0799AF020F6721FF00B71B22 /* XMLRPCUnitTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
0799AEFE0F6721FF00B71B22 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
07075BAE10C5FE3800589A27 /* AlternativeDateFormatsTestCase.xml in Resources */,
07BB09891316B65A00E1911C /* DefaultTypeTestCase.xml in Resources */,
07A0A9071016A51000CEE3C7 /* EmptyBooleanTestCase.xml in Resources */,
07A0A9081016A51000CEE3C7 /* EmptyDataTestCase.xml in Resources */,
07A0A9091016A51000CEE3C7 /* EmptyDoubleTestCase.xml in Resources */,
07A0A90A1016A51000CEE3C7 /* EmptyIntegerTestCase.xml in Resources */,
07A0A90B1016A51000CEE3C7 /* EmptyStringTestCase.xml in Resources */,
07B52BE7101004670015AD8B /* SimpleArrayTestCase.xml in Resources */,
07B52BE8101004670015AD8B /* SimpleStructTestCase.xml in Resources */,
07B52BEA101004810015AD8B /* TestCases.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8DC2EF520486A6940098B216 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0759A6F31143495E000DFE98 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
0715852011432A78003D3454 /* Run Script: Include Git commit hash */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script: Include Git commit hash";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /usr/bin/ruby;
shellScript = "raise \"Must be executed from within Xcode.\" unless ENV['XCODE_VERSION_ACTUAL']\n\ninfo_plist = \"#{ENV['BUILT_PRODUCTS_DIR']}/#{ENV['WRAPPER_NAME']}/Resources/Info.plist\"\n\nif !File.exist?('/usr/local/bin/git')\n exit\nend\n\ncommit = `/usr/local/bin/git rev-parse --short HEAD`.chomp!\n\nif commit.nil? or commit.empty?\n exit\nend\n\nlines = IO.readlines(info_plist).join\n\nlines.gsub! /(<key>CFBundleShortVersionString<\\/key>\\W*)<string>(\\d+\\.\\d+(?:\\.\\d)*[a-z]?)<\\/string>/, \"\\\\1<string>\\\\2 rev. #{commit}</string>\"\n\nFile.open(info_plist, 'w') { |f| f.puts lines }";
};
0799AF010F6721FF00B71B22 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
};
903B0DFB12F75B2300BD6E09 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#\n# Version 2.0 (updated for Xcode 4, with some fixes)\n#\n# Author: Adam Martin - http://twitter.com/redglassesapps\n#\n# For more information see this Stack Overflow question:\n# http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4\n#\nDEBUG_THIS_SCRIPT=\"false\"\n\nif [ $DEBUG_THIS_SCRIPT = \"true\" ]\nthen\necho \"########### TESTS #############\"\necho \"Use the following variables when debugging this script; note that they may change\"\necho \"BUILD_DIR = $BUILD_DIR\"\necho \"BUILD_ROOT = $BUILD_ROOT\"\necho \"CONFIGURATION_BUILD_DIR = $CONFIGURATION_BUILD_DIR\"\necho \"BUILT_PRODUCTS_DIR = $BUILT_PRODUCTS_DIR\"\necho \"CONFIGURATION_TEMP_DIR = $CONFIGURATION_TEMP_DIR\"\necho \"TARGET_BUILD_DIR = $TARGET_BUILD_DIR\"\nfi\n\n########################################################\n\nSDK_VERSION=$(echo ${SDK_NAME} | grep -o '.\\{3\\}$')\n\nif [ ${PLATFORM_NAME} = \"iphonesimulator\" ]\nthen\nOTHER_SDK_TO_BUILD=iphoneos${SDK_VERSION}\nelse\nOTHER_SDK_TO_BUILD=iphonesimulator${SDK_VERSION}\nfi\n\necho \"XCode has selected SDK: ${PLATFORM_NAME} with version: ${SDK_VERSION} (although back-targetting: ${IPHONEOS_DEPLOYMENT_TARGET})\"\necho \"...therefore, OTHER_SDK_TO_BUILD = ${OTHER_SDK_TO_BUILD}\"\n\n########################################################\n\nif [ \"true\" == ${ALREADYINVOKED:-false} ]\nthen\necho \"RECURSION: I am NOT the root invocation, so I'm NOT going to recurse\"\nelse\nexport ALREADYINVOKED=\"true\"\n\necho \"RECURSION: I am the root ... recursing all missing build targets NOW...\"\necho \"RECURSION: ...about to invoke: xcodebuild -configuration \\\"${CONFIGURATION}\\\" -target \\\"${TARGET_NAME}\\\" -sdk \\\"${OTHER_SDK_TO_BUILD}\\\" ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO\"\n\nxcodebuild -configuration \"${CONFIGURATION}\" -target \"${TARGET_NAME}\" -sdk \"${OTHER_SDK_TO_BUILD}\" ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\"\n\nACTION=\"build\"\n\nCURRENTCONFIG_DEVICE_DIR=${SYMROOT}/${CONFIGURATION}-iphoneos\nCURRENTCONFIG_SIMULATOR_DIR=${SYMROOT}/${CONFIGURATION}-iphonesimulator\n\necho \"Taking device build from: ${CURRENTCONFIG_DEVICE_DIR}\"\necho \"Taking simulator build from: ${CURRENTCONFIG_SIMULATOR_DIR}\"\n\nCREATING_UNIVERSAL_DIR=${SYMROOT}/${CONFIGURATION}-universal\n\necho \"...I will output a universal build to: ${CREATING_UNIVERSAL_DIR}\"\n\nrm -rf \"${CREATING_UNIVERSAL_DIR}\"\nmkdir \"${CREATING_UNIVERSAL_DIR}\"\n\necho \"lipo: for current configuration (${CONFIGURATION}) creating output file: ${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME}\"\n\nlipo -create -output \"${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME}\" \"${CURRENTCONFIG_DEVICE_DIR}/${EXECUTABLE_NAME}\" \"${CURRENTCONFIG_SIMULATOR_DIR}/${EXECUTABLE_NAME}\"\n\nif [ -d \"${CURRENTCONFIG_DEVICE_DIR}/usr/local/include\" ]\nthen\nmkdir -p \"${CREATING_UNIVERSAL_DIR}/usr/local/include\"\ncp \"${CURRENTCONFIG_DEVICE_DIR}/usr/local/include/\"* \"${CREATING_UNIVERSAL_DIR}/usr/local/include\"\nfi\nfi";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
0799AEFF0F6721FF00B71B22 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
07B52C03101008670015AD8B /* XMLRPCParserTest.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8DC2EF540486A6940098B216 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
07B0C6080E33A659006453B4 /* NSStringAdditions.m in Sources */,
07B0C60B0E33A659006453B4 /* XMLRPCConnection.m in Sources */,
075137FC0E429E560019E4F6 /* XMLRPCConnectionManager.m in Sources */,
07B0C60F0E33A659006453B4 /* XMLRPCDefaultEncoder.m in Sources */,
07EF453C0E721A5D009F2708 /* XMLRPCEventBasedParser.m in Sources */,
0707047910114B9400CB7702 /* XMLRPCEventBasedParserDelegate.m in Sources */,
07B0C6110E33A659006453B4 /* XMLRPCRequest.m in Sources */,
07B0C6130E33A659006453B4 /* XMLRPCResponse.m in Sources */,
033836851527905D00EF8E8A /* NSData+Base64.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
903B0DB312F7574800BD6E09 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
903B0DC312F7581200BD6E09 /* NSStringAdditions.m in Sources */,
903B0DC712F7581200BD6E09 /* XMLRPCConnection.m in Sources */,
903B0DC912F7581200BD6E09 /* XMLRPCConnectionManager.m in Sources */,
903B0DCB12F7581200BD6E09 /* XMLRPCDefaultEncoder.m in Sources */,
903B0DCD12F7581200BD6E09 /* XMLRPCEventBasedParser.m in Sources */,
903B0DCF12F7581200BD6E09 /* XMLRPCEventBasedParserDelegate.m in Sources */,
903B0DD112F7581200BD6E09 /* XMLRPCRequest.m in Sources */,
903B0DD312F7581200BD6E09 /* XMLRPCResponse.m in Sources */,
033836861527905D00EF8E8A /* NSData+Base64.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
0799AF190F67240B00B71B22 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8DC2EF4F0486A6940098B216 /* XMLRPC */;
targetProxy = 0799AF180F67240B00B71B22 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
0759A6F11143495E000DFE98 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
0759A6F21143495E000DFE98 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
0799AF050F67220000B71B22 /* Development */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0799AF0B0F67227F00B71B22 /* XMLRPCUnitTestsDevelopment.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
);
VERSION_INFO_FILE = "";
};
name = Development;
};
0799AF060F67220000B71B22 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0799AF0C0F67227F00B71B22 /* XMLRPCUnitTestsRelease.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
);
VERSION_INFO_FILE = "";
};
name = Release;
};
1DEB91AE08733DA50010E9CD /* Development */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0799AF100F6722D600B71B22 /* XMLRPCDevelopment.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
VERSION_INFO_FILE = "";
};
name = Development;
};
1DEB91AF08733DA50010E9CD /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0799AF110F6722D600B71B22 /* XMLRPCRelease.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
VERSION_INFO_FILE = "";
};
name = Release;
};
1DEB91B208733DA50010E9CD /* Development */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 07127C590F4266F4009C7476 /* CommonDevelopment.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
};
name = Development;
};
1DEB91B308733DA50010E9CD /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 07127C5A0F4266F4009C7476 /* CommonRelease.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
};
name = Release;
};
903B0DB712F7574900BD6E09 /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
"$(ARCHS_STANDARD_32_BIT)",
armv6,
);
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
PRODUCT_NAME = XMLRPC;
PUBLIC_HEADERS_FOLDER_PATH = /headers/;
SDKROOT = iphoneos;
VALID_ARCHS = "armv7 armv6";
};
name = Development;
};
903B0DB812F7574900BD6E09 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
"$(ARCHS_STANDARD_32_BIT)",
armv6,
);
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
PRODUCT_NAME = XMLRPC;
PUBLIC_HEADERS_FOLDER_PATH = /headers/;
SDKROOT = iphoneos;
VALID_ARCHS = "armv7 armv6";
ZERO_LINK = NO;
};
name = Release;
};
D3554ED915CA7E4500478841 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 07127C590F4266F4009C7476 /* CommonDevelopment.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
};
name = Debug;
};
D3554EDA15CA7E4500478841 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0799AF100F6722D600B71B22 /* XMLRPCDevelopment.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
VERSION_INFO_FILE = "";
};
name = Debug;
};
D3554EDB15CA7E4500478841 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
"$(ARCHS_STANDARD_32_BIT)",
armv6,
);
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
PRODUCT_NAME = XMLRPC;
PUBLIC_HEADERS_FOLDER_PATH = /headers/;
SDKROOT = iphoneos;
VALID_ARCHS = "armv7 armv6";
};
name = Debug;
};
D3554EDC15CA7E4500478841 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0799AF0B0F67227F00B71B22 /* XMLRPCUnitTestsDevelopment.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
);
VERSION_INFO_FILE = "";
};
name = Debug;
};
D3554EDD15CA7E5600478841 /* Distribution */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 07127C5A0F4266F4009C7476 /* CommonRelease.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
};
name = Distribution;
};
D3554EDE15CA7E5600478841 /* Distribution */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0799AF110F6722D600B71B22 /* XMLRPCRelease.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
VERSION_INFO_FILE = "";
};
name = Distribution;
};
D3554EDF15CA7E5600478841 /* Distribution */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
"$(ARCHS_STANDARD_32_BIT)",
armv6,
);
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
PRODUCT_NAME = XMLRPC;
PUBLIC_HEADERS_FOLDER_PATH = /headers/;
SDKROOT = iphoneos;
VALID_ARCHS = "armv7 armv6";
ZERO_LINK = NO;
};
name = Distribution;
};
D3554EE015CA7E5600478841 /* Distribution */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0799AF0C0F67227F00B71B22 /* XMLRPCUnitTestsRelease.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
);
VERSION_INFO_FILE = "";
};
name = Distribution;
};
D3554EE115CA7E6000478841 /* DistributionAdhoc */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 07127C5A0F4266F4009C7476 /* CommonRelease.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
};
name = DistributionAdhoc;
};
D3554EE215CA7E6000478841 /* DistributionAdhoc */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0799AF110F6722D600B71B22 /* XMLRPCRelease.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
VERSION_INFO_FILE = "";
};
name = DistributionAdhoc;
};
D3554EE315CA7E6000478841 /* DistributionAdhoc */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
"$(ARCHS_STANDARD_32_BIT)",
armv6,
);
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
PRODUCT_NAME = XMLRPC;
PUBLIC_HEADERS_FOLDER_PATH = /headers/;
SDKROOT = iphoneos;
VALID_ARCHS = "armv7 armv6";
ZERO_LINK = NO;
};
name = DistributionAdhoc;
};
D3554EE415CA7E6000478841 /* DistributionAdhoc */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0799AF0C0F67227F00B71B22 /* XMLRPCUnitTestsRelease.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
);
VERSION_INFO_FILE = "";
};
name = DistributionAdhoc;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
0799AF070F67220000B71B22 /* Build configuration list for PBXNativeTarget "XMLRPCUnitTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0799AF050F67220000B71B22 /* Development */,
D3554EDC15CA7E4500478841 /* Debug */,
0799AF060F67220000B71B22 /* Release */,
D3554EE015CA7E5600478841 /* Distribution */,
D3554EE415CA7E6000478841 /* DistributionAdhoc */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "XMLRPC" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB91AE08733DA50010E9CD /* Development */,
D3554EDA15CA7E4500478841 /* Debug */,
1DEB91AF08733DA50010E9CD /* Release */,
D3554EDE15CA7E5600478841 /* Distribution */,
D3554EE215CA7E6000478841 /* DistributionAdhoc */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "XMLRPC" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB91B208733DA50010E9CD /* Development */,
D3554ED915CA7E4500478841 /* Debug */,
1DEB91B308733DA50010E9CD /* Release */,
D3554EDD15CA7E5600478841 /* Distribution */,
D3554EE115CA7E6000478841 /* DistributionAdhoc */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
903B0DB912F7577B00BD6E09 /* Build configuration list for PBXNativeTarget "libXMLRPC" */ = {
isa = XCConfigurationList;
buildConfigurations = (
903B0DB712F7574900BD6E09 /* Development */,
D3554EDB15CA7E4500478841 /* Debug */,
903B0DB812F7574900BD6E09 /* Release */,
D3554EDF15CA7E5600478841 /* Distribution */,
D3554EE315CA7E6000478841 /* DistributionAdhoc */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
}

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict/>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>0799AF020F6721FF00B71B22</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>8DC2EF4F0486A6940098B216</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>903B0DB512F7574800BD6E09</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View file

@ -0,0 +1,33 @@
#import <Foundation/Foundation.h>
#import "XMLRPCConnectionDelegate.h"
@class XMLRPCConnectionManager, XMLRPCRequest, XMLRPCResponse;
@interface XMLRPCConnection : NSObject {
XMLRPCConnectionManager *myManager;
XMLRPCRequest *myRequest;
NSString *myIdentifier;
NSMutableData *myData;
NSURLConnection *myConnection;
id<XMLRPCConnectionDelegate> myDelegate;
}
- (id)initWithXMLRPCRequest: (XMLRPCRequest *)request delegate: (id<XMLRPCConnectionDelegate>)delegate manager: (XMLRPCConnectionManager *)manager;
#pragma mark -
+ (XMLRPCResponse *)sendSynchronousXMLRPCRequest: (XMLRPCRequest *)request error: (NSError **)error;
#pragma mark -
- (NSString *)identifier;
#pragma mark -
- (id<XMLRPCConnectionDelegate>)delegate;
#pragma mark -
- (void)cancel;
@end

View file

@ -0,0 +1,214 @@
#import "XMLRPCConnection.h"
#import "XMLRPCConnectionManager.h"
#import "XMLRPCRequest.h"
#import "XMLRPCResponse.h"
#import "NSStringAdditions.h"
@interface XMLRPCConnection (XMLRPCConnectionPrivate)
- (void)connection: (NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response;
- (void)connection: (NSURLConnection *)connection didReceiveData: (NSData *)data;
- (void)connection:(NSURLConnection *)connection
didSendBodyData:(NSInteger)bytesWritten
totalBytesWritten:(NSInteger)totalBytesWritten
totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite;
- (void)connection: (NSURLConnection *)connection didFailWithError: (NSError *)error;
#pragma mark -
- (BOOL)connection: (NSURLConnection *)connection canAuthenticateAgainstProtectionSpace: (NSURLProtectionSpace *)protectionSpace;
- (void)connection: (NSURLConnection *)connection didReceiveAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge;
- (void)connection: (NSURLConnection *)connection didCancelAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge;
- (void)connectionDidFinishLoading: (NSURLConnection *)connection;
@end
#pragma mark -
@implementation XMLRPCConnection
- (id)initWithXMLRPCRequest: (XMLRPCRequest *)request delegate: (id<XMLRPCConnectionDelegate>)delegate manager: (XMLRPCConnectionManager *)manager {
self = [super init];
if (self) {
#if ! __has_feature(objc_arc)
myManager = [manager retain];
myRequest = [request retain];
myIdentifier = [[NSString stringByGeneratingUUID] retain];
#else
myManager = manager;
myRequest = request;
myIdentifier = [NSString stringByGeneratingUUID];
#endif
myData = [[NSMutableData alloc] init];
myConnection = [[NSURLConnection alloc] initWithRequest: [request request] delegate: self];
#if ! __has_feature(objc_arc)
myDelegate = [delegate retain];
#else
myDelegate = delegate;
#endif
if (myConnection) {
NSLog(@"The connection, %@, has been established!", myIdentifier);
} else {
NSLog(@"The connection, %@, could not be established!", myIdentifier);
#if ! __has_feature(objc_arc)
[self release];
#endif
return nil;
}
}
return self;
}
#pragma mark -
+ (XMLRPCResponse *)sendSynchronousXMLRPCRequest: (XMLRPCRequest *)request error: (NSError **)error {
NSHTTPURLResponse *response = nil;
#if ! __has_feature(objc_arc)
NSData *data = [[[NSURLConnection sendSynchronousRequest: [request request] returningResponse: &response error: error] retain] autorelease];
#else
NSData *data = [NSURLConnection sendSynchronousRequest: [request request] returningResponse: &response error: error];
#endif
if (response) {
NSInteger statusCode = [response statusCode];
if ((statusCode < 400) && data) {
#if ! __has_feature(objc_arc)
return [[[XMLRPCResponse alloc] initWithData: data] autorelease];
#else
return [[XMLRPCResponse alloc] initWithData: data];
#endif
}
}
return nil;
}
#pragma mark -
- (NSString *)identifier {
#if ! __has_feature(objc_arc)
return [[myIdentifier retain] autorelease];
#else
return myIdentifier;
#endif
}
#pragma mark -
- (id<XMLRPCConnectionDelegate>)delegate {
return myDelegate;
}
#pragma mark -
- (void)cancel {
[myConnection cancel];
}
#pragma mark -
- (void)dealloc {
#if ! __has_feature(objc_arc)
[myManager release];
[myRequest release];
[myIdentifier release];
[myData release];
[myConnection release];
[myDelegate release];
[super dealloc];
#endif
}
@end
#pragma mark -
@implementation XMLRPCConnection (XMLRPCConnectionPrivate)
- (void)connection: (NSURLConnection *)connection didReceiveResponse: (NSURLResponse *)response {
if([response respondsToSelector: @selector(statusCode)]) {
int statusCode = [(NSHTTPURLResponse *)response statusCode];
if(statusCode >= 400) {
NSError *error = [NSError errorWithDomain: @"HTTP" code: statusCode userInfo: nil];
[myDelegate request: myRequest didFailWithError: error];
} else if (statusCode == 304) {
[myManager closeConnectionForIdentifier: myIdentifier];
}
}
[myData setLength: 0];
}
- (void)connection: (NSURLConnection *)connection didReceiveData: (NSData *)data {
[myData appendData: data];
}
- (void)connection:(NSURLConnection *)connection
didSendBodyData:(NSInteger)bytesWritten
totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
{
if ([myDelegate respondsToSelector:@selector(request:didSendBodyData:)]) {
float percent = totalBytesWritten / (float)totalBytesExpectedToWrite;
[myDelegate request:myRequest didSendBodyData:percent];
}
}
- (void)connection: (NSURLConnection *)connection didFailWithError: (NSError *)error {
#if ! __has_feature(objc_arc)
XMLRPCRequest *request = [[myRequest retain] autorelease];
#else
XMLRPCRequest *request = myRequest;
#endif
NSLog(@"The connection, %@, failed with the following error: %@", myIdentifier, [error localizedDescription]);
[myDelegate request: request didFailWithError: error];
[myManager closeConnectionForIdentifier: myIdentifier];
}
#pragma mark -
- (BOOL)connection: (NSURLConnection *)connection canAuthenticateAgainstProtectionSpace: (NSURLProtectionSpace *)protectionSpace {
return [myDelegate request: myRequest canAuthenticateAgainstProtectionSpace: protectionSpace];
}
- (void)connection: (NSURLConnection *)connection didReceiveAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge {
[myDelegate request: myRequest didReceiveAuthenticationChallenge: challenge];
}
- (void)connection: (NSURLConnection *)connection didCancelAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge {
[myDelegate request: myRequest didCancelAuthenticationChallenge: challenge];
}
- (void)connectionDidFinishLoading: (NSURLConnection *)connection {
if (myData && ([myData length] > 0)) {
#if ! __has_feature(objc_arc)
XMLRPCResponse *response = [[[XMLRPCResponse alloc] initWithData: myData] autorelease];
XMLRPCRequest *request = [[myRequest retain] autorelease];
#else
XMLRPCResponse *response = [[XMLRPCResponse alloc] initWithData: myData];
XMLRPCRequest *request = myRequest;
#endif
[myDelegate request: request didReceiveResponse: response];
}
[myManager closeConnectionForIdentifier: myIdentifier];
}
@end

View file

@ -0,0 +1,27 @@
#import <Foundation/Foundation.h>
@class XMLRPCConnection, XMLRPCRequest, XMLRPCResponse;
@protocol XMLRPCConnectionDelegate<NSObject>
@required
- (void)request: (XMLRPCRequest *)request didReceiveResponse: (XMLRPCResponse *)response;
@optional
- (void)request: (XMLRPCRequest *)request didSendBodyData: (float)percent;
@required
- (void)request: (XMLRPCRequest *)request didFailWithError: (NSError *)error;
#pragma mark -
@required
- (BOOL)request: (XMLRPCRequest *)request canAuthenticateAgainstProtectionSpace: (NSURLProtectionSpace *)protectionSpace;
@required
- (void)request: (XMLRPCRequest *)request didReceiveAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge;
@required
- (void)request: (XMLRPCRequest *)request didCancelAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge;
@end

View file

@ -0,0 +1,32 @@
#import <Foundation/Foundation.h>
#import "XMLRPCConnectionDelegate.h"
@class XMLRPCConnection, XMLRPCRequest;
@interface XMLRPCConnectionManager : NSObject {
NSMutableDictionary *myConnections;
}
+ (XMLRPCConnectionManager *)sharedManager;
#pragma mark -
- (NSString *)spawnConnectionWithXMLRPCRequest: (XMLRPCRequest *)request delegate: (id<XMLRPCConnectionDelegate>)delegate;
#pragma mark -
- (NSArray *)activeConnectionIdentifiers;
- (int)numberOfActiveConnections;
#pragma mark -
- (XMLRPCConnection *)connectionForIdentifier: (NSString *)identifier;
#pragma mark -
- (void)closeConnectionForIdentifier: (NSString *)identifier;
- (void)closeConnections;
@end

View file

@ -0,0 +1,115 @@
#import "XMLRPCConnectionManager.h"
#import "XMLRPCConnection.h"
#import "XMLRPCRequest.h"
@implementation XMLRPCConnectionManager
static XMLRPCConnectionManager *sharedInstance = nil;
- (id)init {
self = [super init];
if (self) {
myConnections = [[NSMutableDictionary alloc] init];
}
return self;
}
#pragma mark -
+ (id)allocWithZone: (NSZone *)zone {
@synchronized(self) {
if (!sharedInstance) {
sharedInstance = [super allocWithZone: zone];
return sharedInstance;
}
}
return nil;
}
#pragma mark -
+ (XMLRPCConnectionManager *)sharedManager {
@synchronized(self) {
if (!sharedInstance) {
sharedInstance = [[self alloc] init];
}
}
return sharedInstance;
}
#pragma mark -
- (NSString *)spawnConnectionWithXMLRPCRequest: (XMLRPCRequest *)request delegate: (id<XMLRPCConnectionDelegate>)delegate {
XMLRPCConnection *newConnection = [[XMLRPCConnection alloc] initWithXMLRPCRequest: request delegate: delegate manager: self];
#if ! __has_feature(objc_arc)
NSString *identifier = [[[newConnection identifier] retain] autorelease];
#else
NSString *identifier = [newConnection identifier];
#endif
[myConnections setObject: newConnection forKey: identifier];
#if ! __has_feature(objc_arc)
[newConnection release];
#endif
return identifier;
}
#pragma mark -
- (NSArray *)activeConnectionIdentifiers {
return [myConnections allKeys];
}
- (int)numberOfActiveConnections {
return [myConnections count];
}
#pragma mark -
- (XMLRPCConnection *)connectionForIdentifier: (NSString *)identifier {
return [myConnections objectForKey: identifier];
}
#pragma mark -
- (void)closeConnectionForIdentifier: (NSString *)identifier {
XMLRPCConnection *selectedConnection = [self connectionForIdentifier: identifier];
if (selectedConnection) {
[selectedConnection cancel];
[myConnections removeObjectForKey: identifier];
}
}
- (void)closeConnections {
[[myConnections allValues] makeObjectsPerformSelector: @selector(cancel)];
[myConnections removeAllObjects];
}
#pragma mark -
- (void)finalize {
[self closeConnections];
[super finalize];
}
#pragma mark -
- (void)dealloc {
[self closeConnections];
#if ! __has_feature(objc_arc)
[myConnections release];
[super dealloc];
#endif
}
@end

View file

@ -0,0 +1,8 @@
#import <Foundation/Foundation.h>
#import "XMLRPCEncoder.h"
@interface XMLRPCDefaultEncoder : NSObject <XMLRPCEncoder> {
NSString *myMethod;
NSArray *myParameters;
}
@end

View file

@ -0,0 +1,253 @@
#import "XMLRPCDefaultEncoder.h"
#import "NSStringAdditions.h"
#import "NSData+Base64.h"
@interface XMLRPCDefaultEncoder (XMLRPCEncoderPrivate)
- (NSString *)valueTag: (NSString *)tag value: (NSString *)value;
#pragma mark -
- (NSString *)replaceTarget: (NSString *)target withValue: (NSString *)value inString: (NSString *)string;
#pragma mark -
- (NSString *)encodeObject: (id)object;
#pragma mark -
- (NSString *)encodeArray: (NSArray *)array;
- (NSString *)encodeDictionary: (NSDictionary *)dictionary;
#pragma mark -
- (NSString *)encodeBoolean: (CFBooleanRef)boolean;
- (NSString *)encodeNumber: (NSNumber *)number;
- (NSString *)encodeString: (NSString *)string omitTag: (BOOL)omitTag;
- (NSString *)encodeDate: (NSDate *)date;
- (NSString *)encodeData: (NSData *)data;
@end
#pragma mark -
@implementation XMLRPCDefaultEncoder
- (id)init {
self = [super init];
if (self) {
myMethod = [[NSString alloc] init];
myParameters = [[NSArray alloc] init];
}
return self;
}
#pragma mark -
- (NSString *)encode {
NSMutableString *buffer = [NSMutableString stringWithString: @"<?xml version=\"1.0\"?><methodCall>"];
[buffer appendFormat: @"<methodName>%@</methodName>", [self encodeString: myMethod omitTag: YES]];
[buffer appendString: @"<params>"];
if (myParameters) {
NSEnumerator *enumerator = [myParameters objectEnumerator];
id parameter = nil;
while ((parameter = [enumerator nextObject])) {
[buffer appendString: @"<param>"];
[buffer appendString: [self encodeObject: parameter]];
[buffer appendString: @"</param>"];
}
}
[buffer appendString: @"</params>"];
[buffer appendString: @"</methodCall>"];
return buffer;
}
#pragma mark -
- (void)setMethod: (NSString *)method withParameters: (NSArray *)parameters {
#if ! __has_feature(objc_arc)
if (myMethod) {
[myMethod release];
}
if (!method) {
myMethod = nil;
} else {
myMethod = [method retain];
}
if (myParameters) {
[myParameters release];
}
if (!parameters) {
myParameters = nil;
} else {
myParameters = [parameters retain];
}
#else
myMethod = method;
myParameters = parameters;
#endif
}
#pragma mark -
- (NSString *)method {
return myMethod;
}
- (NSArray *)parameters {
return myParameters;
}
#pragma mark -
- (void)dealloc {
#if ! __has_feature(objc_arc)
[myMethod release];
[myParameters release];
[super dealloc];
#endif
}
@end
#pragma mark -
@implementation XMLRPCDefaultEncoder (XMLRPCEncoderPrivate)
- (NSString *)valueTag: (NSString *)tag value: (NSString *)value {
return [NSString stringWithFormat: @"<value><%@>%@</%@></value>", tag, value, tag];
}
#pragma mark -
- (NSString *)replaceTarget: (NSString *)target withValue: (NSString *)value inString: (NSString *)string {
return [[string componentsSeparatedByString: target] componentsJoinedByString: value];
}
#pragma mark -
- (NSString *)encodeObject: (id)object {
if (!object) {
return nil;
}
if ([object isKindOfClass: [NSArray class]]) {
return [self encodeArray: object];
} else if ([object isKindOfClass: [NSDictionary class]]) {
return [self encodeDictionary: object];
} else if (((/*__bridge_retained*/ CFBooleanRef)object == kCFBooleanTrue) || ((/*__bridge_retained*/ CFBooleanRef)object == kCFBooleanFalse)) {
return [self encodeBoolean: (CFBooleanRef)object];
} else if ([object isKindOfClass: [NSNumber class]]) {
return [self encodeNumber: object];
} else if ([object isKindOfClass: [NSString class]]) {
return [self encodeString: object omitTag: NO];
} else if ([object isKindOfClass: [NSDate class]]) {
return [self encodeDate: object];
} else if ([object isKindOfClass: [NSData class]]) {
return [self encodeData: object];
} else {
return [self encodeString: object omitTag: NO];
}
}
#pragma mark -
- (NSString *)encodeArray: (NSArray *)array {
NSMutableString *buffer = [NSMutableString string];
NSEnumerator *enumerator = [array objectEnumerator];
[buffer appendString: @"<value><array><data>"];
id object = nil;
while (object = [enumerator nextObject]) {
[buffer appendString: [self encodeObject: object]];
}
[buffer appendString: @"</data></array></value>"];
return (NSString *)buffer;
}
- (NSString *)encodeDictionary: (NSDictionary *)dictionary {
NSMutableString * buffer = [NSMutableString string];
NSEnumerator *enumerator = [dictionary keyEnumerator];
[buffer appendString: @"<value><struct>"];
NSString *key = nil;
NSObject *val;
while (key = [enumerator nextObject]) {
[buffer appendString: @"<member>"];
[buffer appendFormat: @"<name>%@</name>", [self encodeString: key omitTag: YES]];
val = [dictionary objectForKey: key];
if (val != [NSNull null]) {
[buffer appendString: [self encodeObject: val]];
} else {
[buffer appendString:@"<value><nil/></value>"];
}
[buffer appendString: @"</member>"];
}
[buffer appendString: @"</struct></value>"];
return (NSString *)buffer;
}
#pragma mark -
- (NSString *)encodeBoolean: (CFBooleanRef)boolean {
if (boolean == kCFBooleanTrue) {
return [self valueTag: @"boolean" value: @"1"];
} else {
return [self valueTag: @"boolean" value: @"0"];
}
}
- (NSString *)encodeNumber: (NSNumber *)number {
NSString *numberType = [NSString stringWithCString: [number objCType] encoding: NSUTF8StringEncoding];
if ([numberType isEqualToString: @"d"]) {
return [self valueTag: @"double" value: [number stringValue]];
} else {
return [self valueTag: @"i4" value: [number stringValue]];
}
}
- (NSString *)encodeString: (NSString *)string omitTag: (BOOL)omitTag {
return omitTag ? [string escapedString] : [self valueTag: @"string" value: [string escapedString]];
}
- (NSString *)encodeDate: (NSDate *)date {
unsigned components = kCFCalendarUnitYear | kCFCalendarUnitMonth | kCFCalendarUnitDay | kCFCalendarUnitHour | kCFCalendarUnitMinute | kCFCalendarUnitSecond;
NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components: components fromDate: date];
NSString *buffer = [NSString stringWithFormat: @"%.4d%.2d%.2dT%.2d:%.2d:%.2d", [dateComponents year], [dateComponents month], [dateComponents day], [dateComponents hour], [dateComponents minute], [dateComponents second], nil];
return [self valueTag: @"dateTime.iso8601" value: buffer];
}
- (NSString *)encodeData: (NSData *)data {
return [self valueTag: @"base64" value: [data base64EncodedString]];
}
@end

View file

@ -0,0 +1,15 @@
#import <Foundation/Foundation.h>
@protocol XMLRPCEncoder <NSObject>
- (NSString *)encode;
#pragma mark -
- (void)setMethod: (NSString *)method withParameters: (NSArray *)parameters;
#pragma mark -
- (NSString *)method;
- (NSArray *)parameters;
@end

View file

@ -0,0 +1,27 @@
#import <Foundation/Foundation.h>
@class XMLRPCEventBasedParserDelegate;
@interface XMLRPCEventBasedParser : NSObject<NSXMLParserDelegate> {
NSXMLParser *myParser;
XMLRPCEventBasedParserDelegate *myParserDelegate;
BOOL isFault;
}
- (id)initWithData: (NSData *)data;
#pragma mark -
- (id)parse;
- (void)abortParsing;
#pragma mark -
- (NSError *)parserError;
#pragma mark -
- (BOOL)isFault;
@end

View file

@ -0,0 +1,81 @@
#import "XMLRPCEventBasedParser.h"
#import "XMLRPCEventBasedParserDelegate.h"
@implementation XMLRPCEventBasedParser
- (id)initWithData: (NSData *)data {
if (!data) {
return nil;
}
if (self = [self init]) {
myParser = [[NSXMLParser alloc] initWithData: data];
myParserDelegate = nil;
isFault = NO;
}
return self;
}
#pragma mark -
- (id)parse {
[myParser setDelegate: self];
[myParser parse];
if ([myParser parserError]) {
return nil;
}
return [myParserDelegate elementValue];
}
- (void)abortParsing {
[myParser abortParsing];
}
#pragma mark -
- (NSError *)parserError {
return [myParser parserError];
}
#pragma mark -
- (BOOL)isFault {
return isFault;
}
#pragma mark -
- (void)dealloc {
#if ! __has_feature(objc_arc)
[myParser release];
[myParserDelegate release];
[super dealloc];
#endif
}
@end
#pragma mark -
@implementation XMLRPCEventBasedParser (NSXMLParserDelegate)
- (void)parser: (NSXMLParser *)parser didStartElement: (NSString *)element namespaceURI: (NSString *)namespaceURI qualifiedName: (NSString *)qualifiedName attributes: (NSDictionary *)attributes {
if ([element isEqualToString: @"fault"]) {
isFault = YES;
} else if ([element isEqualToString: @"value"]) {
myParserDelegate = [[XMLRPCEventBasedParserDelegate alloc] initWithParent: nil];
[myParser setDelegate: myParserDelegate];
}
}
- (void)parser: (NSXMLParser *)parser parseErrorOccurred: (NSError *)parseError {
[self abortParsing];
}
@end

View file

@ -0,0 +1,52 @@
#import <Foundation/Foundation.h>
typedef enum {
XMLRPCElementTypeArray,
XMLRPCElementTypeDictionary,
XMLRPCElementTypeMember,
XMLRPCElementTypeName,
XMLRPCElementTypeInteger,
XMLRPCElementTypeDouble,
XMLRPCElementTypeBoolean,
XMLRPCElementTypeString,
XMLRPCElementTypeDate,
XMLRPCElementTypeData
} XMLRPCElementType;
#pragma mark -
@interface XMLRPCEventBasedParserDelegate : NSObject<NSXMLParserDelegate> {
XMLRPCEventBasedParserDelegate *myParent;
NSMutableArray *myChildren;
XMLRPCElementType myElementType;
NSString *myElementKey;
id myElementValue;
}
- (id)initWithParent: (XMLRPCEventBasedParserDelegate *)parent;
#pragma mark -
- (void)setParent: (XMLRPCEventBasedParserDelegate *)parent;
- (XMLRPCEventBasedParserDelegate *)parent;
#pragma mark -
- (void)setElementType: (XMLRPCElementType)elementType;
- (XMLRPCElementType)elementType;
#pragma mark -
- (void)setElementKey: (NSString *)elementKey;
- (NSString *)elementKey;
#pragma mark -
- (void)setElementValue: (id)elementValue;
- (id)elementValue;
@end

View file

@ -0,0 +1,352 @@
#import "XMLRPCEventBasedParserDelegate.h"
#import "NSData+Base64.h"
@interface XMLRPCEventBasedParserDelegate (XMLRPCEventBasedParserDelegatePrivate)
- (BOOL)isDictionaryElementType: (XMLRPCElementType)elementType;
#pragma mark -
- (void)addElementValueToParent;
#pragma mark -
- (NSDate *)parseDateString: (NSString *)dateString withFormat: (NSString *)format;
#pragma mark -
- (NSNumber *)parseInteger: (NSString *)value;
- (NSNumber *)parseDouble: (NSString *)value;
- (NSNumber *)parseBoolean: (NSString *)value;
- (NSString *)parseString: (NSString *)value;
- (NSDate *)parseDate: (NSString *)value;
- (NSData *)parseData: (NSString *)value;
@end
#pragma mark -
@implementation XMLRPCEventBasedParserDelegate
- (id)initWithParent: (XMLRPCEventBasedParserDelegate *)parent {
self = [super init];
if (self) {
myParent = parent;
myChildren = [[NSMutableArray alloc] initWithCapacity: 1];
myElementType = XMLRPCElementTypeString;
myElementKey = nil;
myElementValue = [[NSMutableString alloc] init];
}
return self;
}
#pragma mark -
- (void)setParent: (XMLRPCEventBasedParserDelegate *)parent {
#if ! __has_feature(objc_arc)
[parent retain];
[myParent release];
#endif
myParent = parent;
}
- (XMLRPCEventBasedParserDelegate *)parent {
return myParent;
}
#pragma mark -
- (void)setElementType: (XMLRPCElementType)elementType {
myElementType = elementType;
}
- (XMLRPCElementType)elementType {
return myElementType;
}
#pragma mark -
- (void)setElementKey: (NSString *)elementKey {
#if ! __has_feature(objc_arc)
[elementKey retain];
[myElementKey release];
#endif
myElementKey = elementKey;
}
- (NSString *)elementKey {
return myElementKey;
}
#pragma mark -
- (void)setElementValue: (id)elementValue {
#if ! __has_feature(objc_arc)
[elementValue retain];
[myElementValue release];
#endif
myElementValue = elementValue;
}
- (id)elementValue {
return myElementValue;
}
#pragma mark -
- (void)dealloc {
#if ! __has_feature(objc_arc)
[myChildren release];
[myElementKey release];
[myElementValue release];
[super dealloc];
#endif
}
@end
#pragma mark -
@implementation XMLRPCEventBasedParserDelegate (NSXMLParserDelegate)
- (void)parser: (NSXMLParser *)parser didStartElement: (NSString *)element namespaceURI: (NSString *)namespaceURI qualifiedName: (NSString *)qualifiedName attributes: (NSDictionary *)attributes {
if ([element isEqualToString: @"value"] || [element isEqualToString: @"member"] || [element isEqualToString: @"name"]) {
XMLRPCEventBasedParserDelegate *parserDelegate = [[XMLRPCEventBasedParserDelegate alloc] initWithParent: self];
if ([element isEqualToString: @"member"]) {
[parserDelegate setElementType: XMLRPCElementTypeMember];
} else if ([element isEqualToString: @"name"]) {
[parserDelegate setElementType: XMLRPCElementTypeName];
}
[myChildren addObject: parserDelegate];
[parser setDelegate: parserDelegate];
#if ! __has_feature(objc_arc)
[parserDelegate release];
#endif
return;
}
if ([element isEqualToString: @"array"]) {
NSMutableArray *array = [[NSMutableArray alloc] init];
[self setElementValue: array];
#if ! __has_feature(objc_arc)
[array release];
#endif
[self setElementType: XMLRPCElementTypeArray];
} else if ([element isEqualToString: @"struct"]) {
NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init];
[self setElementValue: dictionary];
#if ! __has_feature(objc_arc)
[dictionary release];
#endif
[self setElementType: XMLRPCElementTypeDictionary];
} else if ([element isEqualToString: @"int"] || [element isEqualToString: @"i4"]) {
[self setElementType: XMLRPCElementTypeInteger];
} else if ([element isEqualToString: @"double"]) {
[self setElementType: XMLRPCElementTypeDouble];
} else if ([element isEqualToString: @"boolean"]) {
[self setElementType: XMLRPCElementTypeBoolean];
} else if ([element isEqualToString: @"string"]) {
[self setElementType: XMLRPCElementTypeString];
} else if ([element isEqualToString: @"dateTime.iso8601"]) {
[self setElementType: XMLRPCElementTypeDate];
} else if ([element isEqualToString: @"base64"]) {
[self setElementType: XMLRPCElementTypeData];
}
}
- (void)parser: (NSXMLParser *)parser didEndElement: (NSString *)element namespaceURI: (NSString *)namespaceURI qualifiedName: (NSString *)qualifiedName {
if ([element isEqualToString: @"value"] || [element isEqualToString: @"member"] || [element isEqualToString: @"name"]) {
NSString *elementValue = nil;
if ((myElementType != XMLRPCElementTypeArray) && ![self isDictionaryElementType: myElementType]) {
elementValue = [self parseString: myElementValue];
#if ! __has_feature(objc_arc)
[myElementValue release];
#endif
myElementValue = nil;
}
switch (myElementType) {
case XMLRPCElementTypeInteger:
myElementValue = [self parseInteger: elementValue];
#if ! __has_feature(objc_arc)
[myElementValue retain];
#endif
break;
case XMLRPCElementTypeDouble:
myElementValue = [self parseDouble: elementValue];
#if ! __has_feature(objc_arc)
[myElementValue retain];
#endif
break;
case XMLRPCElementTypeBoolean:
myElementValue = [self parseBoolean: elementValue];
#if ! __has_feature(objc_arc)
[myElementValue retain];
#endif
break;
case XMLRPCElementTypeString:
case XMLRPCElementTypeName:
myElementValue = elementValue;
#if ! __has_feature(objc_arc)
[myElementValue retain];
#endif
break;
case XMLRPCElementTypeDate:
myElementValue = [self parseDate: elementValue];
#if ! __has_feature(objc_arc)
[myElementValue retain];
#endif
break;
case XMLRPCElementTypeData:
myElementValue = [self parseData: elementValue];
#if ! __has_feature(objc_arc)
[myElementValue retain];
#endif
break;
default:
break;
}
if (myParent && myElementValue) {
[self addElementValueToParent];
}
[parser setDelegate: myParent];
}
}
- (void)parser: (NSXMLParser *)parser foundCharacters: (NSString *)string {
if ((myElementType == XMLRPCElementTypeArray) || [self isDictionaryElementType: myElementType]) {
return;
}
if (!myElementValue) {
myElementValue = [[NSMutableString alloc] initWithString: string];
} else {
[myElementValue appendString: string];
}
}
- (void)parser: (NSXMLParser *)parser parseErrorOccurred: (NSError *)parseError {
[parser abortParsing];
}
@end
#pragma mark -
@implementation XMLRPCEventBasedParserDelegate (XMLRPCEventBasedParserDelegatePrivate)
- (BOOL)isDictionaryElementType: (XMLRPCElementType)elementType {
if ((myElementType == XMLRPCElementTypeDictionary) || (myElementType == XMLRPCElementTypeMember)) {
return YES;
}
return NO;
}
#pragma mark -
- (void)addElementValueToParent {
id parentElementValue = [myParent elementValue];
switch ([myParent elementType]) {
case XMLRPCElementTypeArray:
[parentElementValue addObject: myElementValue];
break;
case XMLRPCElementTypeDictionary:
if ([myElementValue isEqual:[NSNull null]]) {
[parentElementValue removeObjectForKey:myElementKey];
} else {
[parentElementValue setObject: myElementValue forKey: myElementKey];
}
break;
case XMLRPCElementTypeMember:
if (myElementType == XMLRPCElementTypeName) {
[myParent setElementKey: myElementValue];
} else {
[myParent setElementValue: myElementValue];
}
break;
default:
break;
}
}
#pragma mark -
- (NSDate *)parseDateString: (NSString *)dateString withFormat: (NSString *)format {
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
NSDate *result = nil;
[dateFormatter setDateFormat: format];
result = [dateFormatter dateFromString: dateString];
#if ! __has_feature(objc_arc)
[dateFormatter release];
#endif
return result;
}
#pragma mark -
- (NSNumber *)parseInteger: (NSString *)value {
return [NSNumber numberWithInteger: [value integerValue]];
}
- (NSNumber *)parseDouble: (NSString *)value {
return [NSNumber numberWithDouble: [value doubleValue]];
}
- (NSNumber *)parseBoolean: (NSString *)value {
if ([value isEqualToString: @"1"]) {
return [NSNumber numberWithBool: YES];
}
return [NSNumber numberWithBool: NO];
}
- (NSString *)parseString: (NSString *)value {
return [value stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
}
- (NSDate *)parseDate: (NSString *)value {
NSDate *result = nil;
result = [self parseDateString: value withFormat: @"yyyyMMdd'T'HH:mm:ss"];
if (!result) {
result = [self parseDateString: value withFormat: @"yyyy'-'MM'-'dd'T'HH:mm:ss"];
}
if (!result) {
result = (NSDate *)[NSNull null];
}
return result;
}
- (NSData *)parseData: (NSString *)value {
return [NSData dataFromBase64String: value];
}
@end

View file

@ -0,0 +1,51 @@
#import <Foundation/Foundation.h>
#import "XMLRPCEncoder.h"
@interface XMLRPCRequest : NSObject {
NSMutableURLRequest *myRequest;
id<XMLRPCEncoder> myXMLEncoder;
}
- (id)initWithURL: (NSURL *)URL;
#pragma mark -
- (void)setURL: (NSURL *)URL;
- (NSURL *)URL;
#pragma mark -
- (void)setUserAgent: (NSString *)userAgent;
- (NSString *)userAgent;
#pragma mark -
- (void)setEncoder: (id<XMLRPCEncoder>) encoder;
- (void)setMethod: (NSString *)method;
- (void)setMethod: (NSString *)method withParameter: (id)parameter;
- (void)setMethod: (NSString *)method withParameters: (NSArray *)parameters;
#pragma mark -
- (NSString *)method;
- (NSArray *)parameters;
#pragma mark -
- (NSString *)body;
#pragma mark -
- (NSURLRequest *)request;
#pragma mark -
- (void)setValue: (NSString *)value forHTTPHeaderField: (NSString *)header;
@end

View file

@ -0,0 +1,165 @@
#import "XMLRPCRequest.h"
#import "XMLRPCEncoder.h"
#import "XMLRPCDefaultEncoder.h"
@implementation XMLRPCRequest
- (id)initWithURL: (NSURL *)URL withEncoder: (id<XMLRPCEncoder>)encoder {
self = [super init];
if (self) {
if (URL) {
myRequest = [[NSMutableURLRequest alloc] initWithURL: URL];
} else {
myRequest = [[NSMutableURLRequest alloc] init];
}
myXMLEncoder = encoder;
#if ! __has_feature(objc_arc)
[myXMLEncoder retain];
#endif
}
return self;
}
- (id)initWithURL: (NSURL *)URL {
#if ! __has_feature(objc_arc)
return [self initWithURL:URL withEncoder:[[[XMLRPCDefaultEncoder alloc] init] autorelease]];
#else
return [self initWithURL:URL withEncoder:[[XMLRPCDefaultEncoder alloc] init]];
#endif
}
#pragma mark -
- (void)setURL: (NSURL *)URL {
[myRequest setURL: URL];
}
- (NSURL *)URL {
return [myRequest URL];
}
#pragma mark -
- (void)setUserAgent: (NSString *)userAgent {
if (![self userAgent]) {
[myRequest addValue: userAgent forHTTPHeaderField: @"User-Agent"];
} else {
[myRequest setValue: userAgent forHTTPHeaderField: @"User-Agent"];
}
}
- (NSString *)userAgent {
return [myRequest valueForHTTPHeaderField: @"User-Agent"];
}
#pragma mark -
- (void)setEncoder:(id<XMLRPCEncoder>)encoder {
//Copy the old method and parameters to the new encoder.
NSString *method = [myXMLEncoder method];
NSArray *parameters = [myXMLEncoder parameters];
#if ! __has_feature(objc_arc)
[myXMLEncoder release];
myXMLEncoder = [encoder retain];
#else
myXMLEncoder = encoder;
#endif
[myXMLEncoder setMethod:method withParameters:parameters];
}
- (void)setMethod: (NSString *)method {
[myXMLEncoder setMethod: method withParameters: nil];
}
- (void)setMethod: (NSString *)method withParameter: (id)parameter {
NSArray *parameters = nil;
if (parameter) {
parameters = [NSArray arrayWithObject: parameter];
}
[myXMLEncoder setMethod: method withParameters: parameters];
}
- (void)setMethod: (NSString *)method withParameters: (NSArray *)parameters {
[myXMLEncoder setMethod: method withParameters: parameters];
}
#pragma mark -
- (NSString *)method {
return [myXMLEncoder method];
}
- (NSArray *)parameters {
return [myXMLEncoder parameters];
}
#pragma mark -
- (NSString *)body {
return [myXMLEncoder encode];
}
#pragma mark -
- (NSURLRequest *)request {
NSData *content = [[self body] dataUsingEncoding: NSUTF8StringEncoding];
NSNumber *contentLength = [NSNumber numberWithInt: [content length]];
if (!myRequest) {
return nil;
}
[myRequest setHTTPMethod: @"POST"];
if (![myRequest valueForHTTPHeaderField: @"Content-Type"]) {
[myRequest addValue: @"text/xml" forHTTPHeaderField: @"Content-Type"];
} else {
[myRequest setValue: @"text/xml" forHTTPHeaderField: @"Content-Type"];
}
if (![myRequest valueForHTTPHeaderField: @"Content-Length"]) {
[myRequest addValue: [contentLength stringValue] forHTTPHeaderField: @"Content-Length"];
} else {
[myRequest setValue: [contentLength stringValue] forHTTPHeaderField: @"Content-Length"];
}
if (![myRequest valueForHTTPHeaderField: @"Accept"]) {
[myRequest addValue: @"text/xml" forHTTPHeaderField: @"Accept"];
} else {
[myRequest setValue: @"text/xml" forHTTPHeaderField: @"Accept"];
}
if (![self userAgent]) {
NSString *userAgent = [[NSUserDefaults standardUserDefaults] objectForKey:@"UserAgent"];
if (userAgent) {
[self setUserAgent:userAgent];
}
}
[myRequest setHTTPBody: content];
return (NSURLRequest *)myRequest;
}
#pragma mark -
- (void)setValue: (NSString *)value forHTTPHeaderField: (NSString *)header {
[myRequest setValue: value forHTTPHeaderField: header];
}
#pragma mark -
- (void)dealloc {
#if ! __has_feature(objc_arc)
[myRequest release];
[myXMLEncoder release];
[super dealloc];
#endif
}
@end

View file

@ -0,0 +1,33 @@
#import <Foundation/Foundation.h>
@class XMLRPCDecoder;
@interface XMLRPCResponse : NSObject {
NSString *myBody;
id myObject;
BOOL isFault;
}
- (id)initWithData: (NSData *)data;
#pragma mark -
- (BOOL)isFault;
- (NSNumber *)faultCode;
- (NSString *)faultString;
#pragma mark -
- (id)object;
#pragma mark -
- (NSString *)body;
#pragma mark -
- (NSString *)description;
@end

View file

@ -0,0 +1,97 @@
#import "XMLRPCResponse.h"
#import "XMLRPCEventBasedParser.h"
@implementation XMLRPCResponse
- (id)initWithData: (NSData *)data {
if (!data) {
return nil;
}
self = [super init];
if (self) {
XMLRPCEventBasedParser *parser = [[XMLRPCEventBasedParser alloc] initWithData: data];
if (!parser) {
#if ! __has_feature(objc_arc)
[self release];
#endif
return nil;
}
myBody = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding];
myObject = [parser parse];
#if ! __has_feature(objc_arc)
[myObject retain];
#endif
isFault = [parser isFault];
#if ! __has_feature(objc_arc)
[parser release];
#endif
}
return self;
}
#pragma mark -
- (BOOL)isFault {
return isFault;
}
- (NSNumber *)faultCode {
if (isFault) {
return [myObject objectForKey: @"faultCode"];
}
return nil;
}
- (NSString *)faultString {
if (isFault) {
return [myObject objectForKey: @"faultString"];
}
return nil;
}
#pragma mark -
- (id)object {
return myObject;
}
#pragma mark -
- (NSString *)body {
return myBody;
}
#pragma mark -
- (NSString *)description {
NSMutableString *msg = [NSMutableString stringWithCapacity:128];
[msg appendFormat:@"[body=%@", myBody];
if (isFault) {
[msg appendFormat:@", fault[%@]='%@'", [self faultCode], [self faultString]];
} else {
[msg appendFormat:@", obj=%@", myObject];
}
[msg appendString:@"]"];
return msg;
}
#pragma mark -
- (void)dealloc {
#if ! __has_feature(objc_arc)
[myBody release];
[myObject release];
[super dealloc];
#endif
}
@end

View file

@ -18,17 +18,22 @@
*/
#import <UIKit/UIKit.h>
#import <XMLRPCConnectionDelegate.h>
#import "UICompositeViewController.h"
@interface WizardViewController : UIViewController <UITextFieldDelegate, UICompositeViewDelegate> {
UIView *contentView;
@interface WizardViewController : UIViewController <UITextFieldDelegate, UICompositeViewDelegate, XMLRPCConnectionDelegate> {
UIScrollView *contentView;
UIView *welcomeView;
UIView *choiceView;
UIView *createAccountView;
UIView *connectAccountView;
UIView *externalAccountView;
UIView *validateAccountView;
UIView *waitView;
UIView *currentView;
UITextField *activeTextField;
UIButton *backButton;
UIButton *startButton;
@ -43,6 +48,9 @@
@property (nonatomic, retain) IBOutlet UIView *createAccountView;
@property (nonatomic, retain) IBOutlet UIView *connectAccountView;
@property (nonatomic, retain) IBOutlet UIView *externalAccountView;
@property (nonatomic, retain) IBOutlet UIView *validateAccountView;
@property (nonatomic, retain) IBOutlet UIView *waitView;
@property (nonatomic, retain) IBOutlet UIButton *backButton;
@property (nonatomic, retain) IBOutlet UIButton *startButton;
@ -54,5 +62,10 @@
- (IBAction)onCreateAccountClick:(id)sender;
- (IBAction)onConnectAccountClick:(id)sender;
- (IBAction)onExternalAccountClick:(id)sender;
- (IBAction)onCheckValidationClick:(id)sender;
- (IBAction)onSignInClick:(id)sender;
- (IBAction)onSignInExternalClick:(id)sender;
- (IBAction)onRegisterClick:(id)sender;
@end

View file

@ -18,13 +18,14 @@
*/
#import "WizardViewController.h"
#import <QuartzCore/QuartzCore.h>
#import "LinphoneManager.h"
#import "PhoneMainView.h"
#import <XMLRPCConnection.h>
#import <XMLRPCConnectionManager.h>
#import <XMLRPCResponse.h>
#import <XMLRPCRequest.h>
typedef enum _ViewElement {
ViewElement_Username = 100,
ViewElement_Password = 101,
@ -44,21 +45,33 @@ typedef enum _ViewElement {
@synthesize createAccountView;
@synthesize connectAccountView;
@synthesize externalAccountView;
@synthesize validateAccountView;
@synthesize waitView;
@synthesize backButton;
@synthesize startButton;
static int LINPHONE_WIZARD_MIN_PASSWORD_LENGTH = 6;
static int LINPHONE_WIZARD_MIN_USERNAME_LENGTH = 4;
static NSString *LINPHONE_WIZARD_URL = @"https://www.linphone.org/wizard.php";
static NSString *LINPHONE_WIZARD_DOMAIN = @"sip.linphone.org";
#pragma mark - Lifecycle Functions
- (id)init {
self = [super initWithNibName:@"WizardViewController" bundle:[NSBundle mainBundle]];
if (self != nil) {
self->historyViews = [[NSMutableArray alloc] init];
self->currentView = nil;
}
return self;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[contentView release];
[welcomeView release];
@ -66,6 +79,9 @@ typedef enum _ViewElement {
[createAccountView release];
[connectAccountView release];
[externalAccountView release];
[validateAccountView release];
[waitView release];
[backButton release];
[startButton release];
@ -89,7 +105,7 @@ static UICompositeViewDescription *compositeDescription = nil;
tabBar:nil
tabBarEnabled:false
fullscreen:false
landscapeMode:false
landscapeMode:[LinphoneManager runningOnIpad]
portraitMode:true];
}
return compositeDescription;
@ -100,11 +116,48 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewDidLoad {
[super viewDidLoad];
[self changeView:welcomeView back:FALSE animation:FALSE];
}
#pragma mark -
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self clearProxyConfig];
[self changeView:welcomeView back:FALSE animation:FALSE];
[waitView setHidden:TRUE];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationUpdateEvent:)
name:@"LinphoneRegistrationUpdate"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillHide:)
name:UIKeyboardWillHideNotification
object:nil];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:@"LinphoneRegistrationUpdate"
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIKeyboardWillHideNotification
object:nil];
}
#pragma mark -
+ (UIView*)findTextField:(ViewElement)tag view:(UIView*)view {
for(UIView *child in [view subviews]) {
@ -133,7 +186,12 @@ static UICompositeViewDescription *compositeDescription = nil;
return nil;
}
- (void)clearHistory {
[historyViews removeAllObjects];
}
- (void)changeView:(UIView *)view back:(BOOL)back animation:(BOOL)animation {
// Change toolbar buttons following view
if (view == welcomeView) {
[startButton setHidden:false];
[backButton setHidden:true];
@ -142,6 +200,13 @@ static UICompositeViewDescription *compositeDescription = nil;
[backButton setHidden:false];
}
if (view == validateAccountView) {
[backButton setEnabled:FALSE];
} else {
[backButton setEnabled:TRUE];
}
// Animation
if(animation) {
CATransition* trans = [CATransition animation];
[trans setType:kCATransitionPush];
@ -155,16 +220,101 @@ static UICompositeViewDescription *compositeDescription = nil;
[contentView.layer addAnimation:trans forKey:@"Transition"];
}
NSArray *childs = [contentView subviews];
if([childs count]> 0) {
UIView *childView = [childs objectAtIndex:0];
// Stack current view
if(currentView != nil) {
if(!back)
[historyViews addObject:childView];
[childView removeFromSuperview];
[historyViews addObject:currentView];
[currentView removeFromSuperview];
}
[contentView addSubview:view];
// Set current view
currentView = view;
[contentView insertSubview:view atIndex:0];
[view setFrame:[contentView bounds]];
[contentView setContentSize:[view bounds].size];
}
- (void)clearProxyConfig {
[[LinphoneManager instance].settingsStore setObject:@"" forKey:@"username_preference"];
[[LinphoneManager instance].settingsStore setObject:@"" forKey:@"password_preference"];
[[LinphoneManager instance].settingsStore setObject:@"" forKey:@"domain_preference"];
[[LinphoneManager instance].settingsStore synchronize];
}
- (void)addProxyConfig:(NSString*)username password:(NSString*)password domain:(NSString*)domain {
[[LinphoneManager instance].settingsStore setObject:username forKey:@"username_preference"];
[[LinphoneManager instance].settingsStore setObject:password forKey:@"password_preference"];
[[LinphoneManager instance].settingsStore setObject:domain forKey:@"domain_preference"];
[[LinphoneManager instance].settingsStore synchronize];
}
- (void)checkUserExist:(NSString*)username {
[LinphoneLogger log:LinphoneLoggerDebug format:@"XMLRPC check_account %@", username];
NSURL *URL = [NSURL URLWithString: LINPHONE_WIZARD_URL];
XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithURL: URL];
[request setMethod: @"check_account" withParameters:[NSArray arrayWithObjects:username, nil]];
XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager];
[manager spawnConnectionWithXMLRPCRequest: request delegate: self];
[request release];
[waitView setHidden:false];
}
- (void)createAccount:(NSString*)identity password:(NSString*)password email:(NSString*)email {
NSString *useragent = [LinphoneManager getUserAgent];
[LinphoneLogger log:LinphoneLoggerDebug format:@"XMLRPC create_account_with_useragent %@ %@ %@ %@", identity, password, email, useragent];
NSURL *URL = [NSURL URLWithString: LINPHONE_WIZARD_URL];
XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithURL: URL];
[request setMethod: @"create_account_with_useragent" withParameters:[NSArray arrayWithObjects:identity, password, email, useragent, nil]];
XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager];
[manager spawnConnectionWithXMLRPCRequest: request delegate: self];
[request release];
[waitView setHidden:false];
}
- (void)checkAccountValidation:(NSString*)identity {
[LinphoneLogger log:LinphoneLoggerDebug format:@"XMLRPC check_account_validated %@", identity];
NSURL *URL = [NSURL URLWithString: LINPHONE_WIZARD_URL];
XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithURL: URL];
[request setMethod: @"check_account_validated" withParameters:[NSArray arrayWithObjects:identity, nil]];
XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager];
[manager spawnConnectionWithXMLRPCRequest: request delegate: self];
[request release];
[waitView setHidden:false];
}
- (void)registrationUpdate:(LinphoneRegistrationState)state {
switch (state) {
case LinphoneRegistrationOk: {
[[LinphoneManager instance].settingsStore setBool:false forKey:@"enable_first_login_view_preference"];
[waitView setHidden:true];
[[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]];
break;
}
case LinphoneRegistrationNone:
case LinphoneRegistrationCleared: {
[waitView setHidden:true];
break;
}
case LinphoneRegistrationFailed: {
[waitView setHidden:true];
break;
}
case LinphoneRegistrationProgress: {
[waitView setHidden:false];
break;
}
default:
break;
}
}
@ -175,6 +325,10 @@ static UICompositeViewDescription *compositeDescription = nil;
return YES;
}
- (void)textFieldDidBeginEditing:(UITextField *)textField {
activeTextField = textField;
}
#pragma mark - Action Functions
@ -206,4 +360,214 @@ static UICompositeViewDescription *compositeDescription = nil;
[self changeView:externalAccountView back:FALSE animation:TRUE];
}
- (IBAction)onCheckValidationClick:(id)sender {
NSString *username = [self findTextField:ViewElement_Username].text;
[self checkAccountValidation:[NSString stringWithFormat:@"%@@%@", username, LINPHONE_WIZARD_DOMAIN]];
}
- (IBAction)onSignInExternalClick:(id)sender {
[self.waitView setHidden:false];
NSString *username = [self findTextField:ViewElement_Username].text;
NSString *password = [self findTextField:ViewElement_Password].text;
NSString *domain = [self findTextField:ViewElement_Domain].text;
[self addProxyConfig:username password:password domain:domain];
}
- (IBAction)onSignInClick:(id)sender {
[self.waitView setHidden:false];
NSString *username = [self findTextField:ViewElement_Username].text;
NSString *password = [self findTextField:ViewElement_Password].text;
[self addProxyConfig:username password:password domain:LINPHONE_WIZARD_DOMAIN];
}
- (IBAction)onRegisterClick:(id)sender {
NSString *username = [self findTextField:ViewElement_Username].text;
NSString *password = [self findTextField:ViewElement_Password].text;
NSString *password2 = [self findTextField:ViewElement_Password2].text;
NSString *email = [self findTextField:ViewElement_Email].text;
NSMutableString *errors = [NSMutableString string];
if ([username length] < LINPHONE_WIZARD_MIN_USERNAME_LENGTH) {
[errors appendString:[NSString stringWithFormat:@"The username is too short (minimum %d characters).\n", LINPHONE_WIZARD_MIN_USERNAME_LENGTH]];
}
if ([password length] < LINPHONE_WIZARD_MIN_PASSWORD_LENGTH) {
[errors appendString:[NSString stringWithFormat:@"The password is too short (minimum %d characters).\n", LINPHONE_WIZARD_MIN_PASSWORD_LENGTH]];
}
if (![password2 isEqualToString:password]) {
[errors appendString:@"The passwords are different.\n"];
}
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", @".+@.+\\.[A-Za-z]{2}[A-Za-z]*"];
if(![emailTest evaluateWithObject:email]) {
[errors appendString:@"The email is invalid.\n"];
}
if([errors length]) {
UIAlertView* errorView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Check error",nil)
message:[errors substringWithRange:NSMakeRange(0, [errors length] - 1)]
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil,nil];
[errorView show];
[errorView release];
} else {
[self checkUserExist:username];
}
}
#pragma mark - Event Functions
- (void)registrationUpdateEvent:(NSNotification*)notif {
[self registrationUpdate:[[notif.userInfo objectForKey: @"state"] intValue]];
}
#pragma mark - Keyboard Event Functions
- (void)keyboardWillHide:(NSNotification *)notif {
//CGRect beginFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
//CGRect endFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
UIViewAnimationCurve curve = [[[notif userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue];
NSTimeInterval duration = [[[notif userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
[UIView beginAnimations:@"resize" context:nil];
[UIView setAnimationDuration:duration];
[UIView setAnimationCurve:curve];
[UIView setAnimationBeginsFromCurrentState:TRUE];
// Move view
UIEdgeInsets inset = {0,0,0,0};
[contentView setContentInset:inset];
[contentView setScrollIndicatorInsets:inset];
[contentView setShowsVerticalScrollIndicator:FALSE];
[UIView commitAnimations];
}
- (void)keyboardWillShow:(NSNotification *)notif {
//CGRect beginFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
CGRect endFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
UIViewAnimationCurve curve = [[[notif userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue];
NSTimeInterval duration = [[[notif userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
[UIView beginAnimations:@"resize" context:nil];
[UIView setAnimationDuration:duration];
[UIView setAnimationCurve:curve];
[UIView setAnimationBeginsFromCurrentState:TRUE];
if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
int width = endFrame.size.height;
endFrame.size.height = endFrame.size.width;
endFrame.size.width = width;
}
// Change inset
{
UIEdgeInsets inset = {0,0,0,0};
CGRect frame = [contentView frame];
CGRect rect = [PhoneMainView instance].view.bounds;
CGPoint pos = {frame.size.width, frame.size.height};
CGPoint gPos = [contentView convertPoint:pos toView:[UIApplication sharedApplication].keyWindow.rootViewController.view]; // Bypass IOS bug on landscape mode
inset.bottom = -(rect.size.height - gPos.y - endFrame.size.height);
if(inset.bottom < 0) inset.bottom = 0;
[contentView setContentInset:inset];
[contentView setScrollIndicatorInsets:inset];
CGRect fieldFrame = activeTextField.frame;
fieldFrame.origin.y += fieldFrame.size.height;
[contentView scrollRectToVisible:fieldFrame animated:TRUE];
[contentView setShowsVerticalScrollIndicator:TRUE];
}
[UIView commitAnimations];
}
#pragma mark - XMLRPCConnectionDelegate Functions
- (void)request: (XMLRPCRequest *)request didReceiveResponse: (XMLRPCResponse *)response {
[LinphoneLogger log:LinphoneLoggerDebug format:@"XMLRPC %@: %@", [request method], [response body]];
[waitView setHidden:true];
if ([response isFault]) {
NSString *errorString = [NSString stringWithFormat:@"Can't create account: Communication issue (%@)", [response faultString]];
UIAlertView* errorView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Communication issue",nil)
message:errorString
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil,nil];
[errorView show];
[errorView release];
} else {
if([[request method] isEqualToString:@"check_account"]) {
if([response object] == [NSNumber numberWithInt:1]) {
UIAlertView* errorView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Check issue",nil)
message:@"Username already exists"
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil,nil];
[errorView show];
[errorView release];
} else {
NSString *username = [self findTextField:ViewElement_Username].text;
NSString *password = [self findTextField:ViewElement_Password].text;
NSString *email = [self findTextField:ViewElement_Email].text;
[self createAccount:[NSString stringWithFormat:@"%@@%@", username, LINPHONE_WIZARD_DOMAIN] password:password email:email];
}
} else if([[request method] isEqualToString:@"create_account_with_useragent"]) {
if([response object] == [NSNumber numberWithInt:0]) {
NSString *username = [self findTextField:ViewElement_Username].text;
NSString *password = [self findTextField:ViewElement_Password].text;
[self changeView:validateAccountView back:FALSE animation:TRUE];
[self findTextField:ViewElement_Username].text = username;
[self findTextField:ViewElement_Password].text = password;
} else {
UIAlertView* errorView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Account creation issue",nil)
message:@"Can't create the account. Please try again."
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil,nil];
[errorView show];
[errorView release];
}
} else if([[request method] isEqualToString:@"check_account_validated"]) {
if([response object] == [NSNumber numberWithInt:1]) {
NSString *username = [self findTextField:ViewElement_Username].text;
NSString *password = [self findTextField:ViewElement_Password].text;
[self addProxyConfig:username password:password domain:LINPHONE_WIZARD_DOMAIN];
} else {
UIAlertView* errorView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Account validation issue",nil)
message:@"Your account is not validate yet."
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil,nil];
[errorView show];
[errorView release];
}
}
}
}
- (void)request: (XMLRPCRequest *)request didFailWithError: (NSError *)error {
NSString *errorString = [NSString stringWithFormat:@"Can't create account: Communication issue (%@)", [error localizedDescription]];
UIAlertView* errorView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Communication issue",nil)
message:errorString
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil,nil];
[errorView show];
[errorView release];
[waitView setHidden:true];
}
- (BOOL)request: (XMLRPCRequest *)request canAuthenticateAgainstProtectionSpace: (NSURLProtectionSpace *)protectionSpace {
return FALSE;
}
- (void)request: (XMLRPCRequest *)request didReceiveAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge {
}
- (void)request: (XMLRPCRequest *)request didCancelAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge {
}
@end

File diff suppressed because it is too large Load diff

View file

@ -1123,6 +1123,41 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
D3554ECE15CA79AA00478841 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D3554EC515CA79A900478841 /* XMLRPC.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
remoteInfo = XMLRPC;
};
D3554ED015CA79AA00478841 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D3554EC515CA79A900478841 /* XMLRPC.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 903B0DB612F7574800BD6E09;
remoteInfo = libXMLRPC;
};
D3554ED215CA79AA00478841 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D3554EC515CA79A900478841 /* XMLRPC.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 0799AF030F6721FF00B71B22;
remoteInfo = XMLRPCUnitTests;
};
D3554ED415CA79B900478841 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D3554EC515CA79A900478841 /* XMLRPC.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 903B0DB512F7574800BD6E09;
remoteInfo = libXMLRPC;
};
D3554ED615CA79C000478841 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D3554EC515CA79A900478841 /* XMLRPC.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 903B0DB512F7574800BD6E09;
remoteInfo = libXMLRPC;
};
D3B90E1815C2CB5800F64F8C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D3B90E1115C2CB5700F64F8C /* NinePatch.xcodeproj */;
@ -1608,6 +1643,7 @@
D354981E1587716B000081D8 /* UIStateBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIStateBar.h; sourceTree = "<group>"; };
D354981F1587716B000081D8 /* UIStateBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIStateBar.m; sourceTree = "<group>"; };
D35498201587716B000081D8 /* UIStateBar.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UIStateBar.xib; sourceTree = "<group>"; };
D3554EC515CA79A900478841 /* XMLRPC.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = XMLRPC.xcodeproj; path = Utils/XMLRPC/XMLRPC.xcodeproj; sourceTree = "<group>"; };
D35860D515B549B500513429 /* Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Utils.m; path = Utils/Utils.m; sourceTree = "<group>"; };
D35E757515931E5D0066B1C1 /* switch_camera_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = switch_camera_default.png; path = Resources/switch_camera_default.png; sourceTree = "<group>"; };
D35E757615931E5D0066B1C1 /* switch_camera_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = switch_camera_over.png; path = Resources/switch_camera_over.png; sourceTree = "<group>"; };
@ -3046,6 +3082,7 @@
D3F9A9EB15AF27620045320F /* UACellBackgroundView */,
C9B3A6FD15B485DB006F52EE /* Utils.h */,
D35860D515B549B500513429 /* Utils.m */,
D3554EC515CA79A900478841 /* XMLRPC.xcodeproj */,
);
name = Utils;
sourceTree = "<group>";
@ -3059,6 +3096,16 @@
name = Model;
sourceTree = "<group>";
};
D3554EC615CA79A900478841 /* Products */ = {
isa = PBXGroup;
children = (
D3554ECF15CA79AA00478841 /* XMLRPC.framework */,
D3554ED115CA79AA00478841 /* libXMLRPC.a */,
D3554ED315CA79AA00478841 /* XMLRPCUnitTests.octest */,
);
name = Products;
sourceTree = "<group>";
};
D3807FB615C28940005BE9BC /* DCRoundSwitch */ = {
isa = PBXGroup;
children = (
@ -3196,6 +3243,7 @@
buildRules = (
);
dependencies = (
D3554ED515CA79B900478841 /* PBXTargetDependency */,
D3B90E1B15C2CBC800F64F8C /* PBXTargetDependency */,
);
name = linphone;
@ -3215,6 +3263,7 @@
buildRules = (
);
dependencies = (
D3554ED715CA79C000478841 /* PBXTargetDependency */,
D3B90E1D15C2CBCD00F64F8C /* PBXTargetDependency */,
);
name = "linphone-no-gpl-thirdparties";
@ -3248,6 +3297,10 @@
ProductGroup = D3B90E1215C2CB5700F64F8C /* Products */;
ProjectRef = D3B90E1115C2CB5700F64F8C /* NinePatch.xcodeproj */;
},
{
ProductGroup = D3554EC615CA79A900478841 /* Products */;
ProjectRef = D3554EC515CA79A900478841 /* XMLRPC.xcodeproj */;
},
);
projectRoot = "";
targets = (
@ -3258,6 +3311,27 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
D3554ECF15CA79AA00478841 /* XMLRPC.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = XMLRPC.framework;
remoteRef = D3554ECE15CA79AA00478841 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
D3554ED115CA79AA00478841 /* libXMLRPC.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libXMLRPC.a;
remoteRef = D3554ED015CA79AA00478841 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
D3554ED315CA79AA00478841 /* XMLRPCUnitTests.octest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = XMLRPCUnitTests.octest;
remoteRef = D3554ED215CA79AA00478841 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
D3B90E1915C2CB5800F64F8C /* libNinePatch.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -4330,6 +4404,16 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
D3554ED515CA79B900478841 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = libXMLRPC;
targetProxy = D3554ED415CA79B900478841 /* PBXContainerItemProxy */;
};
D3554ED715CA79C000478841 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = libXMLRPC;
targetProxy = D3554ED615CA79C000478841 /* PBXContainerItemProxy */;
};
D3B90E1B15C2CBC800F64F8C /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = NinePatch;
@ -4386,6 +4470,7 @@
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -4398,6 +4483,8 @@
OTHER_LDFLAGS = (
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libNinePatch.a",
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libXMLRPC.a",
"-Objc",
);
PRODUCT_NAME = linphone;
@ -4458,6 +4545,7 @@
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -4470,6 +4558,8 @@
OTHER_LDFLAGS = (
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libNinePatch.a",
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libXMLRPC.a",
"-Objc",
);
PRODUCT_NAME = linphone;
@ -4511,6 +4601,7 @@
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -4523,6 +4614,8 @@
OTHER_LDFLAGS = (
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libNinePatch.a",
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libXMLRPC.a",
"-Objc",
);
PRODUCT_NAME = "linphone-no-gpl-thirdparties";
@ -4564,6 +4657,7 @@
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -4576,6 +4670,8 @@
OTHER_LDFLAGS = (
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libNinePatch.a",
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libXMLRPC.a",
"-Objc",
);
PRODUCT_NAME = "linphone-no-gpl-thirdparties";
@ -4618,6 +4714,7 @@
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -4630,6 +4727,8 @@
OTHER_LDFLAGS = (
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libNinePatch.a",
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libXMLRPC.a",
"-Objc",
);
PRODUCT_NAME = "linphone-no-gpl-thirdparties";
@ -4672,6 +4771,7 @@
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -4684,6 +4784,8 @@
OTHER_LDFLAGS = (
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libNinePatch.a",
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libXMLRPC.a",
"-Objc",
);
PRODUCT_NAME = "linphone-no-gpl-thirdparties";
@ -4744,6 +4846,7 @@
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -4756,6 +4859,8 @@
OTHER_LDFLAGS = (
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libNinePatch.a",
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libXMLRPC.a",
"-Objc",
);
PRODUCT_NAME = linphone;
@ -4817,6 +4922,7 @@
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -4829,6 +4935,8 @@
OTHER_LDFLAGS = (
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libNinePatch.a",
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libXMLRPC.a",
"-Objc",
);
PRODUCT_NAME = linphone;