You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by tvaughan77 <tv...@gmail.com> on 2013/10/09 20:34:23 UTC

Re: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for port...

I know this thread is a couple years old, but I ran in to the same issue
today after doing an upgrade of our maven CXF plugin from 2.2.3 to 2.7.0

Suddenly, our runtime web service communications with a remote ExactTarget
(mail campaign) service stopped working.  The error was 

> Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
> Could not find definition for port
> {http://exacttarget.com/wsdl/partnerAPI}SoapPort.
> 	at
> org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:146)
> 	at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:412)
> 	at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:534)
> 	at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:248)
> 	at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:205)
> 	at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
> 	at
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:90)
> 	at
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:156)
> 	at
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:156)

The WSDL is this one: https://webservice.s4.exacttarget.com/etframework.wsdl
(Quoting the good bits here for posterity in case that URL dies in the
future):

> WSDL Snippet: 
> <service name="PartnerAPI">
>     
> <documentation>
> ExactTarget Partner API
> </documentation>
>     
> <port binding="tns:SoapBinding" name="Soap">
>         
> <soap:address
> location="https://webservice.s4.exacttarget.com/Service.asmx"/>
>     
> </port>
> </service>

So it appears at some point the algorithm to discover what endpoint name to
use changed from just using the name of the element (e.g. "Soap") to the
concatenation of the name + the element type (e.g. "SoapPort")??

By changing our spring configuration to include an explicit "endpointName"
property in the JaxWsProxyFactoryBean it appears to have resolved our issue
(at the surface at least):

> <bean id="exactTargetProxyFactoryBean"
> class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
>     
> <property name="serviceClass" value="com.exacttarget.wsdl.partnerapi.Soap"
> />
>     
> <property name="wsdlURL"
> value="${email.exactTarget.wsdl:https://webservice.s4.exacttarget.com/etframework.wsdl}"
> />
>     
> <property name="serviceName">
>         
> <bean id="serviceName" class="javax.xml.namespace.QName">
>             
> <constructor-arg index="0" value="http://exacttarget.com/wsdl/partnerAPI"
> />
>             
> <constructor-arg index="1" value="PartnerAPI" />
>         
> </bean>
>     
> </property>
>     
>     ***** ADDED THIS PROPERTY **** 
>     
> <property name="endpointName">
>         
> <bean id="endpointName" class="javax.xml.namespace.QName">
>             
> <constructor-arg index="0" value="http://exacttarget.com/wsdl/partnerAPI"
> />
>             
> <constructor-arg index="1" value="Soap" />
>         
> </bean>
>     
> </property>
>     
> <property name="address"
> value="${email.exactTarget.endpoint:https://webservice.s4.exacttarget.com/Service.asmx}"
> />
> </bean>





--
View this message in context: http://cxf.547215.n5.nabble.com/org-apache-cxf-service-factory-ServiceConstructionException-Could-not-find-definition-for-port-tp4376704p5734875.html
Sent from the cxf-user mailing list archive at Nabble.com.