Hello,
I'm using Apach CXF 2.6.2. After deploying my service in Tomcat, I tried to
test it retrieving the WSDL from localhost:8080/sps?wsdl, and got this
stack trace:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'sps': Invocation of init method failed;
nested exception is javax.xml.ws.WebServiceException:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
bean named 'org.apache.cxf.binding.soap.SoapTransportFactory' is
defined
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
org.apache.cxf.transport.servlet.CXFServlet.createSpringContext(CXFServlet.java:146)
org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:72)
org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:67)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1805)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)
I found a suggestion to annotate the endpoint, which I did:
<jaxws:endpoint id="sps" implementor="com.rsa.pso.hartford.sps.HigspsImpl"
address="/sps" wsdlLocation="/WEB-INF/higsps.wsdl" />
Unfortunately, it didn't help me. Any suggestions? Thanks in advance.
My service interface is
@WebService(targetNamespace = "http://www.sample.com/sps/", name = "higsps")
@XmlSeeAlso({ObjectFactory.class})
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface Higsps {
...
}
The implementation class is annotated like this
@WebService(
serviceName = "sps",
portName = "higspsSOAP",
targetNamespace = "http://www.sample.com/sps/",
wsdlLocation = "/WEB-INF/higsps.wsdl",
endpointInterface = "com.rsa.pso.hartford.sps.Higsps")
public class HigspsImpl implements Higsps {
...
}
The cfx.xml configuration:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="http-client.xml" />
<jaxws:endpoint id="sps"
implementor="com.rsa.pso.hartford.sps.HigspsImpl" address="/sps"
wsdlLocation="/WEB-INF/higsps.wsdl" />
</beans>
And WSDL:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.example.com/sps/" xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" name="higsps" targetNamespace="
http://www.example.com/sps/">
<wsdl:types>
<xsd:schema targetNamespace="http://www.example.com/sps/">
<xsd:element name="artifactResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="spUrl" type="xsd:string" maxOccurs="1"
minOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="artifactRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="nameId" type="xsd:string"
maxOccurs="1" minOccurs="1">
</xsd:element>
<xsd:element name="spEntityId" type="xsd:string"
maxOccurs="1" minOccurs="0">
</xsd:element>
<xsd:element name="targetUrl" type="xsd:string"
maxOccurs="1" minOccurs="1">
</xsd:element>
<xsd:element name="attributes" type="tns:AttributeType"
maxOccurs="unbounded" minOccurs="0"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="SpsFaultType">
<xsd:sequence>
<xsd:element name="message" type="xsd:string"
maxOccurs="1" minOccurs="0">
</xsd:element>
<xsd:element name="code" type="xsd:int" maxOccurs="1"
minOccurs="1"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="AttributeType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"
maxOccurs="1" minOccurs="1">
</xsd:element>
<xsd:element name="value" type="xsd:string"
maxOccurs="1" minOccurs="0"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="artifactFault" type="tns:SpsFaultType">
</xsd:element>
<xsd:element name="artifactWithDefaultSpEntity">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in"
type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="artifactWithDefaultSpEntityResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="spUrl " type="xsd:string"
maxOccurs="1" minOccurs="1"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="artifactWithDefaultSpEntityRequest"
type="tns:ArtifactWithDefaultSpEntityType">
</xsd:element>
<xsd:complexType name="ArtifactWithDefaultSpEntityType">
<xsd:sequence>
<xsd:element name="nameId" type="xsd:string"
maxOccurs="1" minOccurs="1">
</xsd:element>
<xsd:element name="targetUrl" type="xsd:string"
maxOccurs="1" minOccurs="1">
</xsd:element>
<xsd:element name="attributes" type="tns:AttributeType"
maxOccurs="unbounded" minOccurs="0"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="artifactWithDefaultSpEntityFault"
type="tns:SpsFaultType">
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="artifactRequest">
<wsdl:part element="tns:artifactRequest" name="parameters" />
</wsdl:message>
<wsdl:message name="artifactResponse">
<wsdl:part element="tns:artifactResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="artifactFault">
<wsdl:part name="parameters" element="tns:artifactFault"></wsdl:part>
</wsdl:message>
<wsdl:message name="artifactWithDefaultSpEntityRequest">
<wsdl:part name="parameters"
element="tns:artifactWithDefaultSpEntityRequest">
</wsdl:part>
</wsdl:message>
<wsdl:message name="artifactWithDefaultSpEntityResponse">
<wsdl:part name="parameters"
element="tns:artifactWithDefaultSpEntityResponse"></wsdl:part>
</wsdl:message>
<wsdl:message name="artifactWithDefaultSpEntityFault">
<wsdl:part name="parameters"
element="tns:artifactWithDefaultSpEntityFault"></wsdl:part>
</wsdl:message>
<wsdl:portType name="higsps">
<wsdl:operation name="artifact">
<wsdl:input message="tns:artifactRequest"/>
<wsdl:output message="tns:artifactResponse"/>
<wsdl:fault name="fault"
message="tns:artifactFault"></wsdl:fault>
</wsdl:operation>
<wsdl:operation name="artifactWithDefaultSpEntity">
<wsdl:input
message="tns:artifactWithDefaultSpEntityRequest"></wsdl:input>
<wsdl:output
message="tns:artifactWithDefaultSpEntityResponse"></wsdl:output>
<wsdl:fault name="fault"
message="tns:artifactWithDefaultSpEntityFault"></wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="higspsSOAP" type="tns:higsps">
<soap:binding style="document" transport="
http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="artifact">
<soap:operation soapAction="http://www.thehartford.com/sps/artifact"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="sps">
<wsdl:port binding="tns:higspsSOAP" name="higspsSOAP">
<soap:address location="http://www.thehartfoed.com/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
--
Aaron Stromas