Skip to content

Commit

Permalink
docs: change lb3 to lb4
Browse files Browse the repository at this point in the history
  • Loading branch information
bschrammIBM authored and biniam committed Apr 19, 2019
1 parent a8932e1 commit bf81c47
Show file tree
Hide file tree
Showing 43 changed files with 258 additions and 146 deletions.
10 changes: 6 additions & 4 deletions docs/site/Cassandra-connector.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: "Cassandra connector"
title: 'Cassandra connector'
lang: en
layout: readme
source: loopback-connector-cassandra
keywords: LoopBack, connector
tags: readme
sidebar: lb3_sidebar
permalink: /doc/en/lb3/Cassandra-connector.html
summary: The Cassandra connector enables LoopBack applications to connect to Cassandra data sources.
sidebar: lb4_sidebar
permalink: /doc/en/lb4/Cassandra-connector.html
summary:
The Cassandra connector enables LoopBack applications to connect to Cassandra
data sources.
---
14 changes: 9 additions & 5 deletions docs/site/Cloudant-connector.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
---
title: "Cloudant connector"
title: 'Cloudant connector'
lang: en
layout: readme
source: loopback-connector-cloudant
keywords: LoopBack, connector
tags: [connectors, readme]
sidebar: lb3_sidebar
permalink: /doc/en/lb3/Cloudant-connector.html
summary: The Cloudant connector enables LoopBack applications to connect to Cloudant data sources.
sidebar: lb4_sidebar
permalink: /doc/en/lb4/Cloudant-connector.html
summary:
The Cloudant connector enables LoopBack applications to connect to Cloudant
data sources.
---

