XMLRPC-iOS Project for iOS

I'm going crazy, I can’t understand.

I downloaded and trying to create XMLRPC for iOS. I am triend with https://github.com/eczarny/xmlrpc and https://bitbucket.org/kdbdallas/xmlrpc-ios/wiki/Home First, original, does not have an iOS purpose. the second one should have, but even that one doesn't seem to work.

I am creating an XMLRPC-iOS lib using Xcode as follows:

  • download, unzip, open in xcode
  • Go to Product> Archive
  • In organized, I select "Share" in the latest version
  • I save it in my project folder. Include it in the project.

When I create my own project, I get:

ld: warning: ignoring file / Users / paulp / Documents / ios / iPhone / ios -account / Account / external / XMLRPC / libXMLRPC_iOS.a, the file was created for an archive that is not related to architecture (i386) Undefined characters for architecture i386 :
"_OBJC_CLASS _ $ _ XMLRPCRequest" referenced by: objc-class-ref in MyAPI.o
"_OBJC_CLASS _ $ _ XMLRPCConnectionManager" referenced by: objc-class-ref in MyAPI.o ld: character (s) not found for i386 architecture clang: error: linker command failed with exit code 1 (use -v, to see the call)

How is this possible? XMLRPC-iOS settings are set to:

  • SDKROOT = iphoneos5.0
  • ARCHS = $ (ARCHS_STANDARD_32_BIT) = armv7
  • IPHONEOS_DEPLOYMENT_TARGET = 5.0
  • VALID_ARCHS = armv6 armv7k armv7f armv7
  • OTHER_CODE_SIGN_FLAGS = armv7k armv7f armv6 armv7
  • GCC_VERSION = com.apple.compilers.llvmgcc42

Can someone explain to me how I can create and use the XMLRPC-iOS library in my own application? Thanks!

+6
source share
3 answers

it worked for me; that's exactly what i did.

  • Create a new project (called RpcTest)
  • Download the forked project from bitbucket, extract the zip in my RpcTest directory, so my directory looks like this:

directory structure

  • Drag and drop XMLRPC-iOS.xcodeproj into my Xcode project (in the Frameworks group, but that doesn't matter)
  • Now, in the build settings. Add kdbdallas-xmlrpc-ios-f28a13cc16ae in the "User Header Search Paths" section (uncheck "Recursive") in your project "Build Settings"; now create your project (cmd + B)
  • go to the Phase Assembly tab, expand Dependent Dependencies, add the XMLRPC-IOS project, expand the "Binary Links with Libraries" link, add libXMLRPC_iOS.a. enter image description here

Now you can include any xmlrpc header and use lib.

Hope this helps.

EDIT Download via Dropbox. recommended: incomplete implementation, just a demonstration of xmlrpc !;)

+10
source

I used the first one you mention https://github.com/eczarny/xmlrpc with success on the iPhone project.
Must work. (was some time ago)

[EDIT]
A few more details: I imported XMLRPCResponse and XMLRPCEventBasedParser (+ all related classes to make them work from the project).

Then here is the code to parse the response (I did the request manually):

NSURL* url = [NSURL URLWithString:@"http://www.xxxxxxxxx.fr/xmlrpc.php"]; NSMutableURLRequest* urlRequest = [NSMutableURLRequest requestWithURL:url]; [urlRequest setHTTPMethod:@"POST"]; [urlRequest addValue:@"text/xml" forHTTPHeaderField:@"Content-Type"]; NSString* param = [NSString stringWithFormat: @"<param><value><double>%f</double></value></param><param><value><double>%f</double></value></param><param><value><double>%.0f</double></value></param><param><value><int>1</int></value></param>", request.coordinate.latitude, request.coordinate.longitude, request.radius/1000.0]; NSString* xmlrpcReq = [NSString stringWithFormat:@"<?xml version=\"1.0\"?><methodCall><methodName>geoSearch</methodName><params>%@</params></methodCall>", param]; [urlRequest setHTTPBody:[xmlrpcReq dataUsingEncoding:NSUTF8StringEncoding]]; NSURLResponse* response; NSError* error; NSData* content = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&response error:&error]; XMLRPCResponse* rpcResponse = [[XMLRPCResponse alloc] initWithData:content]; if ([rpcResponse faultCode]==0) { NSArray* result = (NSArray*)[rpcResponse object]; 

Cheers Lionel.

0
source

Can I find out what goal you are setting? for example, the three available targets, if you are using iOS, select libXMLRPC, then build, then select the libXMLRPC.a files from the assembly, and then attach it to our project. then it will work.

0
source

Source: https://habr.com/ru/post/896993/


All Articles