Comments (7)
Blehhh :( This could be one of a few things.
- The city is blocking access from the IPs for the Corvallis Bus Server. This already happened for service alerts, and was unblocked in the past, and then reblocked, and in that case we'll just have to reach out and ask to get put back on the allow-list.
- A breaking change has occurred in the underlying Connexionz API. They could have moved things or changed the format of the data so that the bus server just falls over when it gets the response.
It might be a little while before I can look more closely at this. I do apologize that the experience has been degrading lately.
I'm hoping to identify some institution connected to Corvallis which can maintain the app for the long haul. It's unfortunately something that's difficult to keep on my plate these days. I have been developing+maintaining this app since 2014, and though I was born in and grew up in Corvallis and love it, I moved away in 2017, and that's made it harder.
If people are enthusiastic about the app continuing to run, maybe they could consider leaving a comment to the city letting them know. It might be possible that the city could provide funding so that a suitable local organization could take over maintenance.
from corvallis-bus-server.
Ok thank you, wish I could fix things too but don’t know any coding stuff. Thanks for taking a look and I’ll be patiently waiting
from corvallis-bus-server.
Any update yet? Sorry to bug.
from corvallis-bus-server.
It looks like the XML from Connexionz no longer includes namespaces, and I can't find a quick-and-dirty way to ignore the namespaces. Have tried a few things like XmlTextReader.Namespaces = false
.
We are receiving a document like:
<?xml version="1.0" encoding="utf-8"?>
<RoutePositionET>
<Content Expires="2023-04-02T12:00:31-07:00" MaxArrivalScope="60" />
<Platform PlatformTag="347" Name="NW Witham Hill Dr & NW Fernwood Cir" />
</RoutePositionET>
When we want to get a document like (my best guess, my bad for not actually recording the responses from the time this stuff worked):
<?xml version="1.0" encoding="utf-8"?>
<c:RoutePositionET xmlns:c="urn:connexionz-co-nz">
<c:Content Expires="2023-04-02T12:00:31-07:00" MaxArrivalScope="60" />
<c:Platform PlatformTag="347" Name="NW Witham Hill Dr & NW Fernwood Cir" />
</c:RoutePositionET>
It might be simpler to rip out the RoutePosition.xsd, etc. and use XDocument or something. I don't know. I don't work with XSD much so there could be some setting there that I'm missing.
I can't get to it this weekend but anyone is welcome to try and pull down the project, then
- observe the responses being deserialized in ConnexionzClient.cs. Create some unit tests which try to deserialize those, I'll give an example below
- declare some model types to fulfill the same purpose as those under
Models/Connexionz/Generated
(maybe declare somerecord
s). You can maybe figure out which types and bits of information matter here by straight-up deleting the Generated folder and seeing which bits of the clients/managers/etc. fail to build. - Write some factory methods on the records to create instances of the records from the XML we get from the server using XDocument
- Rip out the
.xsd
files and replace the generated models with the records you added
Here's a sample test I was playing with to try and get things working with XmlSerializer. I just ran out of time.
using CorvallisBus.Core.WebClients;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
using Xunit;
namespace CorvallisBus.Test
{
public class DeserializationTests
{
[Fact]
public void RoutePositionET()
{
var source = """
<?xml version="1.0" encoding="utf-8"?">
<RoutePositionET>
<Content Expires="2023-04-02T11:04:31-07:00" MaxArrivalScope="60" />
<Platform PlatformTag="96" Name="SW 26th St & SW Campus Way" />
</RoutePositionET>
""";
var serializer = new XmlSerializer(typeof(RoutePosition));
var entity = (RoutePosition)serializer.Deserialize(new StringReader(source))!;
Assert.NotNull(entity.Items);
}
}
}
I might be able to get to this, but it may be a few weeks.
from corvallis-bus-server.
Yeah i sadly am not a coder or was able to get any other help atm so.
Hopefully you'll find something someday.
from corvallis-bus-server.
I may have fixed it. Give it a try on Monday.
from corvallis-bus-server.
Sounds good thank you!
from corvallis-bus-server.
Related Issues (20)
- Fix stop sorting such that estimates are always shown before scheduled times HOT 1
- Disambiguate names of bus stops by direction HOT 1
- Add support for military time HOT 3
- Remove lazy loading from ConnexionzClient and GoogleTransitClient HOT 1
- Add /stops/ endpoint To API HOT 8
- .NET Core/Azure HOT 1
- Add support for multi-route directions HOT 3
- Enable CORS
- Google Transit zipfile should be stored with project
- Validate results after init job HOT 1
- Scraping service alerts website is broken HOT 1
- Fix off-by-one-minute errors
- Use domain objects instead of dictionaries directly
- Sunday schedule shown early Monday morning HOT 1
- Move data dependency to GTFS as much as possible HOT 1
- Move from Azure Scheduler jobs to Logic Apps HOT 1
- Corvallis Bus App Issue HOT 3
- Validation issues for route 6 and route 7
- Write more Connexionz deserialization tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corvallis-bus-server.