java - Issue running CXF JAX WS Service -
i have exposed web service using cxf jaxws service via http outbound.
given below syntax of end-point declaration mule config.
<http:inbound-endpoint address="http://localhost:8080/helloservice" exchange-pattern="request-response"> <cxf:jaxws-service serviceclass="com.example.service.helloserviceimpl" wsdllocation="wsdl/helloservice.wsdl" namespace="http://example.org/helloservice" port="helloserviceport" service="helloservice" >
but no working. gives below error when tried run on mule server.
2013-04-08 16:34:35,252 error [main] mule.muleserver (muleserver.java:474) - ******************************************************************************** * fatal error has occurred while server running: * * not find definition port * * {http://service.example.com/}helloserviceimplport. * * (org.apache.cxf.service.factory.serviceconstructionexception) * * * * error fatal, system shutdown * ********************************************************************************
it looking different port have mentioned in service endpoint declaration.
please me understand, issue is.
given below wsdl of service.
i have created wsdl , generated code using wsdl2java of cfx. implemented service interface operations. configured service in mule flow.
<?xml version="1.0" encoding="utf-8" standalone="no"?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://example.org/helloservice" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/xmlschema" name="helloservice" targetnamespace="http://example.org/helloservice" xmlns:per="http://example.org/helloservice/person" xmlns:comp="http://example.org/helloservice/company" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" > <wsdl:types> <xsd:schema targetnamespace="http://example.org/helloservice/company" > <xsd:include schemalocation="company.xsd" ></xsd:include> </xsd:schema> <xsd:schema targetnamespace="http://example.org/helloservice/person"> <xsd:include schemalocation="person.xsd" ></xsd:include> </xsd:schema> </wsdl:types> <wsdl:message name="addcompanyrequest"> <wsdl:part element="comp:company" name="company"/> </wsdl:message> <wsdl:message name="addpersonrequest"> <wsdl:part element="per:person" name="person"/> </wsdl:message> <wsdl:message name="addcompanyresponse"> <wsdl:part element="comp:compresponse" name="response"/> </wsdl:message> <wsdl:message name="addpersonresponse"> <wsdl:part element="per:perresponse" name="response"/> </wsdl:message> <wsdl:porttype name="helloservice"> <wsdl:operation name="addcompany"> <wsdl:input message="tns:addcompanyrequest" name="addcompanyrequest" /> <wsdl:output message="tns:addcompanyresponse" name="addcompanyresponse" /> </wsdl:operation> <wsdl:operation name="addperson"> <wsdl:input message="tns:addpersonrequest" name="addpersonrequest" /> <wsdl:output message="tns:addpersonresponse" name="addpersonresponse" /> </wsdl:operation> </wsdl:porttype> <wsdl:binding name="helloservicesoap" type="tns:helloservice"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="addcompany"> <soap:operation soapaction="" style="document" /> <wsdl:input name="addcompanyrequest"> <soap:body use="literal"/> </wsdl:input> <wsdl:output name="addcompanyresponse"> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="addperson"> <soap:operation soapaction="" style="document" /> <wsdl:input name="addpersonrequest"> <soap:body use="literal"/> </wsdl:input> <wsdl:output name="addpersonresponse"> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="helloservice"> <wsdl:port binding="tns:helloservicesoap" name="helloserviceport"> <soap:address location="http://localhost:8080/helloservice"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
i have absolutely no problem configuring cxf:jaxws-service
port
attribute, think issue in configuration.
for instance, error says cxf looking {http://service.example.com}helloserviceimplport
surprisingly you're configuring service namespace http://example.org/helloservice
. though doesn't need consistent, is.
looking @ wsdl, things seem correct guess @webservice
annotation on helloserviceimpl.class
contains funky values.
it should be:
@webservice(endpointinterface = "...interface class...", targetnamespace = "http://example.org/helloservice", servicename = "helloservice", portname = "helloserviceport", wsdllocation = "wsdl/helloservice.wsdl")
note configured @webservice
, need in mule xml config:
<cxf:jaxws-service serviceclass="com.example.service.helloserviceimpl" />
Comments
Post a Comment