Giter Site home page Giter Site logo

Comments (7)

RikkiGibson avatar RikkiGibson commented on May 12, 2024

Blehhh :( This could be one of a few things.

  1. 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.
  2. 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.

NXxEpicXCreeperxX avatar NXxEpicXCreeperxX commented on May 12, 2024

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.

NXxEpicXCreeperxX avatar NXxEpicXCreeperxX commented on May 12, 2024

Any update yet? Sorry to bug.

from corvallis-bus-server.

RikkiGibson avatar RikkiGibson commented on May 12, 2024

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 &amp; 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 &amp; 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 some records). 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 &amp; 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.

NXxEpicXCreeperxX avatar NXxEpicXCreeperxX commented on May 12, 2024

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.

RikkiGibson avatar RikkiGibson commented on May 12, 2024

I may have fixed it. Give it a try on Monday.

from corvallis-bus-server.

NXxEpicXCreeperxX avatar NXxEpicXCreeperxX commented on May 12, 2024

Sounds good thank you!

from corvallis-bus-server.

Related Issues (20)

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.