Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to deal with same Service and Port name in CXF?
    primarykey
    data
    text
    <p>I am developing a CXF (2.2.7) web client to connect to web service that have the same Service and Port name in the WSDL. The client connects through SSL with private key and signs the message with the same private key. The SSL connection works through the "http:conduit" configuration. I am able to connect.</p> <p>I have problems with the spring config because the Service and Port name are the same and I don't know very well how to solve it. The normal/well-known way to configure the client would be:</p> <pre><code>&lt;jaxws:client name="{http://bla.com/1.2/}PortA" createdFromAPI="true"&gt;...&lt;/jaxws:client&gt; </code></pre> <p>However, when running this, I get the following error:</p> <pre><code>Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'bus' of bean class [org.apache.cxf.service.ServiceImpl]: Bean property 'bus' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? </code></pre> <p>This error is a well known error in case you use the "Service" name instead of the port name in the jaxws name attribute (ServiceA instead of PortA). However, in my case the service name and port name are the same :(... And it's not my wdsl so I can't change it... What happens is that the created jaxws:client bean is configured through autowiring by Spring, but uses the Spring definitions for the Port bean as it has the same name and these definitions are looked up through the name which is the same. The Port bean is an instance of type "org.apache.cxf.jaxws.JaxWsProxyFactoryBean" on which the bus can be set as property but not on ServiceImpl.</p> <p>Anyway: how best to deal with this? I tried using the "old-fashion" config way as described on the CXF site:</p> <pre><code>&lt;jaxws:client id="someId" serviceClass="TheServiceClass" address="https://bla.com/webservice"&gt; </code></pre> <p>However, that results in SSL errors, appearently the HTTP conduit config isn't automatically linked to my jaxws client config :(... And I don't really know how to deal with that. How to do this?</p> <p>At the moment I am not sure what is the best way to go? Might some renaming of the service/port possible (I am not a soap expert). Or use some other id that is used by Spring to lookup the bean defintion such that they are unique for the port and service, even if the names are the same?... Or do it the old fashion way, but then how ?? </p> <p>Please some help on this?</p> <p>Extra note: I got the "http:conduit" working with the old-fashion configuration by using a wild card in the name attribute. However the ws-securityPolicy isn't picked up automatically as done through the "well-know" configuration of the ... Such that the message isn't signed :(</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload