GithubHelp home page GithubHelp logo

mattsalt / national-rail-darwin Goto Github PK

View Code? Open in Web Editor NEW
32.0 32.0 19.0 349 KB

JS module abstracting national rail's SOAP API

Home Page: https://www.npmjs.com/package/national-rail-darwin

License: MIT License

JavaScript 100.00%

national-rail-darwin's People

Contributors

acatalina avatar bafta-benj avatar c-m-hunt avatar chrisandrews7 avatar doryphores avatar mattsalt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

national-rail-darwin's Issues

Darwin API still supported?

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!

unused filter in options

Hi Matthew,

Thanks for the great wrapper.

I noticed filter option is never used when building the request, destination is used for filterCrs instead.

filter: [ '', 'TEXT' ],

`<ldb:filterCrs>$$DESTINATION$$</ldb:filterCrs>` +

` <ldb:crs>$$DESTINATION$$</ldb:crs>` +

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) => {
});

I'm probably being stupid but.... Access Keys + CORS

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?

GetDepartureBoardByCRS implementation

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.