URL Schemes

From RemObjects Wiki

Jump to:navigation, search

This is a RemObjects SDK Architecture topic
Feel free to add your notes to this topic below.



URL Schema Definition

URL schema is the unified way to encode all parameters required to establish connection to the server into the string as specified in RFCs 1808, 1738, and 2732. These parameters include protocol type, host name or IP address (both IPv4 and IPv6 are supported), port and message type identifier (dispatcher). In the generalized form such URL can be written as:

protocol://host:port/message

The URL parts meaning and possible values are:

Value
Channel
http Plain HTTP Channel
https Plain HTTP Channel, SSL-enabled
superhttp Super HTTP Channel
superhttps Super HTTP Channel, SSL-enabled
tcp Plain TCP channel
supertcp Super TCP channel
Value
Message
bin RO binary message
soap SOAP Message
json JSON Message

Usage

URL schemas are currently supported by RO/Xcode only. Other platforms support is work in progress.

Delphi
(TODO: coming soon)

.NET
(TODO: coming soon)

Xcode

According to the Foundation design principles URL values are stored in NSURL objects. All class members referring URLs as strings are deprecated since Feb11 release. So the first thing to do here is to create a NSURL instance containing the URL we are going to use, e.g.:

NSURL *targetUrl = [NSURL urlWithString:@"superhttp://192.168.1.9:8099/bin"]

All three fundamental entities responsible for communication have class methods accepting a NSURL instance as a parameter and returning an instance according to the URL passed.
To create a client channel call:

ROClientChannel *channel = [ROClientChannel channelWithTargetURL:targetURL];

To create a message call:

ROMessage *message = [ROMessage messageMatchingTargetURL:targetURL];

Or just create a service proxy, corresponding channel and message instance will be created implicitly (assuming we have ConcreteProxy class defined for the service proxy):

ConcreteProxy *proxy = [[ConcreteProxy alloc] initWithURL:targetUrl];

Here are more rules of URL schemas usage:

  1. channelWithTargetURL: and messageMatchingTargetURL: class methods also work for concrete channel and message classes but they always create an instance of own class disregarding the URL.
  2. Attempting to call channelWithTargetURL: for unsupported protocol type will cause an exception to be thrown.
  3. Attempting to call messageMatchingTargetURL: for unsupported message identifier will cause ROBinMessage to be created.

Note for iOS users
SOAP messaging support (ROSoapMessage instances creation) is not possible under iOS unless the libxml2 is linked. Please set up necessary linker options in your project if you plan to support SOAP messaging. Read more.

See Also


Ro-48.png

Product: RemObjects SDK
Available Editions: RemObjects SDK for .NET, Delphi, Xcode, Java and JavaScript

GlossaryArchitectureArticlesFeaturesLibrarySamples

Navigation
products
platforms
special
Toolbox