Skip to content

Commit

Permalink
Prepare module packagin [wip]
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyskn committed May 10, 2012
1 parent c71e442 commit d027c72
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
node_modules/*
npm-debug.log
1 change: 1 addition & 0 deletions index.js
@@ -0,0 +1 @@
module.exports = require('./src/controller');
24 changes: 15 additions & 9 deletions package.json
@@ -1,20 +1,26 @@
{
"author": "VIDAL Software",
"name": "caeliajs",
"description": "Caelia done right :-)",
"version": "0.8.0",
"name": "express-soap",
"description": "Enables an Express server to proxy to an underlying SOAP server through an emulated JSON/HTTP API",
"version": "0.1.0",
"author": "Tony Sokhon <tonyskn@gmail.com>",
"repository": {
"type": "git",
"url": "git@github.com:softwarevidal/Caelia.git"
"url": "https://github.com/tonyskn/express-soap"
},
"main": "index.js",
"scripts": {
"start": "node server.js",
"test": "node_modules/.bin/mocha test/*.js"
},
"main": "main.js",
"engines": {
"node": "~0.6.6"
"node": ">=0.6.0"
},
"dependencies": {
"forever" : "0.8.5",
"soap" : "0.2.4"
},
"devDependencies": {
"commander": "0.5.2",
"express" : "2.5.8",
"soap" : "0.2.4"
"mocha" : "1.0.3"
}
}
10 changes: 6 additions & 4 deletions main.js → server.js
@@ -1,11 +1,12 @@
var config = require("commander"),
soapController = require("./lib/controller"),
soapController = require("./index.js"),
express = require("express"),
server = express.createServer();

config
.option("-p, --port [port]", "Server port", 9876)
.option("-u, --zapi-url [url]", "Merlin API server url", "http://localhost:9000/merlin-server/services/")
.option("-u, --soap-url [url]", "SOAP server url", "http://localhost:9000/merlin-server/services/")
.option("-P, --prefix [prefix]", "Url prefix", "")
.parse(process.argv);

// our catcher for log messages
Expand All @@ -14,9 +15,10 @@ process.addListener('uncaughtException', function (err, stack) {
console.log(message);
});

soapController.configure(server, config.zapiUrl);
soapController.configure(server, config.soapUrl, config.prefix);

console.log("Using SOAP server on: ", config.zapiUrl);
console.log("Using SOAP server on: ", config.soapUrl);
console.log("Listening on port: ", config.port);
console.log("Service urls use prefix: ", config.prefix);

server.listen(config.port);
File renamed without changes.
64 changes: 64 additions & 0 deletions test/wsdl/StockQuote.wsdl
@@ -0,0 +1,64 @@
<?xml version="1.0"?>

<wsdl:definitions name="StockQuote"
targetNamespace="http://example.com/stockquote.wsdl"
xmlns:tns="http://example.com/stockquote.wsdl"
xmlns:xsd1="http://example.com/stockquote.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

<wsdl:types>
<xsd:schema targetNamespace="http://example.com/stockquote.xsd" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">
<xsd:element name="TradePriceRequest">
<xsd:simpleType>
<xsd:restriction base="string">
<xsd:enumeration value="AAPL" />
<xsd:enumeration value="GOOG" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="TradePrice">
<xsd:complexType>
<xsd:all>
<xsd:element name="price" type="float"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>

<wsdl:message name="GetLastTradePriceInput">
<wsdl:part name="body" element="xsd1:TradePriceRequest"/>
</wsdl:message>

<wsdl:message name="GetLastTradePriceOutput">
<wsdl:part name="body" element="xsd1:TradePrice"/>
</wsdl:message>

<wsdl:portType name="StockQuotePortType">
<wsdl:operation name="GetLastTradePrice">
<wsdl:input message="tns:GetLastTradePriceInput"/>
<wsdl:output message="tns:GetLastTradePriceOutput"/>
</wsdl:operation>
</wsdl:portType>

<wsdl:binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetLastTradePrice">
<soap:operation soapAction="http://example.com/GetLastTradePrice"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

<wsdl:service name="StockQuoteService">
<wsdl:port name="StockQuotePort" binding="tns:StockQuoteSoapBinding">
<soap:address location="http://localhost:15099/stockquote"/>
</wsdl:port>
</wsdl:service>

</wsdl:definitions>

0 comments on commit d027c72

Please sign in to comment.