findPOIByAddress searchOptions not working as expected

deals with geocoding and reverse geocoding
Post Reply
jeaes
Posts: 2
Joined: Mon Nov 05, 2018 12:25 pm

findPOIByAddress searchOptions not working as expected

Post by jeaes »

Hi experts,

I'm having some trouble setting the SearchOptions in the method findPOIByAddress. It doesn't seem to be working as expected. I'm making SOAP requests from an SAP System and a successful call to findAddress would have the following SearchOptions:

Code: Select all

<n0:ArrayOfSearchOptionBase_2>
    <n2:SearchOptionBase xsi:type="n2:SearchOption" value="1" param="COUNTRY_CODETYPE" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</n0:ArrayOfSearchOptionBase_2>
Setting the parameter COUNTRY_CODETYPE to 1 allows us to send a request using a country ISO code 2 to the xServer (e.g. DE instead of D for Germany). This works fine in the Method findAddress, and the same behavior is what we aim to achieve with the method findPOIByAddress, so we have the following snippet from our request:

Code: Select all

<ne:ArrayOfSearchOptionBase_2 xmlns:ne="http://types.xlocate.xserver.ptvag.com">
    <n0:SearchOptionBase xmlns:n0="http://xlocate.xserver.ptvag.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="n0:SearchOption" value="1" param="COUNTRY_CODETYPE"/>
    <n0:SearchOptionBase xmlns:n0="http://xlocate.xserver.ptvag.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="n0:SearchOption" value="3" param="STREET_HNRPOSITION"/>
    <n0:SearchOptionBase xmlns:n0="http://xlocate.xserver.ptvag.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="n0:SearchOption" value="1" param="STREET_RETURNALLHNR"/>
</ne:ArrayOfSearchOptionBase_2>
Unfortunately, we get the following response as error:

Code: Select all

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Server</faultcode>
      <faultstring>Internal Server Error</faultstring>
      <detail>
        <ns4:XServiceException xmlns:ns6="http://exception.core.jabba.ptvag.com" xmlns:ns4="http://common.xserver.ptvag.com" xmlns:ns3="http://baseservices.service.jabba.ptvag.com" xmlns:ns2="http://types.xlocate.xserver.ptvag.com" xmlns:ns1="http://wrappertypes.service.jabba.ptvag.com" xmlns:ns0="http://xlocate.xserver.ptvag.com">
          <ns6:stackElement className="com.ptvag.xserver.common.XServiceException" message="Internal Server Error">
            <ns6:cause className="com.ptvag.xserver.engines.xpoidbaccess.UsageException" message="unknown country code:DE">
              <ns6:cause xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
              <ns6:wrappedContext xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
            </ns6:cause>
            <ns6:wrappedContext xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          </ns6:stackElement>
        </ns4:XServiceException>
      </detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>
Could someone please help us figure out the cause? Why does the behavior of the 2 methods in the same xLocate is not consistent? Why does the parameter COUNTRY_CODETYPE doesn't seem to have an effect on the SearchOptions?
User avatar
Bernd Welter
Site Admin
Posts: 2564
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: findPOIByAddress searchOptions not working as expected

Post by Bernd Welter »

Hello Jesse,

probably a simple cause:
If you want to apply the search for a specific country code in the POI search you need
  • to use the POISearchOption class (not SearchOption)
  • to label the parameter COUNRTYCODE_TYPE (and not COUNTRY_CODETYPE ;) )
Well, a bit misleading. Unfortunately the naming is not unique within the interface. :(

Does this answer the question?

Best regards,
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
jeaes
Posts: 2
Joined: Mon Nov 05, 2018 12:25 pm

Re: findPOIByAddress searchOptions not working as expected

Post by jeaes »

Ooops :shock: ,

we forgot to take the POISearchOption in consideration, but it's still a bit of a bummer, that the parameter is named COUNTRYCODE_TYPE instead of COUNTRY_CODETYPE as in the other methods, as well as misleading, as you mentioned.

Nonetheless the problem is solved by using the correct class / parameter pair.

Thanks Bernd! ;)
Post Reply