bambyzas
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 11/4/2024 in #java-help
how to properly config my application logging?
hey guys. i have java spring app. and on the server its running as a service. heres my
application123.service
:
Now when this service runs on the server, everything is logged to syslog. And the thing is that id want to log everything to separate file. smth like application123.log
. so my question is should i edit my application123.service
file, or should i edit application.yaml
file? thanks8 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 10/14/2024 in #java-help
Soap request gives me 404 and "No endpoint mapping" even if everything is correct
Hello everyone. Its been almost a week and I still cant find an error and the reason why I am getting this kind of error. The thing is that my endpoint is correct, everything is set up fine. Earlier this endpoint had different name and everything worked fine. And now after changing the endpoint name everything just broke.
Things I tried: asking chat gpt and gemini, asking for help on different discord servers, googling and browsing stackoverflow.
The thing is that I cannot change the request body and I just need to use this request body.
This is my Java code: https://pastecode.io/s/antg289v
xsd and wsdl: https://pastecode.io/s/7142nmnr
request body: https://pastecode.io/s/ng61346m
console log: https://pastecode.io/s/1wg2oi2f
Could somebody take a look and help me out? Huge thanks
6 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 10/9/2024 in #java-help
No endpoint mapping found for [SaajSoapMessage idcheck]
hi guys. im developing soap service in java spring and i keep getting
No endpoint mapping found for [SaajSoapMessage idcheck]
erro. can smb pls help me out?
My java code: https://pastecode.io/s/antg289v
xsd and wsdl: https://pastecode.io/s/7142nmnr
request body: https://pastecode.io/s/ng61346m
thanks alot5 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 10/7/2024 in #java-help
java variables need to have the same name like in SOAP request?
hi guys. i have soap service in java spring. i have this dto class:
i send this request body:
but i get:
i noticed that if i name my java vars the same like they are named in request xml, everything is fine. But the thing is that my code gets messy. Is there a fix for this scenario?
4 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 10/7/2024 in #java-help
soap request give me 400 bad request
hi guys. i have soap service in java spring. i have this dto class:
i send this request body:
but i just get 400 bad request. can smb help me out? chatgpt doesnt help at all
9 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 10/3/2024 in #java-help
how to find WSDL file location in my SOAP webservice?
hey guys. i have soap webservice that is running on my server. i can call it with postman:
http://dev.mycompany.lt/bgw/perlas
then i add needed body and receive expected response. everythings fine. but i was wondering what is the location of my wsdl file? can smb help me out? thx8 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 9/27/2024 in #java-help
WebSecurityConfig in java spring app doesnt work
hey guys. can smb help me out? i have java spring app runing on my server
dev2
. on the server i also have nginx basic auth and proxy configured. now when i do the request to http://dev2.mysite.lt/bgw/perlas
i get asked for my nginx basic auth credentials. i enter them, and later im prompted with another login page thats comming from my app. my WebSecurityConfig
looks like this:
can smb help me out? thx6 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 9/24/2024 in #java-help
what password to enter when doing git push?
hey guys. can smb help me out with git? I tried googling but theres no normal and simple answer. the more i read the less i understand.
i did
git commit -m "my message"
.
then when i try to do git push
i get:
what password do i need to enter? can smb explain?63 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 9/23/2024 in #java-help
how to enable basic auth in java spring app?
hey guys. i have java spring app. in
WebSecurityConfig
i have this:
and i want to enable basic auth. i know that i can do it in nginx, but i was wondering if i can do it in my spring app config somehow. can smb help me out? thx8 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 9/16/2024 in #java-help
how to test my scheduled methods locally?
hey guys. so i have java spring app. in the app i have a 2 methods annotated with
@Scheduled
and each method has 2 cron expressions (one for work days, one for weekend). i deploy my app to the server. and on the same server i have cron jobs and thats how my code is being scheduled. but my question is how to locally test if my cron jobs for these two methods work fine?4 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 9/16/2024 in #java-help
how to properly update spring version?
hi guys. i have java project and current spring version is
2.2.6
. i need to update the version to the newest. as i understand its 3.3.3
. so i have a couple of questions;
1. since i use gradle, i just need to change the version here?
2. is there smth to look out for when updating spring version in my project?
thanks in advance5 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 9/12/2024 in #java-help
how to return multiple objects in SOAP webservice?
hey guys. im developing SOAP webservice in java and i have a question. there are two operations
checkId
and createSale
. and there are CheckIdRequestDTO
, CheckIdResponseDTO
, CreateSaleRequestDTO
, CreateSaleResponseDTO
. when validating checkId
request and there are some errors, i set needed CheckIdResponseDTO
fields to needed values and return the DTO and everything is fine. so my endpoint returns CheckIdResponseDTO
in both cases: if its ok, or theres an error. But now im having trouble with createSale
request. im validating CreateSaleRequestDTO
, and if theres an error i dont have anything to return. I was thinking about constructing something like CreateSaleRequestErrorDTO
. but then my endpoint cant return it. this is my endpoint so far:
and idk what to do in this situation. can smb help me out? thx9 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 9/12/2024 in #java-help
what data type to use for storing ids?
hi guys. in java code i will need to use/store ids, that look like
11000000035
. what data type to use? long
or just String
? because int
in my case doesnt have enough storage for symbols. thanks12 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 8/16/2024 in #java-help
exception handling in SOAP webservices
hey guys. i have a question about SOAP webservice. i have this piece of code in my service layer:
and i have this exception:
and the exception is later handled by the
RestResponseEntityExceptionHandler
.
so i have a couple of questions:
1. can i use the same exception? or do i need to create a duplicate one that will only be used for SOAP service? can i reuse the exception from my REST service?
2. how to handle the exceptions in SOAP webservices? i tried googling but honestly didnt understand a thing.
can smb help me out? thx4 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 8/16/2024 in #java-help
SOAP service returns 404
hi guys. im developing SOAP web service. but when i call it with SOAP UI, i get
my code:
idk what im doing wrong. can smb help me out? thx
4 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 8/7/2024 in #java-help
how to validate three similar objects that come into my controller?
hey guys. i have an api with 3 endpoints. each endpoint reveices the same DTO object. but the values vary.
1st endpoint receives object with these fields: transactionId, clientId, amount, signature
2nd endpoint receives object with these fields: transactionId, amount, signature
3rd endpoint: transactionId, signature
signature is generated before calling the first endpoint. its just transactionId, clientId and amount concatenated together. and then the same signature is used in the 2nd and 3rd endpoints/requests.
i want to have a method to somehow validate
signature
field in requests. i dont know how can i have a generic/universal method that can be used for all three objects. would it mean that i need to have three different methods? any ideas? thanks alot9 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 8/7/2024 in #java-help
formulate JPA method to update column
hey guys. i have a question about java spring. i have a DB table and a repository in my code. in my service i want to find a DB row/record by
transactionId
, and change record's status
column/field value. i was thinking about boolean updateSalesOrderByTransactionId(@Param("transactionId"));
but i dont know how to say that i want to update status
column? can smb help me out? thanks9 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 8/6/2024 in #java-help
how to fix my WSDL file for SOAP service?
hey guys. can smb help me out with WSDL file? im working on a SOAP webservice, and as i understand, there are some issues with my WSDL file. this is my file: https://pastecode.io/s/c78xizki and i have these questions
1. why theres
wsdl:
before message
, part
or any other tag?
2. why there are so many xmlns
s? i.e. xmlns:soap
, xmlns:s
, xmlns:wsdl
, etc? i feel that theres too much duplication
3. what does documentation
tag even mean? how does it even work? google says The documentation element is used to enter text comments in a schema
. but i dont have any schema
tags???
4. what to us for soapAction
attribute? what value should it have?
5. as i understand, there are 4 requests: idCheckSoapIn, idCheckSoapOut, saleSoapIn, saleSoapOut. but what the hell is CustomerSoap?
6. what do i even need to do after the 46th line? everything before 46th line makes sense - i just desribe what requests and responses my webservice will have. but what is going on after the 46th line?
thanks in advance4 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 8/5/2024 in #java-help
i keep getting error "Attribute value must be constant". can smb help me out?
hey guys. i have this:
but i get an error from
SOAP_NAMESPACE
that says: Attribute value must be constant
. can smb help me out with it? bc googling doesnt help. thanks in advance.13 replies
JCHJava Community | Help. Code. Learn.
•Created by bambyzas on 8/2/2024 in #java-help
how to create SOAP webservice?
hey guys. i need to code soap webservice. i was wondering if you could help me out with a couple of questions?
1. i have these dependencies in my gradle file. do ineed smth more?
2. im given a
wsdl
file. do i need to have an xsd
file too?
3. do i still need a controller?
thanks in advance56 replies