mattsalt / national-rail-darwin Goto Github PK
View Code? Open in Web Editor NEWJS module abstracting national rail's SOAP API
Home Page: https://www.npmjs.com/package/national-rail-darwin
License: MIT License
JS module abstracting national rail's SOAP API
Home Page: https://www.npmjs.com/package/national-rail-darwin
License: MIT License
Hi,
I've registered with the Darwin LDBWS service and received my token but all calls through national-rail-darwin
fail with the following error:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Unexpected server error</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>'
The key part being Unexpected server error
.
I'm using the CMD tool with the following command darwin db LGX -t {Darwin Token Here}
.
Any ideas?
Thanks!
Hi Matthew,
Thanks for the great wrapper.
I noticed filter
option is never used when building the request, destination
is used for filterCrs
instead.
national-rail-darwin/templates.js
Line 12 in 282b0e2
national-rail-darwin/templates.js
Line 20 in 282b0e2
The options will have to be passed in as destination
to get the desired response.
rail.getDepartureBoardWithDetails('RDG', { filter: 'WAT' }, (e, result) => {
});
// instead I used ⬇️
rail.getDepartureBoardWithDetails('RDG', { destination: 'WAT' }, (e, result) => {
});
The ReadMe's don't explain what the Darwin_Token is.
Is it the Access Key or Secret Key in the national rail "my feeds" or do I need to register for a different API access?
CORS... it's driving me mental. How can I disable cors - I've event tried hacking headings into the Bluebird index.js - no matter what call I make (and I'm doing this through Vue.js in case that's the issue?) I get:-
Access to fetch at 'https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb11.asmx' from origin 'http://127.0.0.1:8844' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I suspect it's something to do with the :8844 port number on the local host?
Is there any possibility that the GetDepartureBoardByCRS
call could be implemented (as it supports providing larger timeWindow and timeOffset values)?
I've had a look at implementing it myself with intents of doing a PR, but I'm not versed enough with some parts of the API (e.g. SOAPAction header values) to be able to figure out how to implement it.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.