soap request give me 400 bad request

hi guys. i have soap service in java spring. i have this dto class:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"userid",
"trans_id"
})
@XmlRootElement(name = "idCheckRequest", namespace = "http://mycompany.lt/soap-web-service")
@Data
public class PerlasCheckIdRequestDTO {
@NotNull(message = "userId cant be null")
@Size(max = 32, message = "userId too long")
@XmlElement(name = "userid", required = true, namespace = "http://mycompany.lt/soap-web-service" )
private String userId;

@NotNull(message = "transactionId cant be null")
@Size(max = 100, message = "transactionId too long")
@XmlElement(name = "trans_id", required = true, namespace = "http://mycompany.lt/soap-web-service")
private String transactionId;
}
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"userid",
"trans_id"
})
@XmlRootElement(name = "idCheckRequest", namespace = "http://mycompany.lt/soap-web-service")
@Data
public class PerlasCheckIdRequestDTO {
@NotNull(message = "userId cant be null")
@Size(max = 32, message = "userId too long")
@XmlElement(name = "userid", required = true, namespace = "http://mycompany.lt/soap-web-service" )
private String userId;

@NotNull(message = "transactionId cant be null")
@Size(max = 100, message = "transactionId too long")
@XmlElement(name = "trans_id", required = true, namespace = "http://mycompany.lt/soap-web-service")
private String transactionId;
}
i send this request body:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance>
<soapenv:Body>
<idcheck soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/>
<userid xsi:type="xsd:string">903</userid>
<trans_id xsi:type="xsd:string">903</trans_id>
</idcheck>
</soapenv:Body>
</soapenv:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance>
<soapenv:Body>
<idcheck soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/>
<userid xsi:type="xsd:string">903</userid>
<trans_id xsi:type="xsd:string">903</trans_id>
</idcheck>
</soapenv:Body>
</soapenv:Envelope>
but i just get 400 bad request. can smb help me out? chatgpt doesnt help at all
6 Replies
JavaBot
JavaBot2mo ago
This post has been reserved for your question.
Hey @Fragmented friends! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
bambyzas
bambyzasOP2mo ago
any help?
Psycotrompus
Psycotrompus2mo ago
it's better if you have a copy of the schema definition for the endpoint. this can be retrieved from the WSDL endpoint. once you have the schema, you can then generate the correct classes that follows the correct schema definition using a maven goal, like Apache CXF.
bambyzas
bambyzasOP2mo ago
i have xsd and wsdl files, but they are useless the namespaces are all the same everywhere ( in th dto, in xsd, in wsdl, in request), but i still get error
Psycotrompus
Psycotrompus2mo ago
did the response comes with any kind of error message?
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server