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

Error: Invalid character found in method name [0x160x030x010x.....E0xe90x05I0x1c0x1e ]. HTTP method names must be tokens #295

Open
haglo opened this issue May 19, 2023 · 3 comments

Comments

@haglo
Copy link

haglo commented May 19, 2023

I want consume an SOAP-Webservice
The following curl-Command is working (all files are in the same folder)
curl --insecure --cert ./client.pem --key ./privkey.pem -X POST -H 'Content-Type: application/soap+xml; charset=utf-8' --data @request_body.xml 'https://www.../queryws_1_0/VeKa_Query_1_0.asmx';

I have a spring-boot-application, with following structure:
-src/main/resources/cert/client.pem (Zertificate)
-src/main/resources/cert/privkey.pem (Private Key)
-src/main/resources/cert/request_body.xml (Settings for SOAP)

I execute in spring-boot the following CURL-Command
HttpResponse response = curl("--insecure --cert src/main/resources/cert/client.pem --key src/main/resources/cert/privkey.pem -X POST -H 'Content-Type: application/soap+xml; charset=utf-8' --data src/main/resources/cert/request_body.xml https://www..../queryws_1_0/VeKa_Query_1_0.asmx");

When i execute it in SpringBoot as RestController via GetMapping
=> I get the following error:

java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x000xf70x010x000x000xf30x030x030x180xd0RNT0x170xa0Pp0xd20xde0x0a0x9aSaQ0xad90xd7Md0xebWP0x17TE0xe90x05I0x1c0x1e ]. HTTP method names must be tokens

@libetl
Copy link
Owner

libetl commented May 20, 2023

Hello,
thank you for reporting this issue.,

Invalid character found in method name

it might be linked to a https request sent to a http server.

https://stackoverflow.com/questions/42218237/tomcat-java-lang-illegalargumentexception-invalid-character-found-in-method-na

telll me if that was the root cause or if it continues to occur.

@haglo
Copy link
Author

haglo commented May 20, 2023

it might be linked to a https request sent to a http server.
=> yes, this is correct
I work with spring-boot

@libetl
Copy link
Owner

libetl commented May 21, 2023

Hello,

I believe curl will look at the protocol scheme to know whether it should use a https protocol or not

have you tried using the protocol http for your tests ?

http://www..../queryws_1_0/VeKa_Query_1_0.asmx
instead of
https://www..../queryws_1_0/VeKa_Query_1_0.asmx
(but on the same port number)

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

2 participants