Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example request to trias service #1

Closed
hypervtechnics opened this issue Mar 5, 2019 · 3 comments
Closed

Example request to trias service #1

hypervtechnics opened this issue Mar 5, 2019 · 3 comments

Comments

@hypervtechnics
Copy link

Would you provide an example request to a trias service? E.g. Location Information Request with Initial input because the general structure is not clear.

Things mentioned should be:

  • URL
  • Method
  • Body
  • Headers

I tried with the following body and get a 400 :

<?xml version="1.0" encoding="utf-8"?>
<Trias
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.2"
	xmlns="http://www.vdv.de/trias">
	<ServiceRequest>
		<ServiceRequestContext
			xmlns="http://www.siri.org.uk/siri">
			<DataNameSpaces />
			<MultipartDespatch>false</MultipartDespatch>
		</ServiceRequestContext>
		<RequestPayload>
			<LocationInformationRequest>
				<InitialInput>
					<LocationName>Düsseldorf</LocationName>
				</InitialInput>
				<Restrictions>
					<Type>stop</Type>
				</Restrictions>
			</LocationInformationRequest>
		</RequestPayload>
	</ServiceRequest>
</Trias>

as POST request to the trias endpoint.

@forgemo
Copy link

forgemo commented Mar 20, 2019

A very simple working example is:

<Trias version="1.2" xmlns="http://www.vdv.de/trias" xmlns:siri="http://www.siri.org.uk/siri">
    <ServiceRequest>
        <siri:RequestTimestamp>2019-02-17T12:14:01.139+01:00</siri:RequestTimestamp>
        <RequestPayload>
            <LocationInformationRequest>
                <InitialInput>
                    <LocationName>Düsseldorf</LocationName>
                </InitialInput>
            </LocationInformationRequest>
        </RequestPayload>
    </ServiceRequest>
</Trias>

URL: The endpoint, you have access to
METHOD: Post
Body: My example from above
Headers: Content-Type: text/xml

Please make sure, that the trias version matches the version of your endpoint. In this examples case, it is 1.2

@hypervtechnics
Copy link
Author

hypervtechnics commented Mar 20, 2019

@forgemo Thank you for your answer. I tried your solution and it gave me the error 400 again. I started to play with the URL and came to the conclusion that the url published by the company was wrong. Some kind of an error I did not thought of...

PS: Both your and my body worked perfectly after trying with the correct URL :)

@nomaanhusain
Copy link

What is the correct URL? Did you find it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants