Latest 0.2.0
Homepage https://github.com/csknns/RgWsPublicClient
License MIT
Platforms ios 8.0, requires ARC
Authors

CI Status
Version
License
Platform
codecov

RgWsPublicClient is an iOS client for accessing the new web service provided by GSIS for physical persons and legal entities. The new webservice provides two methods, one for retrieving the service’s version information and the second for retrieving information regarding a requested VAT(A.F.M.). The latter requires authentication using the UsernameToken Extensions of WSS(see Web Services Security UsernameToken Profile). The project has a simple block-based client that provides two methods (corresponding to the two web service operations) with error checking and handling for all layers (transport, application), and an example Xcode project that uses the client.

Usage

To run the example project, just run:

pod try RgWsPublicClient

or clone the repo, and run:

pod install

from the Example directory first. Then include the client #import <RgWsPublicClient/RgWsPublicClient.h> in your source file.

Apple transport security

Starting in iOS 9.0, a new security feature called ATS(Apple transport security) requires the application to make HTTPS connection that follow specific minimum security standards, or declare in your plist file specific exceptions. Unfortunately the server of the service endpoint supports TLSv1, which is not consider strong and the calls fail with an error like Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made.". If your application links iOS 9.0 SDK or later then you must add to your plist file the following:

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>www1.gsis.gr</key>
            <dict>
                <key>NSExceptionRequiresForwardSecrecy</key>
                <false/>
                <key>NSIncludesSubdomains</key>
                <false/>
                <key>NSExceptionMinimumTLSVersion</key>
                <string>TLSv1.0</string>
            </dict>
        </dict>
    </dict>

Example

  • Initialise the client:
    [RgWsPublicClient clientWithUsername:@"<username>" password:@"<password>"];

Then grab the shared instance anywhere and execute the method you need

  • Calling rgWsPublicAfmMethod (no valid username/password required):
    [[RgWsPublicClient sharedInstance] rgWsPublicVersionInfoSuccess:^(NSString *result) {
        NSLog(@"result version string: %@", result);
    } failure:^(NSError *error) {
        NSLog(@"error: %@", [error localizedDescription]);
    }];
  • Calling rgWsPublicVersionInfo (must have valid username/password):
    [[RgWsPublicClient sharedInstance]
     rgWsPublicAfmMethodCallForAfm:@"123456789"
     Success:^(RgWsPublic_RgWsPublicBasicRtUser *rgWsPublicBasicRt_out,
               RgWsPublic_RgWsPublicFirmActRtUserArray *arrayOfRgWsPublicFirmActRt_out,
               NSNumber *pCallSeqId_out,
               RgWsPublic_GenWsErrorRtUser *rgWsPublic_GenWsErrorRtUser) {

         NSLog(@"onomasia    : %@", rgWsPublicBasicRt_out.onomasia);
         NSLog(@"doyDescr    : %@", rgWsPublicBasicRt_out.doyDescr);
         NSLog(@"commerTitle : %@", rgWsPublicBasicRt_out.commerTitle);

         for (RgWsPublic_RgWsPublicFirmActRtUser *user in arrayOfRgWsPublicFirmActRt_out.RgWsPublicFirmActRtUser) {
             NSLog(@"firmActDescr: %@ %@", user.firmActKindDescr, user.firmActDescr);
         }
     } failure:^(NSError *error) {
         NSLog(@"error: %@", [error localizedDescription]);
     }];

Requirements

Registering for the service

In order use the method that requires authentication, you must register for the service and generate a username and a password following the details found here: http://www.gsis.gr/gsis/info/gsis_site/PublicIssue/wnsp/wnsp_pages/wnsp.html.

Installation

Using CocoaPods (Recommended)

RgWsPublicClient is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RgWsPublicClient"

then import the client #import <RgWsPublicClient/RgWsPublicClient.h> in your source file.

Manually

  • Drag the files from RgWsPublicClient/Pod/Classes to you project
  • import the RgWsPublicClient.h #import <RgWsPublicClient/RgWsPublicClient.h>
  • add the -fno-objc-arc flag for all files except RgWsPublicClient.m
  • add "/usr/include/libxml2" in Header Search Paths in the Build setting of the project

Author

Christos Koninis, [email protected]

License

RgWsPublicClient is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "RgWsPublicClient",
    "version": "0.2.0",
    "summary": "A client for retrieving legal entities details from GSIS",
    "description": "A client that provides access to the web service offered by Greece's Ministry of Finance General Secretariat of Information Systems for retrieving legal entities details",
    "homepage": "https://github.com/csknns/RgWsPublicClient",
    "license": "MIT",
    "authors": {
        "Christos Koninis": "[email protected]"
    },
    "source": {
        "git": "https://github.com/csknns/RgWsPublicClient.git",
        "tag": "v0.2.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": [
        "Pod/Classes/RgWsPublicClient.{m,h}"
    ],
    "xcconfig": {
        "HEADER_SEARCH_PATHS": ""/usr/include/libxml2""
    },
    "libraries": "xml2",
    "user_target_xcconfig": {
        "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES": "YES"
    },
    "subspecs": [
        {
            "name": "no-arc",
            "source_files": [
                "Pod/Classes/NSDate+ISO8601Parsing.{m,h}",
                "Pod/Classes/NSDate+ISO8601Unparsing.{m,h}",
                "Pod/Classes/RgWsPublic.{m,h}",
                "Pod/Classes/USAdditions.{m,h}",
                "Pod/Classes/USGlobals.{m,h}",
                "Pod/Classes/xsd.{m,h}"
            ],
            "requires_arc": false
        }
    ]
}

Pin It on Pinterest

Share This