{% include see-also.html content="

- [Getting Started with LoopBack and IBM Cloudant](https://developer.ibm.com/bluemix/2015/09/10/getting-started-node-js-loopback-framework-ibm-cloudant/)
" %}
" %}
19 changes: 12 additions & 7 deletions docs/site/Community-connectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@ lang: en
layout: page
keywords: LoopBack
tags:
sidebar: lb3_sidebar
permalink: /doc/en/lb3/Community-connectors.html
sidebar: lb4_sidebar
permalink: /doc/en/lb4/Community-connectors.html
summary:
---

In addition to the connectors that StrongLoop provides and maintains, there are a number of connectors created by the open-source community.
In addition to the connectors that StrongLoop provides and maintains, there are
a number of connectors created by the open-source community.

{% include warning.html content="IBM and StrongLoop do not support the connectors listed here; they are maintained by the LoopBack community and are listed here for convenience.
{% include warning.html content="IBM and StrongLoop do not support the
connectors listed here; they are maintained by the LoopBack community and are
listed here for convenience.

Please contact IBM/StrongLoop to request support for one of these connectors or to request an additional connector.
" %}
Please contact IBM/StrongLoop to request support for one of these connectors or
to request an additional connector. " %}

The following table lists some of the community connectors. See [npmjs.org](https://www.npmjs.org/search?q=loopback-connector) for a complete list.
The following table lists some of the community connectors. See
[npmjs.org](https://www.npmjs.org/search?q=loopback-connector) for a complete
list.

{% include note.html content="See also [https://github.com/pasindud/awesome-loopback](https://github.com/pasindud/awesome-loopback) for an extensive list of LoopBack community resources.
" %}
Expand Down
8 changes: 4 additions & 4 deletions docs/site/Connecting-to-Microsoft-SQL-Server.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: "Microsoft SQL Server connector tutorial"
title: 'Microsoft SQL Server connector tutorial'
lang: en
layout: readme
source: loopback-example-database
branch: mssql
keywords: LoopBack
tags: example_app
sidebar: lb3_sidebar
permalink: /doc/en/lb3/Connecting-to-Microsoft-SQL-Server.html
summary: A brief tutorial on using the LoopBack MS SQL connector.
sidebar: lb4_sidebar
permalink: /doc/en/lb4/Connecting-to-Microsoft-SQL-Server.html
summary: A brief tutorial on using the LoopBack MS SQL connector.
---
6 changes: 3 additions & 3 deletions docs/site/Connecting-to-MongoDB.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: "MongoDB Connector Tutorial"
title: 'MongoDB Connector Tutorial'
lang: en
layout: readme
source: loopback-example-database
keywords: LoopBack
tags: example_app
sidebar: lb3_sidebar
permalink: /doc/en/lb3/Connecting-to-MongoDB.html
sidebar: lb4_sidebar
permalink: /doc/en/lb4/Connecting-to-MongoDB.html
summary: A brief tutorial on using the LoopBack MongoDB connector.
---
8 changes: 4 additions & 4 deletions docs/site/Connecting-to-MySQL.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: "MySQL Connector Tutorial"
title: 'MySQL Connector Tutorial'
lang: en
layout: readme
source: loopback-example-database
branch: mysql
keywords: LoopBack
tags: example_app
sidebar: lb3_sidebar
permalink: /doc/en/lb3/Connecting-to-MySQL.html
summary: A brief tutorial on using the LoopBack MySQL connector.
sidebar: lb4_sidebar
permalink: /doc/en/lb4/Connecting-to-MySQL.html
summary: A brief tutorial on using the LoopBack MySQL connector.
---
6 changes: 3 additions & 3 deletions docs/site/Connecting-to-Oracle.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: "Oracle Connector Tutorial"
title: 'Oracle Connector Tutorial'
lang: en
layout: navgroup
navgroup: oracle
source: loopback-example-database
branch: oracle
keywords: LoopBack
tags: example_app
sidebar: lb3_sidebar
permalink: /doc/en/lb3/Connecting-to-Oracle.html
sidebar: lb4_sidebar
permalink: /doc/en/lb4/Connecting-to-Oracle.html
summary: A brief tutorial on using the LoopBack Oracle connector.
---
8 changes: 4 additions & 4 deletions docs/site/Connecting-to-PostgreSQL.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: "PostgreSQL connector tutorial"
title: 'PostgreSQL connector tutorial'
lang: en
layout: readme
source: loopback-example-database
branch: postgresql
keywords: LoopBack
tags: example_app
sidebar: lb3_sidebar
permalink: /doc/en/lb3/Connecting-to-PostgreSQL.html
summary: A brief tutorial on using the LoopBack PostgreSQL connector.
sidebar: lb4_sidebar
permalink: /doc/en/lb4/Connecting-to-PostgreSQL.html
summary: A brief tutorial on using the LoopBack PostgreSQL connector.
---
116 changes: 73 additions & 43 deletions docs/site/Connecting-to-SOAP.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
---
title: "Connecting to SOAP web services"
title: 'Connecting to SOAP web services'
toc: false
layout: page
keywords: LoopBack
tags:
sidebar: lb3_sidebar
permalink: /doc/en/lb3/Connecting-to-SOAP.html
summary: The LoopBack CLI enables you to easily create models based on a SOAP web service.
? tags
sidebar: lb4_sidebar
permalink: /doc/en/lb4/Connecting-to-SOAP.html
summary:
The LoopBack CLI enables you to easily create models based on a SOAP web
service.
---
{% include navgroups/soap.md %}
{% include toc.html %}

{% include navgroups/soap.md %} {% include toc.html %}

## Overview

Web services enable applications to communicate with each other independent
of platform and language. A web service is a software interface that describes a collection
of operations that can be invoked over the network through standardized XML messaging using
Simple Object Access Protocol ([SOAP](https://www.w3.org/TR/soap/)). Web Services Description Language ([WSDL](https://www.w3.org/TR/wsdl20/)) is an
XML document that describes web service endpoints, bindings, operations and schema.
Web services enable applications to communicate with each other independent of
platform and language. A web service is a software interface that describes a
collection of operations that can be invoked over the network through
standardized XML messaging using Simple Object Access Protocol
([SOAP](https://www.w3.org/TR/soap/)). Web Services Description Language
([WSDL](https://www.w3.org/TR/wsdl20/)) is an XML document that describes web
service endpoints, bindings, operations and schema.

{% include image.html file="loopback-soap-integration.png" alt="LoopBack SOAP integration" %}

Web services are still important in many enterprises, and the way to access them is via SOAP.
SOAP is fairly heavy-weight, and working with XML-based SOAP
payloads in Node.js is not easy. It’s much easier to use JSON and to wrap or mediate a SOAP
service and expose it as a REST API.
Web services are still important in many enterprises, and the way to access them
is via SOAP. SOAP is fairly heavy-weight, and working with XML-based SOAP
payloads in Node.js is not easy. It’s much easier to use JSON and to wrap or
mediate a SOAP service and expose it as a REST API.

To support the "API design first" approach, the [SOAP generator](SOAP-generator.html) creates LoopBack models and REST APIs for WSDL/SOAP operations to enable a LoopBack app to invoke a web service without the need to write code.
To support the "API design first" approach, the
[SOAP generator](SOAP-generator.html) creates LoopBack models and REST APIs for
WSDL/SOAP operations to enable a LoopBack app to invoke a web service without
the need to write code.

## Example

Expand All @@ -50,9 +57,11 @@ When prompted, select either LoopBack 3.x or 2.x and `empty-server` application.
### Generate SOAP data source

Next, create a data source for the SOAP web service.
This example will use the publicly-available [Periodic table web service](http://www.webservicex.net/New/Home/ServiceDetail/19).
This example will use the publicly-available
[Periodic table web service](http://www.webservicex.net/New/Home/ServiceDetail/19).

Create a new data source using the [data source generator](Data-source-gnerator.html):
Create a new data source using the
[data source generator](Data-source-gnerator.html):

```
$ cd soap-demo
Expand All @@ -62,25 +71,31 @@ $ lb datasource
When prompted, respond as follows:

- Enter the data-source name, for example "periodicSoapDS".
- Select "Soap Webservices (supported by StrongLoop)" from the list of connectors.
- Enter http://www.webservicex.net/periodictable.asmx for "URL to the SOAP web service endpoint" prompt.
- Enter http://www.webservicex.net/periodictable.asmx?WSDL for "HTTP URL or local fie system path to WSDL file" prompt.
- Select "Soap Webservices (supported by StrongLoop)" from the list of
connectors.
- Enter http://www.webservicex.net/periodictable.asmx for "URL to the SOAP web
service endpoint" prompt.
- Enter http://www.webservicex.net/periodictable.asmx?WSDL for "HTTP URL or
local fie system path to WSDL file" prompt.
- Enter "y" to Expose operations as REST APIs.
- Leave blank to "Maps WSDL binding operations to Node.js methods".
- Select "y" to "Install "loopback-connector-soap" prompt. This runs `npm install -s loopback-connector-soap`.
- Select "y" to "Install "loopback-connector-soap" prompt. This runs
`npm install -s loopback-connector-soap`.

For more information on SOAP datasource properties, see [SOAP data source properties](http://loopback.io/doc/en/lb3/SOAP-connector.html).
For more information on SOAP datasource properties, see
[SOAP data source properties](http://loopback.io/doc/en/lb3/SOAP-connector.html).

### Generate APIs from the SOAP data source

Now use the [SOAP generator](SOAP-generator.html) to generate models from the SOAP data source.
Now use the [SOAP generator](SOAP-generator.html) to generate models from the
SOAP data source.

```sh
$ lb soap
```

This command lists the SOAP data sources defined for this application;
for this example, it will list the one you just created.
This command lists the SOAP data sources defined for this application; for this
example, it will list the one you just created.

```
? Select the datasource for SOAP discovery
Expand All @@ -89,21 +104,25 @@ for this example, it will list the one you just created.

The generator loads the WSDL for the selected SOAP data source and discovers
services that the WSDL defines.
It then prompts you to select the service from a list (in this example, there is only one).
It then prompts you to select the service from a list (in this example, there is
only one).

```
? Select the service: periodictable
```

After you choose a service, the tool discovers and lists the bindings in the selected service
(in this example, there are two: `periodictableSoap` and `periodictableSoap12`).
After you choose a service, the tool discovers and lists the bindings in the
selected service (in this example, there are two: `periodictableSoap` and
`periodictableSoap12`).
Select the `periodictableSoap` binding.

```
? Select the binding: periodictableSoap
```

After you choose a binding, the tool discovers and lists SOAP operations that the selected binding defines. Press the space bar to select all of the listed SOAP operations.
After you choose a binding, the tool discovers and lists SOAP operations that
the selected binding defines. Press the space bar to select all of the listed
SOAP operations.

```
◉ GetAtoms
Expand All @@ -112,21 +131,26 @@ After you choose a binding, the tool discovers and lists SOAP operations that th
❯◉ GetElementSymbol
```

After you choose one more more operations, the tool generates remote methods and a REST API that can
invoke the web service at `http://www.webservicex.net/periodictable.asmx`.
After you choose one more more operations, the tool generates remote methods and
a REST API that can invoke the web service at
`http://www.webservicex.net/periodictable.asmx`.

#### Generated and modified files

The tool modifies `server/model-config.json` with configuration for all models derived
from the SOAP service.
The tool modifies `server/model-config.json` with configuration for all models
derived from the SOAP service.

The tool generates the following model definition files in the `server/models` directory:
The tool generates the following model definition files in the `server/models`
directory:

- `get-atomic-number-response.json` / `.js`: GetAtomicNumberResponse definition / extension.
- `get-atomic-weight-response.json` / `.js`: GetAtomicWeightResponse definition / extension.
- `get-atomic-number-response.json` / `.js`: GetAtomicNumberResponse definition
/ extension.
- `get-atomic-weight-response.json` / `.js`: GetAtomicWeightResponse definition
/ extension.
- `get-atoms-response.json` / `.js`: GetAtomsResponse definition / extension.
- `get-atoms.json` / `.js`: Getatoms definition / extension.
- `get-element-symbol-response.json` / `.js`: GetelementsymbolResponse definition / extension.
- `get-element-symbol-response.json` / `.js`: GetelementsymbolResponse
definition / extension.
- `get-element-symbol.json` / `.js`: Getelementsymbol definition / extension.
- `get-atomic-number.json`: GetAtomicNumber definition.
- `get-atomic-number.js`: GetAtomicNumber extension.
Expand All @@ -138,6 +162,7 @@ The tool generates the following model definition files in the `server/models` d
### Run the application

To run the application:

```sh
node .
```
Expand All @@ -151,13 +176,18 @@ As you see, SOAP operations defined in the WSDL document are now available.
Let's give a try:

- Click on 'GetAtomicNumber' API.
- Under 'Parameters' click on 'Example Value' text box. This will fill in 'GetAtomicNumber' value text box.
- Fill in the 'ElementName' as 'Copper' or 'Iron' or any element name from the periodic table.
- Under 'Parameters' click on 'Example Value' text box. This will fill in
'GetAtomicNumber' value text box.
- Fill in the 'ElementName' as 'Copper' or 'Iron' or any element name from the
periodic table.
- Click on 'Try it out' button.

{% include image.html file="invoke-api-webservice.png" alt="Invoking SOAP service via API Explorer" %}

This will invoke the REST API which is generated in `soap-periodictable-soap.js`. This REST API in turn
invokes the periodic table Web Service hosted at `http://www.webservicex.net/periodictable.asmx` returning SOAP result back to the API explorer.
This will invoke the REST API which is generated in
`soap-periodictable-soap.js`. This REST API in turn
invokes the periodic table Web Service hosted at
`http://www.webservicex.net/periodictable.asmx` returning SOAP result back to
the API explorer.

{% include image.html file="api-webservice-result.png" alt="Response from SOAP service in API Explorer" %}
10 changes: 6 additions & 4 deletions docs/site/DB2-connector.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: "DB2 connector"
title: 'DB2 connector'
lang: en
layout: readme
source: loopback-connector-db2
keywords: LoopBack
tags: [connectors, readme]
sidebar: lb3_sidebar
permalink: /doc/en/lb3/DB2-connector.html
summary: The DB2 connector enables LoopBack applications to connect to DB2 data sources.
sidebar: lb4_sidebar
permalink: /doc/en/lb4/DB2-connector.html
summary:
The DB2 connector enables LoopBack applications to connect to DB2 data
sources.
---
4 changes: 2 additions & 2 deletions docs/site/DB2-for-z-OS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ layout: readme
source: loopback-connector-db2z
keywords: LoopBack
tags: [connectors, readme]
sidebar: lb3_sidebar
permalink: /doc/en/lb3/DB2-for-z-OS.html
sidebar: lb4_sidebar
permalink: /doc/en/lb4/DB2-for-z-OS.html
summary: The loopback-connector-db2z connector enables LoopBack applications to connect to IBM® DB2® for z/OS® data sources.
---
Loading

0 comments on commit bf81c47

Please sign in to comment.