#soap request give me 400 bad request

1 messages · Page 1 of 1 (latest)

sterile hull
#

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;
}

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>

but i just get 400 bad request. can smb help me out? chatgpt doesnt help at all

dull plazaBOT
#

This post has been reserved for your question.

Hey @sterile hull! 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.

sterile hull
#

any help?

carmine umbra
#

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.

sterile hull
#

the namespaces are all the same everywhere ( in th dto, in xsd, in wsdl, in request), but i still get error

carmine umbra
#

did the response comes with any kind of error message?