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

[Docs] - Fixes #6 - Check All Headers In Documentation #11

Merged
merged 1 commit into from
Apr 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions doc/book/zend.xmlrpc.client.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To call a remote method with the *XML-RPC* client, instantiate it and use the `c
method. The code sample below uses a demonstration *XML-RPC* server on the Zend Framework website.
You can use it for testing or exploring the `Zend\XmlRpc` components.

**XML-RPC Method Call**
### XML-RPC Method Call

```php
$client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc');
Expand All @@ -34,7 +34,7 @@ The first parameter of the `call()` method receives the name of the remote metho
remote method requires any parameters, these can be sent by supplying a second, optional parameter
to `call()` with an `Array` of values to pass to the remote method:

**XML-RPC Method Call with Parameters**
### XML-RPC Method Call with Parameters

```php
$client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc');
Expand Down Expand Up @@ -117,7 +117,7 @@ To instantiate a server proxy, call the `getProxy()` instance method of `Zend\Xm
will return an instance of `Zend\XmlRpc\Client\ServerProxy`. Any method call on the server proxy
object will be forwarded to the remote, and parameters may be passed like any other *PHP* method.

**Proxy the Default Namespace**
### Proxy the Default Namespace

```php
$client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc');
Expand All @@ -131,7 +131,7 @@ The `getProxy()` method receives an optional argument specifying which namespace
server to proxy. If it does not receive a namespace, the default namespace will be proxied. In the
next example, the 'test' namespace will be proxied:

**Proxy Any Namespace**
### Proxy Any Namespace

```php
$client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc');
Expand All @@ -156,7 +156,7 @@ independently.
If any *HTTP* error occurs, such as the remote *HTTP* server returns a **404 Not Found**, a
`Zend\XmlRpc\Client\Exception\HttpException` will be thrown.

**Handling HTTP Errors**
#### Handling HTTP Errors

```php
$client = new Zend\XmlRpc\Client('http://foo/404');
Expand Down Expand Up @@ -186,7 +186,7 @@ When the `call()` method or the server proxy object is used, an *XML-RPC* fault
`Zend\XmlRpc\Client\Exception\FaultException` being thrown. The code and message of the exception
will map directly to their respective values in the original *XML-RPC* fault response.

**Handling XML-RPC Faults**
#### Handling XML-RPC Faults

```php
$client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc');
Expand Down Expand Up @@ -246,7 +246,7 @@ object (`Zend\XmlRpc\Response`).

The `doRequest()` method is also available for use directly:

**Processing Request to Response**
### Processing Request to Response

```php
$client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc');
Expand Down
22 changes: 11 additions & 11 deletions doc/book/zend.xmlrpc.server.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ instance, and then attempts to create a new cache file with the server definitio
Below are several usage examples, showing the full spectrum of options available to developers.
Usage examples will each build on the previous example provided.

**Basic Usage**
### Basic Usage

The example below attaches a function as a dispatchable *XML-RPC* method and handles incoming calls.

Expand All @@ -249,7 +249,7 @@ $server->addFunction('md5Value');
echo $server->handle();
```

**Attaching a class**
### Attaching a class

The example below illustrates attaching a class' public methods as dispatchable *XML-RPC* methods.

Expand All @@ -261,7 +261,7 @@ $server->setClass('Services\Comb');
echo $server->handle();
```

**Attaching a class with arguments**
### Attaching a class with arguments

The following example illustrates how to attach a class' public methods and passing arguments to its
methods. This can be used to specify certain defaults when registering service classes.
Expand Down Expand Up @@ -297,7 +297,7 @@ The arguments passed at `setClass()` at server construction time are injected in
`pricing.calculate()` on remote invokation. In the example above, only the argument `$purchaseId` is
expected from the client.

**Passing arguments only to constructor**
### Passing arguments only to constructor

`Zend\XmlRpc\Server` allows to restrict argument passing to constructors only. This can be used for
constructor dependency injection. To limit injection to constructors, call
Expand Down Expand Up @@ -339,13 +339,13 @@ $server->setClass('Services\PricingService2',
new PurchaseRepository());
```

**Attaching a class instance**
### Attaching a class instance

`setClass()` allows to register a previously instantiated class at the server. Just pass an instance
instead of the class name. Obviously passing arguments to the constructor is not possible with
pre-instantiated classes.

**Attaching several classes using namespaces**
### Attaching several classes using namespaces

The example below illustrates attaching several classes, each with their own namespace.

Expand All @@ -361,7 +361,7 @@ $server->setClass('Services\Pick', 'pick'); // methods called as pick.*
echo $server->handle();
```

**Specifying exceptions to use as valid fault responses**
### Specifying exceptions to use as valid fault responses

The example below allows any `Services\Exception`-derived class to report its code and message in
the fault response.
Expand All @@ -382,7 +382,7 @@ $server->setClass('Services\Pick', 'pick'); // methods called as pick.*
echo $server->handle();
```

**Utilizing custom request and response objects**
### Utilizing custom request and response objects

Some use cases require to utilize a custom request object. For example, *XML/RPC* is not bound to
*HTTP* as a transfer protocol. It is possible to use other transfer protocols like *SSH* or telnet
Expand Down Expand Up @@ -413,7 +413,7 @@ $request = new Services\Request();
echo $server->handle($request);
```

**Specifying a custom response class**
### Specifying a custom response class

The example below illustrates specifying a custom response class for the returned response.

Expand Down Expand Up @@ -444,7 +444,7 @@ echo $server->handle($request);

## Performance optimization

**Cache server definitions between requests**
### Cache server definitions between requests

The example below illustrates caching server definitions between requests.

Expand Down Expand Up @@ -486,7 +486,7 @@ echo $server->handle($request);
> ## Note
The server cache file should be located outside the document root.

**Optimizing XML generation**
### Optimizing XML generation

`Zend\XmlRpc\Server` uses `DOMDocument` of *PHP* extension **ext/dom** to generate it's *XML*
output. While **ext/dom** is available on a lot of hosts it is not exactly the fastest. Benchmarks
Expand Down