Code Monkey home page Code Monkey logo

Comments (18)

BlackmanCC avatar BlackmanCC commented on June 28, 2024 1

I will look into it tomorrow, but I will need some of your help for sure. I am currently getting slowly better into that things ;-)

from abaplint-sci-client.

larshp avatar larshp commented on June 28, 2024

this is when calling the API provided by https://github.com/abaplint/abaplint-sci-server ?

from abaplint-sci-client.

BlackmanCC avatar BlackmanCC commented on June 28, 2024

yes, I am running the API in a docker container on our internal linux server.

from abaplint-sci-client.

larshp avatar larshp commented on June 28, 2024

is the source ABAP system running unicode?

from abaplint-sci-client.

BlackmanCC avatar BlackmanCC commented on June 28, 2024

no. like I said the system is non-unicode. We will switch to unicode system in the 1st quarter of next year

from abaplint-sci-client.

larshp avatar larshp commented on June 28, 2024

okay, I missed that part 😄

as far as I remember, there is some way to set the encoding by the http client, need it somewhere around
https://github.com/abaplint/abaplint-sci-client/blob/master/src/zcl_abaplint_backend_api_agent.clas.abap#L131

from abaplint-sci-client.

larshp avatar larshp commented on June 28, 2024

iv_payload must be converted to UTF8, and then use set_data instead, plus set charset http header field

from abaplint-sci-client.

BlackmanCC avatar BlackmanCC commented on June 28, 2024

found this
https://codezentrale.de/abap-http-client-anfrage-von-xml-daten/

from abaplint-sci-client.

BlackmanCC avatar BlackmanCC commented on June 28, 2024

I think, header field could be set by

     o_client->request->set_header_field( name  = 'Content-Type'
                                          value = 'text/xml; charset=utf-8' ).

but, how to convert iv_payload to UTF8?

from abaplint-sci-client.

larshp avatar larshp commented on June 28, 2024

call ZCL_ABAPGIT_CONVERT=>STRING_TO_XSTRING_UTF8

from abaplint-sci-client.

BlackmanCC avatar BlackmanCC commented on June 28, 2024

I should only convert the contents of iv_payload before building the json, right?

I could do it in ZCL_ABAPLINT_BACKEND->BASE64_ENCODE?

from abaplint-sci-client.

BlackmanCC avatar BlackmanCC commented on June 28, 2024

this not works for now:

 API request failed [500]: [abaplint] JSON5: invalid
character '�' at 1:1 ()

from abaplint-sci-client.

larshp avatar larshp commented on June 28, 2024

whats your code in the client?, it should be something like,

    IF iv_method = 'POST' AND iv_payload IS NOT INITIAL. " OR PUT ... maybe in future
      li_client->request->set_data( ZCL_ABAPGIT_CONVERT=>STRING_TO_XSTRING_UTF8( iv_payload ) ).
      li_client->request->set_header_field( name  = 'Content-Type' value = 'application/json; charset=utf-8' ).
    ENDIF.

from abaplint-sci-client.

larshp avatar larshp commented on June 28, 2024

but yea, hmm, there might be multiple places that needs changing

from abaplint-sci-client.

larshp avatar larshp commented on June 28, 2024

see #232

from abaplint-sci-client.

BlackmanCC avatar BlackmanCC commented on June 28, 2024

will try it out thanks a lot

from abaplint-sci-client.

BlackmanCC avatar BlackmanCC commented on June 28, 2024

seems to work now.
It get LINT_* errorcodes now.

Thank you very much!

from abaplint-sci-client.

larshp avatar larshp commented on June 28, 2024

fixed, closing

from abaplint-sci-client.

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.