cancel
Showing results for 
Search instead for 
Did you mean: 

SM59 Case Sensitive url Type G

Florian
Active Contributor

Hi folks,


I want to connect to an REST-Service which is reachable with an case sensitive url. I have no clue, why, but it looks like the system is converting the maintained url to lower case somewhere between.

I use the class

cl_http_client= create_by_destination

but also with create_by_url does not work as expected.

Another url on the same server, with an address, which only includes lower case, works fine as expected.

What I checked:

Proxysettings,

is the server reachable.. it is using the browser, or postman, also done via the linux-server where the system runs.

icm-trace... here it looks like it is converted to lower case...

used another system.

debugged down to the kernel-routine which is called... address is all the time camelcase included.

SAP Notes - No hits (System one 7.40 SP08, System two 7.53 SP01)

So anyone an idea what I could check.

I suggest it is a setting, which is used for webdynpro.. found several hints on that, but nothing catchable to check.

View Entire Topic
UweFetzer_se38
Active Contributor

Hi Florian,

strange, this works for me (7.52, DevEdition):

    cl_http_client=>create_by_destination(
      EXPORTING
        destination              = 'HTTP_TEST'                 " logische Destination (Wird bei Funktionsaufruf angegeben)
      IMPORTING
        client                   = DATA(client)                 " HTTP Client Abstraction
      EXCEPTIONS
        argument_not_found       = 1                " Verbindungsparmaeter (Destination) nicht verfügbar
        destination_not_found    = 2                " Destination ist nicht fefunden
        destination_no_authority = 3                " Keine Berechtigung zur Verwendung der HTTP-Destination
        plugin_not_active        = 4                " HTTP/HTTPS-Kommunikation ist nicht verfügbar
        internal_error           = 5                " Interner Fehler ( z. B. name zu groß)
        OTHERS                   = 6
    ).


    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.


    cl_http_utility=>set_request_uri( request = client->request
                                      uri    = '/CamelCase.html' ).


    client->send(
      EXCEPTIONS
        http_communication_failure = 1                  " Kommunikationsfehler
        http_invalid_state         = 2                  " Ungültiger Zustand
        http_processing_failed     = 3                  " Bearbeitung der Methode misslungen
        http_invalid_timeout       = 4                  " Ungültige Zeitangabe
        OTHERS                     = 5
    ).
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.


    client->receive(
      EXCEPTIONS
        http_communication_failure = 1                " Kommunikationsfehler
        http_invalid_state         = 2                " ungültiger Zustand
        http_processing_failed     = 3                " Bearbeitung der Methode misslungen
        OTHERS                     = 4
    ).
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.


    cl_demo_output=>display( client->response->get_cdata( ) ).
Florian
Active Contributor

I think I found the mistake I made.

I've done it exactly like you except this one.

    cl_http_utility=>set_request_uri( request = client->request
                                      uri    = '/CamelCase.html' ).<br>

I maintained that part also via the connection and tried afterwards to add parameters via cl_http_utility...(something like ?param=123&m2=345) out of a reason I don't know (yet) it doesn't called the url correct because of that...

changing the whole thing to put the uri and the parameters before and using the method you also used it works... still strange, but atm I need to get that done and the next days I reserved a slot to investigate a lot deeper to understand what's going wrong here.

Thank you for your support!

ŁukaszPęgiel
Contributor

To add parameters please use method append_field_url from http client.

data: uri type string = '/CamelCase.html'.

client->append_field_url( exporting name = parameter-name
value = parameter_value changing url = uri )
cl_http_utility=>set_request_uri( request = client->request uri = uri )

Of course the best is to escape it before.