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?
dependencies {
xsd2java "com.sun.xml.bind:jaxb-xjc:2.2.6"
xsd2java "com.sun.xml.bind:jaxb-impl:2.2.6"
xsd2java "jakarta.xml.bind:jakarta.xml.bind-api:2.3.2"
xsd2java "org.glassfish.jaxb:jaxb-runtime:2.3.2"

implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'

implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-security'

implementation 'org.springframework.security:spring-security-test'
implementation 'org.springframework.boot:spring-boot-devtools'

implementation 'io.springfox:springfox-swagger2:3.0.0' //:
implementation 'io.springfox:springfox-swagger-ui:3.0.0' //:2.9.2

implementation 'commons-codec:commons-codec:1.14' //:2.9.2
implementation 'org.apache.httpcomponents:httpclient:4.5.14'

compileOnly 'org.projectlombok:lombok:1.18.32'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testCompile group: 'junit', name: 'junit', version: '4.12'

}
dependencies {
xsd2java "com.sun.xml.bind:jaxb-xjc:2.2.6"
xsd2java "com.sun.xml.bind:jaxb-impl:2.2.6"
xsd2java "jakarta.xml.bind:jakarta.xml.bind-api:2.3.2"
xsd2java "org.glassfish.jaxb:jaxb-runtime:2.3.2"

implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'

implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-security'

implementation 'org.springframework.security:spring-security-test'
implementation 'org.springframework.boot:spring-boot-devtools'

implementation 'io.springfox:springfox-swagger2:3.0.0' //:
implementation 'io.springfox:springfox-swagger-ui:3.0.0' //:2.9.2

implementation 'commons-codec:commons-codec:1.14' //:2.9.2
implementation 'org.apache.httpcomponents:httpclient:4.5.14'

compileOnly 'org.projectlombok:lombok:1.18.32'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testCompile group: 'junit', name: 'junit', version: '4.12'

}
2. im given a wsdl file. do i need to have an xsd file too? 3. do i still need a controller? thanks in advance
35 Replies
JavaBot
JavaBot4mo ago
This post has been reserved for your question.
Hey @bambyzas! 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.
dan1st
dan1st4mo ago
You need to decide whether you want to use Java EE or Jakarta EE your jaxb-impl dependency is Java EE and your bind-api dependency is Jakarta EE well at least the version you listed
bambyzas
bambyzasOP4mo ago
sorry, i completely dont understand what u mean. can u elaborate?
dan1st
dan1st4mo ago
Stack Overflow
How to avoid compatibility issues between Java EE and Jakarta EE?
After Oracle donated Java EE to the Eclipse Foundation, it was renamed to Jakarta EE. With that, the javax namespace was changed to jakarta. What does one need to take care about in order to avoid
dan1st
dan1st4mo ago
Do you know the difference between Java EE and Jakarta EE?
bambyzas
bambyzasOP4mo ago
sorry, no idea. but i dont know how its related to my question 😦
dan1st
dan1st4mo ago
the whole thing for generating SOAP webservices is part of Java EE/Jakarta EE and Java EE was replaced by Jakarta EE and you cannot use both together, you have to decide for one of them
bambyzas
bambyzasOP4mo ago
lets say i just want to use whatever is used in my current project
dan1st
dan1st4mo ago
What version of Spring Boot are you using?
bambyzas
bambyzasOP4mo ago
idk what Java EE or Jakarta EE is and nor do i care
plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}
plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}
226 and 109
dan1st
dan1st4mo ago
This version is outdated by a lot You can't expect anything to work with that Anyways this is Spring Boot 2.x so you cannot use Jakarta EE with that
bambyzas
bambyzasOP4mo ago
wdym? the app is working fine and i successfully am developing new features on it
dan1st
dan1st4mo ago
it might work until it breaks in a way that can't be fixed
bambyzas
bambyzasOP4mo ago
once again, i dont undesrstand how its related to my initial question 😦
dan1st
dan1st4mo ago
The dependencies you posted won't work with SOAP these are incompatible For example xsd2java "jakarta.xml.bind:jakarta.xml.bind-api:2.3.2" is incompatible with your Spring version
bambyzas
bambyzasOP4mo ago
how do u know?
dan1st
dan1st4mo ago
because jakarta.xml.bind:jakarta.xml.bind-api:2.3.2 is a Jakarta EE dependency
bambyzas
bambyzasOP4mo ago
ok. so i deleted this dependency
dan1st
dan1st4mo ago
and Jakarta EE dependencies use the jakarta root package which Spring 2 cannot work with you might still need the corresponding Java EE/javax dependency
bambyzas
bambyzasOP4mo ago
now im starting to understand but how do i know what dependencies i need? bc in the official spring guide theres not a word mentioned about gradle
dan1st
dan1st4mo ago
I don't think Gradle was that common with the Spring Boot version you are using Also you likely won't find recent guides for that version because it's outdated by a lot
bambyzas
bambyzasOP4mo ago
ok, nvm, i found smth: implementation 'org.springframework.ws:spring-ws:4.0.11' so what are the next steps?
dan1st
dan1st4mo ago
Are you sure this is for Spring Boot 2.2.6?
bambyzas
bambyzasOP4mo ago
can i have a controller, like REST services have? no idea. theres no info. i guess ill need to try and see 😦
dan1st
dan1st4mo ago
Can you use implementation 'org.springframework.ws:spring-ws' and let Spring Boot figure out the correct version?
bambyzas
bambyzasOP4mo ago
done so, maybe smb can help me out?
JavaBot
JavaBot4mo 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.
dan1st
dan1st4mo ago
Withtwhat exactly? What happens when writing the web service and how is that different from your expectations?
JavaBot
JavaBot4mo 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.
bambyzas
bambyzasOP4mo ago
wdym "what happens when writing the web service"?
dan1st
dan1st4mo ago
What's the issue you are encountering?
bambyzas
bambyzasOP4mo ago
i dont understand if i can have a controller, like rest webservices have? thats one of my questions
JavaBot
JavaBot4mo 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.
dan1st
dan1st4mo ago
I think so, yes though I only know Java EE's SOAP thingy
JavaBot
JavaBot4mo 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