
Originally Posted by
bmelloni
For anyone who might read this thread...
In the end I did not need to download Spring Web Services to consume web services. Spring 2.5.6 supplied most of what I neeed.
I found wsimport in my path (I am guessing from Java 6) and it generated the classes needed.
I did need some additional JARs to satisfy dependencies. One was saaj-impl-1.3.2.jar. I believe there were other dependencies but they were satisfied by JARs that I already had in my classpath.
I hope this helps the next person that hits this wall.
Hi,
I experience the same problem. Using the same webservice as in the head of this topic...:
I would like to access the Webservice from a Spring-managed bean like this:
Code:
@WebServiceRef(wsdlLocation=" http://www.webservicex.com/ValidateEmail.asmx?WSDL")
private ValidateEmail service;
I imported the wsdl:
Code:
wsimport -target 2.1 -p com.ws -s src/main/java/ -extension -Xnocompile http://www.webservicex.com/ValidateEmail.asmx?WSDL
During deployment I receive this exception:
Code:
ERROR - ContextLoader.initWebApplicationContext(220) | Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'emailDao': Injection of resource dependencies failed; nested exception is com.sun.xml.internal.ws.model.RuntimeModelerException: A WebService annotation is not present on class: com.ws.ValidateEmail
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:300)
...
Caused by: com.sun.xml.internal.ws.model.RuntimeModelerException: A WebService annotation is not present on class: com.ws.ValidateEmail
at com.sun.xml.internal.ws.model.RuntimeModeler.getPortTypeName(Unknown Source)
I checked the generated class, and it really lacks the @WebService annotation and starts like this:
Code:
@WebServiceClient(name = "ValidateEmail", targetNamespace = "http://www.webservicex.net", wsdlLocation = "http://www.webservicex.com/ValidateEmail.asmx?WSDL")
public class ValidateEmail
extends Service
I received during wsimporting a number of warnings...:
Code:
parsing WSDL...
[WARNING] SOAP port "ValidateEmailSoap12": uses a non-standard SOAP 1.2 binding.
line 113 of http://www.webservicex.com/ValidateEmail.asmx?WSDL
[WARNING] port "ValidateEmailHttpGet" is not a SOAP port, it has no soap:address
line 116 of http://www.webservicex.com/ValidateEmail.asmx?WSDL
[WARNING] port "ValidateEmailHttpGet": not a standard SOAP port. The generated a
rtifacts may not work with JAXWS runtime.
line 116 of http://www.webservicex.com/ValidateEmail.asmx?WSDL
[WARNING] port "ValidateEmailHttpPost" is not a SOAP port, it has no soap:addres
s
line 119 of http://www.webservicex.com/ValidateEmail.asmx?WSDL
[WARNING] port "ValidateEmailHttpPost": not a standard SOAP port. The generated
artifacts may not work with JAXWS runtime.
line 119 of http://www.webservicex.com/ValidateEmail.asmx?WSDL
generating code...
If I use ValidateEmailSoap, I receive:
Code:
@WebServiceRef(wsdlLocation=" http://www.webservicex.com/ValidateEmail.asmx?WSDL", type=ValidateEmail.class)
private ValidateEmailSoap service;
Code:
Caused by: java.lang.IllegalStateException: Specified field type [interface com.ws.ValidateEmailSoap] is incompatible with resource type [com.ws.ValidateEmail]
I use JDK 1.6.0_21 with JAX-WS RI 2.1.6 and Spring 3.0.3.RELEASE.
Any hints what could be the solution here?
br.:
Richi