Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Time to get ready for the new year, plus some overdue housekeeping.
Browse files Browse the repository at this point in the history
  • Loading branch information
eczarny committed Dec 16, 2011
1 parent 5bd8ed0 commit aa3d19f
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 604 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Expand Up @@ -2,7 +2,7 @@

## The Cocoa XML-RPC Framework is distributed under the MIT License:

Copyright (c) 2011 Eric Czarny <eczarny@gmail.com>
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
Expand Down
70 changes: 22 additions & 48 deletions README.md
@@ -1,23 +1,16 @@
# The Cocoa XML-RPC Framework

The Cocoa XML-RPC Framework is a simple, and lightweight, XML-RPC client
framework written in Objective-C.
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.
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.
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:
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

Expand All @@ -30,84 +23,65 @@ 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.
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:
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:
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:
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.
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:
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.
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.
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 NSStringAdditions and NSDataAdditions have
been adapted from code provided by Dave Winer.
The Base64 encoder/decoder found in NSStringAdditions and NSDataAdditions have been adapted from code provided by Dave Winer.

The idea for this framework came from examples provided by Brent Simmons, the
creator of NetNewsWire.
The idea for this framework came from examples provided by Brent Simmons, the creator of NetNewsWire.

# License

Copyright (c) 2011 Eric Czarny.
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.
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>.
22 changes: 0 additions & 22 deletions Tools/Test Client/TestClient.pch
@@ -1,25 +1,3 @@
//
// Copyright (c) 2011 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.
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#import <XMLRPC/XMLRPC.h>
Expand Down
22 changes: 0 additions & 22 deletions Tools/Test Client/TestClientApplicationController.h
@@ -1,25 +1,3 @@
//
// Copyright (c) 2011 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.
//

#import <Cocoa/Cocoa.h>

@interface TestClientApplicationController : NSObject {
Expand Down
22 changes: 0 additions & 22 deletions Tools/Test Client/TestClientApplicationController.m
@@ -1,25 +1,3 @@
//
// Copyright (c) 2011 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.
//

#import "TestClientApplicationController.h"
#import "TestClientMainWindowController.h"
#import "TestClientXMLParserWindowController.h"
Expand Down
22 changes: 0 additions & 22 deletions Tools/Test Client/TestClientMainWindowController.h
@@ -1,25 +1,3 @@
//
// Copyright (c) 2011 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.
//

#import <Cocoa/Cocoa.h>

@interface TestClientMainWindowController : NSWindowController<XMLRPCConnectionDelegate> {
Expand Down
22 changes: 0 additions & 22 deletions Tools/Test Client/TestClientMainWindowController.m
@@ -1,25 +1,3 @@
//
// Copyright (c) 2011 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.
//

#import "TestClientMainWindowController.h"

@implementation TestClientMainWindowController
Expand Down
22 changes: 0 additions & 22 deletions Tools/Test Client/TestClientXMLParserWindowController.h
@@ -1,25 +1,3 @@
//
// Copyright (c) 2011 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.
//

#import <Cocoa/Cocoa.h>

@interface TestClientXMLParserWindowController : NSWindowController {
Expand Down
22 changes: 0 additions & 22 deletions Tools/Test Client/TestClientXMLParserWindowController.m
@@ -1,25 +1,3 @@
//
// Copyright (c) 2011 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.
//

#import "TestClientXMLParserWindowController.h"
#import "XMLRPCEventBasedParser.h"

Expand Down
22 changes: 0 additions & 22 deletions Tools/Test Client/main.m
@@ -1,25 +1,3 @@
//
// Copyright (c) 2011 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.
//

#import <Cocoa/Cocoa.h>

int main(int argc, char *argv[]) {
Expand Down

0 comments on commit aa3d19f

Please sign in to comment.