searchLocations http statuscode 301

deals with geocoding and reverse geocoding

searchLocations http statuscode 301

Postby ASOL » Wed Mar 13, 2019 12:33 pm

Hi there,

after 3 moths i tried the application again and i got a 301 statuscode for searchLocation method in my javaclient.
I´m using the same server as always: "https://xserver2-europe-eu-test.cloud.ptvgroup.com/services" and the code also didnt change.
The picture shows the code piece with the searchLocations method.

I dont know what happened in the past months, anything changed?

XMap still works
Attachments
301Error.PNG
Last edited by Bernd Welter on Wed Mar 13, 2019 1:26 pm, edited 1 time in total.
Reason: Forwarded to our experts (Marco, Frank, Mathias)
ASOL
 
Posts: 5
Joined: Thu Oct 25, 2018 9:32 am

Re: searchLocations http statuscode 301

Postby Bernd Welter » Wed Mar 13, 2019 4:56 pm

Checked this with some admins.

From their perspective it is "ok" and has never been different:
If you try to access the service URL via GET (which is the case in a browser call) you get the mentioned behaviour.
A POST will be handeled properly and that's what the interface was designed for.

Anyway: we discuss whether we update the behaviour in the future (XSERS-1342).

Best regards,
Bernd
Bernd Welter
Manager Technical Consulting & Requirement Engineering
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1275
Joined: Mon Apr 14, 2014 10:28 am

Re: searchLocations http statuscode 301

Postby ASOL » Thu Mar 14, 2019 2:58 pm

The code worked 3 months ago and now without any changes in my code i get this.
My code is also similar to the examples fromJava example
The complete url is : "https://xserver2-europe-eu-test.cloud.ptvgroup.com/services/ws/XLocate"

How can i change this into a post request?
Last edited by Bernd Welter on Thu Mar 14, 2019 3:28 pm, edited 1 time in total.
Reason: Forwarded to Marco
ASOL
 
Posts: 5
Joined: Thu Oct 25, 2018 9:32 am

Re: searchLocations http statuscode 301

Postby Bernd Welter » Fri Mar 15, 2019 9:25 am

Here's another statement from DEV. Not the solution but I'll stay attached to this topic:

The problem is caused by the "http" protocol that is currently specified in the WSDL; java clients download the WSDL and continue requests with the URL stored in the WSDL; this way, the requests is send via HTTP resulting in the 301.
Bernd Welter
Manager Technical Consulting & Requirement Engineering
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1275
Joined: Mon Apr 14, 2014 10:28 am

Re: searchLocations http statuscode 301

Postby Bernd Welter » Fri Mar 15, 2019 2:15 pm

Hello,

I just spoke to one of our admins who confirmed that a little bug managed to get into test (and only into test).
We will fix this (no due date known). If it is urgent you may get in touch with me 1:1 to get an individual solution.

Best regards,
Bernd
Bernd Welter
Manager Technical Consulting & Requirement Engineering
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1275
Joined: Mon Apr 14, 2014 10:28 am

Re: searchLocations http statuscode 301

Postby Bernd Welter » Mon Mar 18, 2019 9:51 am

Hello together,

here's a workaround for the issue - works like a charm:

try to explicity set the endpoint address. The following sample worked for me, last line is the fix:
java code
String url = "https://xserver2-europe-eu-test.cloud.ptvgroup.com/services/ws/XLocate"; 
XLocate client = (XLocate) new XLocate_Service(new URL(url)).getXlocate();
BindingProvider prov = (BindingProvider)client;
prov.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "xtok"); prov.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "replace-this-with-your-token");
prov.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);


Thanks to Frank for the hint,
Bernd
Bernd Welter
Manager Technical Consulting & Requirement Engineering
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1275
Joined: Mon Apr 14, 2014 10:28 am


Return to PTV xLocateServer

cron