Watched today as part of upcoming project requirement this soap web services creation using SpringBoot Besant . Simple crisp and to the point explanation amd implementation. Thanks 🙂 !
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Mon Oct 05 05:28:06 IST 2020 There was an unexpected error (type=Not Found, status=404). No message available please help
Hi , Just like returning ResponseEntity in rest call to attach data in body. Is it possible the byte[] in soap api body. If yes how to define elements for the response in xsd file.
Java Techie I’m planning to write a microservice that take JSON as input and SOAP as output(an another application). Just checking whether we can use spring boot for that If we have such scenario, which one we can use?
Java Techie I want to call an endpoint with Soap request (XML). For this, need to create SOAP request first and then send to that endpoint. I tried to send the soap request as string with UniRest - getting result for this. But I’m not sure how to use rest template to send this Soap request
Please convert your request as XML string then follow below approach String xmlString = "123"; RestTemplate restTemplate = new RestTemplate(); //Create a list for the message converters List>(); //Add the String Message converter messageConverters.add(new StringHttpMessageConverter()); //Add the message converters to the restTemplate restTemplate.setMessageConverters(messageConverters); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_XML); HttpEntity request = new HttpEntity(xmlString, headers); final ResponseEntity response = restTemplate.postForEntity("localhost:8080/xml/availability", request, String.class);
@@Javatechie Hey I've tried to do it like in your video but when I do mvn install I have a build failure : Exception in thread "main" java.lang.Error: java.lang.reflect.InvocationTargetException at com.sun.tools.xjc.reader.Ring.get(Ring.java:113) The only thing I did different than in your video is that I added "jaxb2-maven-plugin" version 1.6 in my dependencies or I would get an error. Can you help please ? :)
Thank you for the tutorial, I have a question the generated JAR, is it possible to deploy in a embedded tomcat or I need to a dedicated server? Thanks if you can help me
Hi, I followed along for both the consumer and server side. What are the next steps to put this server online and use the consumer side to call it? Quite new to this. Any advice would be appreciated. Thanks!
@@Javatechie i looked into it abit and plan on deploying the server side using tomcat. Then i will try and use the consumer side application to call it.
Can we add another operation in the same wsdl? suppose customerRequest is you first operation , I need to add another xsd operation and it should not be a new wsdl but get added in the same customerRequest wsdl.
@@Javatechie can you please provide with any material or sample example. Also I was looking for same implementation as per your video and generate the multiple operations wsdl through java itself and not manually.
@Java Techie I got one issue here. This jaxb2-maven-plugin is causing issue in pom.xml. If i remove this then maven install is working fine. If i keep this plugin then maven update/install is giving TargetInvocation Exception . Any alternate solution please.
@@lakshmiprasad2105 it seems like there are some libraries missing in java 11, try to use java 8 and jaxb plugin version 1.6, make sure your env and pom configurations are matching with the one showed in video
Excellent video, wonderful, congratulations from Medellín-Colombia I just had a problem as I didn't get the option request in the soapUI program, I just got the port name in the left panel after start the soap test, but I didn't get the request element option there; later I found that I can't change the name CustomRequest and Acknowledgment in the xsd file. Thanks again for sharing your knowledge
@@Javatechie soap behavior is to display Fields in the response which are not bull but my use case needs Fields which are null also. I mean that field tag example this is null from my db.
Thanks for the video. This is the best video I saw on UA-cam on SAOP web services with Spring. Have a question. How do we assign our own short name the namespace? In your example you are getting “loan” in request and “ns2” but if I want “re” in request and “ns0” in response how do I do it? Thanks
Service URL ?WSDL Should open your WSDL in case spring security stop you to open it . Either pass username and password while opening WSDL or specify antmatchers in your spring security config class to ignore this perticular endpoint
@@Javatechie Exception in thread "main" java.lang.Error: java.lang.reflect.InvocationTargetException at com.sun.tools.xjc.reader.Ring.get(Ring.java:113) at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.(BGMBuilder.java:147) at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:117) at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:425) at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:174) at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:119) at com.sun.tools.xjc.Driver.run(Driver.java:333) at org.codehaus.mojo.jaxb2.AbstractXjcMojo.execute(AbstractXjcMojo.java:316) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289) at org.apache.maven.cli.MavenCli.main(MavenCli.java:193) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) at com.sun.tools.xjc.reader.Ring.get(Ring.java:102) ... 29 more Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException at com.sun.tools.xjc.reader.Ring.get(Ring.java:113) at com.sun.tools.xjc.reader.xmlschema.BindingComponent.getClassSelector(BindingComponent.java:65) at com.sun.tools.xjc.reader.xmlschema.ColorBinder.(ColorBinder.java:62) at com.sun.tools.xjc.reader.xmlschema.BindGreen.(BindGreen.java:63) ... 35 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) at com.sun.tools.xjc.reader.Ring.get(Ring.java:102) ... 38 more Caused by: java.lang.NoClassDefFoundError: javax/activation/MimeTypeParseException at java.base/java.lang.Class.getDeclaredConstructors0(Native Method) at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3215) at java.base/java.lang.Class.getConstructor0(Class.java:3420) at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2631) at com.sun.tools.xjc.reader.Ring.get(Ring.java:100) at com.sun.tools.xjc.reader.xmlschema.DefaultClassBinder.(DefaultClassBinder.java:98) at com.sun.tools.xjc.reader.xmlschema.ClassSelector.(ClassSelector.java:214) ... 44 more Caused by: java.lang.ClassNotFoundException: javax.activation.MimeTypeParseException at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239) ... 51 more Also I would like to highlight one thing that the default workspace which you are working is jdk 1.8.... but my default workspace is jre why is it so?? what can i do to change my default workspace from jre to jdk 1.8...?
Hi Java Techie , I have a question, in this example what do you explain could you have more than one web service(on the same project)? Would I have to build another endpoint and duplicate everything? could you guide me where to start? Thank you so much!
@Java Techie Hello Team, I get Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. When I try installing your code snippet. Any work around for this error ?
Thank you very much. Do you also have the 2nd approach? also the non-springboot SOAP? I have troubled setting up my JAVA EE for it. I love your video. Well-explained and easier to understand. I was able to follow. Subscribed your channel. I will check your other videos.
Hey Nova , Are you able to generate runtime WSDL ? If yes then try accessing with soap adress URL which you can find in bottom of your runtime WSDL file . If still issue not resolved please share your error stack to javatechie4u@gmail.com
Wonderful teaching. I love it . Question :- In my soap get api my requirement is to display the Fields which are Null from db . Lets say 5 out of 10 Fields are null when reading from DB . I need These 10 Fields in my soap api response pls help me . I tried to give default attribute but No luck.
Hi BrahmaSuresh , Thank you 😊 , as of now am not planning for any online training as am the single person parally working for an organisation and giving free tutorial in UA-cam
First, thanks for the tutorial. It helped a lot. I have a question... I'm implementing an soap endpoint in a existing springboot project, but i can't find my endpoint. It throws 404. Does it have anything more to config?
Hi, Thanks for the great material on this topic. I am getting the maven error when I used the JAXB plugin. FYI, I am using jdk1.8.0_221 version on SpringToolSuite 4. Error: (org.codehaus.mojo:jaxb2-maven-plugin:2.5.0:xjc:xjc:generate-sources) org.apache.maven.plugin.MojoExecutionException: at I even changed the jaxb version from 1.6 to other upper versions. It still is giving the same error. Can you please guide me on how to fix this error?
Hi Ananda If you still getting the same error event after you changed the jaxb2 to 1.6 try to install m2e connecter you will get by going to eclipse install software then writer m2e then select it on the below list of software there is m2e extension just select it and then continue , this one solved the problem for me even If use 2.5.0 version of jaxb2
Nice tutorial...!!! I have a question...how to publish web service page on the same port as server.port... I tried using endpoint.publish() but it publishes the endpoint on different port which make wsdl endpoint different then actual service endpoint due to different ports
Exelent tutorial and I have start learning 2 days ago and after watching this I have got a grip on soap web service though I faced some issues while configuring the pom and xsd. After some hours of extensive searching I figured out the problem and fixed it. The people who are watching in 2023 and after that may face the same problem and for that I will provide the solve here. While configuring the jaxb2-maven-plugin version 2.4 (version 1.6 was not working for higher spring version) in pom after creating the xsd file in class path resource the tag will get a red under line if when I tried to run "mvn clean install" from terminal this error has appear "Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.4:xjc (xjc ) on project SpringSoapTest: : MojoExecutionException: NoSchemasException ". Also got problem while updating maven. In this case the the cause of the exception is that the spring was unable to find the .xsd file in class path resources. In order to fix that (for jaxb2-maven-plugin version 2.x & 3.x) I made some change inside used "source>${project.basedir}/src/main/resources/xsd" instead of "${project.basedir}/src/main/resources/" ( for more details please refer to this document spring.io/guides/gs/producing-web-service/). After doing this I was able to complete the building with out any exception. Hopes it will help others.
HI, i have tried this example in java 11, but when calling the soap services i get the following error "Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?" Can anyone help?
Hello , greetings from Mexico. Very good video. I was wondering if you can tell me which WS development methods is better, first approach or last approach?, since I have seen most of videos shows first approach. Regards
Hi Carlos , glad to have a viewers from Mexico 😀 Contract first approach is always good if it is scratch level development else we should go for contract last approach
@@Javatechie thank you for your quick answer !. I was digging in to last contract approach and in some post I discovered Spring boot is does not accept last contract approach.. is this correct?, should we go with JAX-WS and CXF instead?
hi Java Techie, when i run the application with Eclipse runs fine but when i runned on Tomcat Standalone doesnt work, here is my WSDL. Please can you help me?
@@AlbertoOcando spring boot by default support tomcat 8.5 If you want to work with tomcat 7 then you must have to add below dependency org.apache.tomcat tomcat-juli ${tomcat.version}
Hey very good tutorial about Soap with Spring Boot! and I was wondering is it very diffcult to add authentication headers? a simple one just with a user and a password because I have looked a lot and there is not a clear example how to do this, any ideas will be very appreciate!
@@Javatechie Yes! It would be great! If you have the time can you share the link please? I've been struggling for quite a long time and yours are among the best tutorials there are
@@Javatechie I looked the projects you have in git hub and I end up really impressed because you do have a lot of projects about very variety of topics very well done sir! But I was not able to find an example of implementation of headers in web services with spring boot : / help man
Perfect tutorial. Thank you JT. :) but i have a question, how can i add another XSD to project / what is needed to do, when i want to extend wsdl and add another services (what is needed to do with beans? ) thank you.
After exploring 10 video...finally i found correct video to learn soap. Best soap tutorial thanks
One of the best SOAP tutorial, Tnx!!!
Watched today as part of upcoming project requirement this soap web services creation using SpringBoot Besant . Simple crisp and to the point explanation amd implementation. Thanks 🙂 !
Detailed and easy to understand explanation on SOAP WS. Thank you!!
Great video, short, simple, and easy to understand and follow.
the best video so far on SOAP, can't believe i found it this late !!! Great work sir
awesome video thank u Java Techie now my wsdl concept clear
This was very clear and helpful. Thanks a ton.
One of the best video for beginner's. Thanks a lot 😀
For sure ! One of the best SOAP tutorial on the web, regards from Brazil brow ! Keep doing the excellent job
Thank you Oliveira 😄 glad to hear this from you 👍
Thanks Sir Great knowledge and great video keep post these kind of videos
Explained in understanding way but need juint for these classes
Very well explained and a complete tutorial, Thanks a lot
Very well explained, Thank you so much. I really appreciate your work!!!
Thanq sir,for simple and clear manner.sir if possible plz make more videos on Soap ws.
Hi thanks , yes will upload
Thank you so much for this Tutorial, it helped me build my first ever SOAP Web Service.
Cool 😄👍🏻
Thank you for this perfect tutorial
Good going java techie
Very well explained...!! Thanks @JavaTechie
Perfect video... Thanks for the good work.
Excellent
appreciate your effort
Java classes is not generated following all your steps using xsd.
I don't know why?
did u solved it?
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Oct 05 05:28:06 IST 2020
There was an unexpected error (type=Not Found, status=404).
No message available
please help
Please check the url and try
It was so well explained........can you upload a tutorial which implements test case for the same.....?
Super, Guys one thing is to be noted here is that not a single thumbs down for this video
Hi ILuv , It's all you guys support.thanks all
Thank you clear explanation.
Hi ,
Just like returning ResponseEntity in rest call to attach data in body. Is it possible the byte[] in soap api body. If yes how to define elements for the response in xsd file.
I don't have much exposure to soap buddy can't answer at this moment
@@Javatechie Thanks
If we want to create spring boot app that accept JSON and give a WSDL as output. is that contract last? Can you please help?
No I don't think it's possible .did you came accross such scenario ever ?
Java Techie I’m planning to write a microservice that take JSON as input and SOAP as output(an another application). Just checking whether we can use spring boot for that
If we have such scenario, which one we can use?
SOAP as output as means you are expecting to return XML as response or from Rest endpoint you want to call soap webservices?
Java Techie I want to call an endpoint with Soap request (XML). For this, need to create SOAP request first and then send to that endpoint.
I tried to send the soap request as string with UniRest - getting result for this. But I’m not sure how to use rest template to send this Soap request
Please convert your request as XML string then follow below approach
String xmlString = "123";
RestTemplate restTemplate = new RestTemplate();
//Create a list for the message converters
List>();
//Add the String Message converter
messageConverters.add(new StringHttpMessageConverter());
//Add the message converters to the restTemplate
restTemplate.setMessageConverters(messageConverters);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_XML);
HttpEntity request = new HttpEntity(xmlString, headers);
final ResponseEntity response = restTemplate.postForEntity("localhost:8080/xml/availability", request, String.class);
In intellij, how can we create xml schema definition file? and how can I generate Java class from xml schema in iNTELLIJ?
Add xjc plugin in your pom.xml
@@Javatechie Hey I've tried to do it like in your video but when I do mvn install I have a build failure :
Exception in thread "main" java.lang.Error: java.lang.reflect.InvocationTargetException
at com.sun.tools.xjc.reader.Ring.get(Ring.java:113)
The only thing I did different than in your video is that I added "jaxb2-maven-plugin" version 1.6 in my dependencies or I would get an error. Can you help please ? :)
@@TheMahu13 please check compatible version and add it .
how to consume the same service from a client spring boot application Sir .. could you please give suggestion ????
Consumer application already uploaded please search in my channel
Thank you for the tutorial, I have a question the generated JAR, is it possible to deploy in a embedded tomcat or I need to a dedicated server? Thanks if you can help me
You can deploy it in both embedded server as well as external server
Any implementation with attachments will be helpful
Hi, I followed along for both the consumer and server side. What are the next steps to put this server online and use the consumer side to call it? Quite new to this. Any advice would be appreciated. Thanks!
Online means you want to deploy it to any cloud or what you are looking for?
@@Javatechie i looked into it abit and plan on deploying the server side using tomcat. Then i will try and use the consumer side application to call it.
@@jiehuisim3699 yes that's what I did with embedded tomcat
@@Javatechie so after i mvn install and can go to the localhost that shows the wsdl, i can set up the consumer side and call the server side?
Can we add another operation in the same wsdl? suppose customerRequest is you first operation , I need to add another xsd operation and it should not be a new wsdl but get added in the same customerRequest wsdl.
Yes we can add for that you need to change all component in wsdl file
@@Javatechie can you please provide with any material or sample example. Also I was looking for same implementation as per your video and generate the multiple operations wsdl through java itself and not manually.
@Java Techie I got one issue here. This jaxb2-maven-plugin is causing issue in pom.xml. If i remove this then maven install is working fine. If i keep this plugin then maven update/install is giving TargetInvocation Exception . Any alternate solution please.
what is the java version you are using?
@@maxit007 Java 11
@@lakshmiprasad2105 it seems like there are some libraries missing in java 11, try to use java 8 and jaxb plugin version 1.6, make sure your env and pom configurations are matching with the one showed in video
Excellent video content.
Thank you very much, clean work!
Thanks a lot ..gradle also its working .
Thank you by this great video!
Very Nicely explained Man, Thanks !!!
Excellent video, wonderful, congratulations from Medellín-Colombia
I just had a problem as I didn't get the option request in the soapUI program, I just got the port name in the left panel after start the soap test, but I didn't get the request element option there; later I found that I can't change the name CustomRequest and Acknowledgment in the xsd file.
Thanks again for sharing your knowledge
Very good content 👍.It would be good if the screen was zoomed to see more visible text of the code...
Thanks for it, do you have an example for multiple xsds . I am having trouble loading multiple xsds
No I don't have but same way you can import
I have tried with existing project, but having exceptions
Please copy paste error stack
Thanks you such wonderful video...but I have question can I generate xsd file from soap endpoint class
Yes we can create java to wsdl file . Then from wsdl file just copy the types section and copy that to in xsd file .
Super bro ,i am using same one for my ms
Thanks , superb video.. can i know how i can use xjc in gradle ?
Gradle i haven't tried
Superb video. Please upload video for producing webservices using REST
Also tried with nullable=true but it Prints schema in the fields tag. Please help me on this.
You want to display null field or not null?
@@Javatechie null Fields
Can't you add this validation in service impl before building response
@@Javatechie soap behavior is to display Fields in the response which are not bull but my use case needs Fields which are null also. I mean that field tag example this is null from my db.
@@Javatechie i googled it but no such examples.
Thanks for the video. This is the best video I saw on UA-cam on SAOP web services with Spring.
Have a question. How do we assign our own short name the namespace? In your example you are getting “loan” in request and “ns2” but if I want “re” in request and “ns0” in response how do I do it? Thanks
You can specify that in your xsd itself
Hi Sir, Please reply me - How to allow soap endpoint for opening my wsdl file in browser with spring boot+spring security ?
Service URL ?WSDL
Should open your WSDL in case spring security stop you to open it .
Either pass username and password while opening WSDL or specify antmatchers in your spring security config class to ignore this perticular endpoint
I am getting target incovation exception error while updating project............any solution???
Can you please paste your error
@@Javatechie Exception in thread "main" java.lang.Error: java.lang.reflect.InvocationTargetException
at com.sun.tools.xjc.reader.Ring.get(Ring.java:113)
at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.(BGMBuilder.java:147)
at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:117)
at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:425)
at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:174)
at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:119)
at com.sun.tools.xjc.Driver.run(Driver.java:333)
at org.codehaus.mojo.jaxb2.AbstractXjcMojo.execute(AbstractXjcMojo.java:316)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at com.sun.tools.xjc.reader.Ring.get(Ring.java:102)
... 29 more
Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
at com.sun.tools.xjc.reader.Ring.get(Ring.java:113)
at com.sun.tools.xjc.reader.xmlschema.BindingComponent.getClassSelector(BindingComponent.java:65)
at com.sun.tools.xjc.reader.xmlschema.ColorBinder.(ColorBinder.java:62)
at com.sun.tools.xjc.reader.xmlschema.BindGreen.(BindGreen.java:63)
... 35 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at com.sun.tools.xjc.reader.Ring.get(Ring.java:102)
... 38 more
Caused by: java.lang.NoClassDefFoundError: javax/activation/MimeTypeParseException
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3215)
at java.base/java.lang.Class.getConstructor0(Class.java:3420)
at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2631)
at com.sun.tools.xjc.reader.Ring.get(Ring.java:100)
at com.sun.tools.xjc.reader.xmlschema.DefaultClassBinder.(DefaultClassBinder.java:98)
at com.sun.tools.xjc.reader.xmlschema.ClassSelector.(ClassSelector.java:214)
... 44 more
Caused by: java.lang.ClassNotFoundException: javax.activation.MimeTypeParseException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 51 more
Also I would like to highlight one thing that the default workspace which you are working is jdk 1.8....
but my default workspace is jre why is it so?? what can i do to change my default workspace from jre to jdk 1.8...?
Ok...I got the solution for this error...
but please can u write a test case for the same web service...?
@@dipteshkarle2521 what is the solution?
hello for the latest version of this plugin-jaxb2-maven-plugin, how to specify because the old configuration does not work
Yes it won't work if you are using the Java version greater than 9 then Jax b library is not available you need to explicitly add it .
FYI can you please share your source code
@@Javatechie could you please help me in the scenario where I already have wsdl file along with xsd files and want to expose endpoint
@@AlokKumar-ot9sx buddy you need to generate bindings classes and services through the plugins
@@Javatechie ok thanks sir
Cannot we use postman for testing instead of soap ui
Hi Java Techie ,
I have a question, in this example what do you explain could you have more than one web service(on the same project)? Would I have to build another endpoint and duplicate everything? could you guide me where to start? Thank you so much!
Asante, Swahili word for thank you
Very Good 🙂
@Java Techie Hello Team, I get Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback. When I try installing your code snippet. Any work around for this error ?
Give the proper URL
localhost:port/application/wsdlname?wsdl
Please do as I did
had the same issue , you need to align the package names such that: com.xxx.spring.soap.api , com.xxx.spring.soap.api.config , etc.
Abhinav I believe always I followed PKG hierarchy that's why if you notice my any spring boot video am not using @ComponentScan
@@Javatechie Yes sir , it was my mistake :) , since i was using start.spring.io/ and used the default package name that was generated.
M not getting response when trying to test in soap ui, what may cause? pls suggest
Any error message or fault
Thank you very much. Do you also have the 2nd approach? also the non-springboot SOAP? I have troubled setting up my JAVA EE for it. I love your video. Well-explained and easier to understand. I was able to follow. Subscribed your channel. I will check your other videos.
Cool . Keep learning buddy 😊
@@Javatechie Thanks so much. I hope you also have Java design Patttern pls? I find it hard to understand most of it. 😞
Getting 404! Checked all the configurations. They are proper. Unable to figure out why :(
Hey Nova ,
Are you able to generate runtime WSDL ?
If yes then try accessing with soap adress URL which you can find in bottom of your runtime WSDL file .
If still issue not resolved please share your error stack to javatechie4u@gmail.com
How to pass List of object from SOAP UI as post request and how to handle it at server(Endpoint) level ??
In server side you need to prepare the request structure .
Basically in WSDL xsd file you need to specify minaocurs and max occurs
Grt Tutorial. Thanks!! One question If I already have WSDL with me, how can it be used to generate the SOAP WS?
You want to generate client or you are talking about contract first approach ?
@@Javatechie contract first approach
Superb
Wonderful teaching. I love it . Question :- In my soap get api my requirement is to display the Fields which are Null from db . Lets say 5 out of 10 Fields are null when reading from DB . I need These 10 Fields in my soap api response pls help me . I tried to give default attribute but No luck.
Can’t you validate if field is not null then ignore it
Could you please make a video on CORBA communication
It's already deprecated buddy
Hi Team, it was very nice tutorial. Are you providing any online training. Please reply we will discuss.
Hi BrahmaSuresh ,
Thank you 😊 , as of now am not planning for any online training as am the single person parally working for an organisation and giving free tutorial in UA-cam
Sir Very good
First, thanks for the tutorial. It helped a lot.
I have a question... I'm implementing an soap endpoint in a existing springboot project, but i can't find my endpoint. It throws 404. Does it have anything more to config?
You should add elements in your WSDL file , types, message,port type , binding everything you need to refactor as per your requirement
@@Javatechie I made all the WSDL definition. the url "/ws/foo.wsdl" this foo is the DefaultWsdl11Definition bean name?
Did you mention your new endpoint in operation element
super bhai..., but I want to know spring boot uses which implantation internally for SOAP services.
Jaxws
Thanks you. Great Job.
Does the soap web server created using spring boot support multi threading? Can this handle multiple concurrent API requests?
can you do video for soap 1.2version
Very helpful
Hi, Thanks for the great material on this topic. I am getting the maven error when I used the JAXB plugin. FYI, I am using jdk1.8.0_221 version on SpringToolSuite 4. Error: (org.codehaus.mojo:jaxb2-maven-plugin:2.5.0:xjc:xjc:generate-sources) org.apache.maven.plugin.MojoExecutionException: at
I even changed the jaxb version from 1.6 to other upper versions. It still is giving the same error.
Can you please guide me on how to fix this error?
Hi Ananda
If you still getting the same error event after you changed the jaxb2 to 1.6
try to install m2e connecter you will get by going to eclipse install software then writer m2e then select it on the below list of software there is m2e extension just select it and then continue , this one solved the problem for me even If use 2.5.0 version of jaxb2
@@mohmedyususf84 thanks for the suggestions. I tried with eclipse and it worked.
@@mohmedyususf84 thank you very much for sharing. Finally solved my issue. :)
I am getting MimeTypeParseException, don't know where to proceed
Please share any git project on the last contract
Nice tutorial...!!! I have a question...how to publish web service page on the same port as server.port... I tried using endpoint.publish() but it publishes the endpoint on different port which make wsdl endpoint different then actual service endpoint due to different ports
What approach you are using contract first or last ?
If it is contract first then in wsdl file service you need to pass server.port url
Java Techie yes it is contract first...I understood that we have to pass server.port...Do you have a sample application of where and how to pass?
I cloned your repo and getting 404 when I hit the wsdl url in browser. Any config I need to perform?
Exelent tutorial and I have start learning 2 days ago and after watching this I have got a grip on soap web service though I faced some issues while configuring the pom and xsd. After some hours of extensive searching I figured out the problem and fixed it.
The people who are watching in 2023 and after that may face the same problem and for that I will provide the solve here.
While configuring the jaxb2-maven-plugin version 2.4 (version 1.6 was not working for higher spring version) in pom after creating the xsd file in class path resource the
tag will get a red under line if when I tried to run "mvn clean install" from terminal this error has appear "Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.4:xjc (xjc
) on project SpringSoapTest: : MojoExecutionException: NoSchemasException ". Also got problem while updating maven.
In this case the the cause of the exception is that the spring was unable to find the .xsd file in class path resources.
In order to fix that (for jaxb2-maven-plugin version 2.x & 3.x) I made some change inside used "source>${project.basedir}/src/main/resources/xsd" instead of "${project.basedir}/src/main/resources/"
( for more details please refer to this document spring.io/guides/gs/producing-web-service/).
After doing this I was able to complete the building with out any exception.
Hopes it will help others.
Thanks buddy for the update ☺️ . Keep learning 👍
Hi, How can i get wsdl for a xsd having another import xsd inside it
HI, i have tried this example in java 11, but when calling the soap services i get the following error "Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?"
Can anyone help?
did you got the solution for this
How to add soap headers ? Please reply to my question. I didn't find solution.
Sir Wander full
superb
Great video thx
Sir I buy An APi from zong SMS Service I want to bind in my spring boot project YOu can help me
Share me the documentation link so that I can check
Hi... Can you please explain how to consume soap services in rest API
Man please search its already there in my channel
ua-cam.com/video/WJg3NUwq6zU/v-deo.html
What we need to check if schema did generate the classes
Hi Java Techie , Is there a way that I can change default SOAP-ENV and ns2
Hello , greetings from Mexico. Very good video. I was wondering if you can tell me which WS development methods is better, first approach or last approach?, since I have seen most of videos shows first approach. Regards
Hi Carlos , glad to have a viewers from Mexico 😀
Contract first approach is always good if it is scratch level development else we should go for contract last approach
@@Javatechie thank you for your quick answer !. I was digging in to last contract approach and in some post I discovered Spring boot is does not accept last contract approach.. is this correct?, should we go with JAX-WS and CXF instead?
Am not sure whether it support in spring boot or not let me check once
@@Javatechie Thank you I will appreciated
@@Javatechie hi friend, sorry. To disturb you, did you find something?
hi Java Techie, when i run the application with Eclipse runs fine but when i runned on Tomcat Standalone doesnt work, here is my WSDL. Please can you help me?
What exception you are getting?
@@Javatechie 404 error :(
@@Javatechie im using tomcat 7.0.94. do you think that the tomcat version can be the problem?
@@AlbertoOcando spring boot by default support tomcat 8.5
If you want to work with tomcat 7 then you must have to add below dependency
org.apache.tomcat
tomcat-juli
${tomcat.version}
@@Javatechie thanks man, i will try to update the Tomcat
Hey very good tutorial about Soap with Spring Boot! and I was wondering is it very diffcult to add authentication headers? a simple one just with a user and a password because I have looked a lot and there is not a clear example how to do this, any ideas will be very appreciate!
Yes I created one poc for soap.authentication if you want I can share GitHub link
@@Javatechie Yes! It would be great! If you have the time can you share the link please? I've been struggling for quite a long time and yours are among the best tutorials there are
@@Javatechie I looked the projects you have in git hub and I end up really impressed because you do have a lot of projects about very variety of topics very well done sir! But I was not able to find an example of implementation of headers in web services with spring boot : / help man
Awesome Bro
Send restful webservices videos also
Already uploaded Ganesh , But will upload jax Rs RestFul webservice video
Hi Sir, Code is running but java classes are not created
Check wsdl to java plugin and force update your project
LoanEligibilityService cannot be resolved to a type how to resolve this error
Can u explain with Soap header ??
Please put this video as first item in the playlist "Soap WebServices"
Hi Java Techie, can you receive a list of object on the request? We need to change the xml? can you help me with that?
List of object you want to pass as part of request
@@Javatechie exactly! how can i do that?
@@Javatechie can you help me with that? receive list of customerRequest can you give me a example ? pliiis :(
@@AlbertoOcando can you share your wsdl ? Do that I can help you out
Perfect tutorial.
Thank you JT. :)
but i have a question, how can i add another XSD to project / what is needed to do, when i want to extend wsdl and add another services (what is needed to do with beans? ) thank you.
Did you get any solution for your question?