You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Karl Schmeing <ka...@yahoo.de> on 2009/09/15 10:58:13 UTC

WSSE and Client Annotations in CXF 2.2.3

Hi,

i am using WSSE with authentication and encryption.


Therefore I configured my clientApplication.xml

<bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
        <property name="serviceClass" value="demo.spring.ProductServiceImpl" />
        
        <property name="outInterceptors">
            <list>
                <bean class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor" />
                <ref bean="wss4jOutConfiguration" />
            </list>
        </property>
        <property name="inInterceptors">
            <list>
                <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
                <ref bean="wss4jInConfiguration" />
            </list>
        </property>
    </bean>


When I use wsdl2java I get a client.



@WebServiceClient(name = "ProductServicesBLA", 
                  wsdlLocation = "file:/Users/karlschmeing/Documents/workspace/cxf-webservices/src/b2b-bla-productservicesbla.wsdl",
                  targetNamespace = "http://www.server.de/b2b/contract/bla/productservicesbla_v01_00") 

public class ProductServicesBLA_Service extends Service {

    public final static URL WSDL_LOCATION;
    public final static QName SERVICE = new QName("http://www.server.de/locationname", "ProductServicesBLA");
    public final static QName ProductServicesBLAPort = new QName("http://http://www.server.de/locationname", "ProductServicesBLA");
    static {
        URL url = null;
        try {
            url = new URL("file:/Users/karlschmeing/Documents/workspace/cxf-webservices/src/b2b-bla-productservicestbla.wsdl");
        } catch (MalformedURLException e) {
            System.err.println("Can not initialize the default wsdl from file:/Users/karlschmeing/Documents/workspace/cxf-webservices/src/b2b-bla-productservicesbla.wsdl");
            // e.printStackTrace();
        }
        WSDL_LOCATION = url;
    }

    public ProductServicesBLA_Service(URL wsdlLocation) {
        super(wsdlLocation, SERVICE);
    }

How can i integrate the WebServiceClient into the Spring configuration? Is it possible to annotate the in and out interceptor?

Regards,

Ralf Josephy



      

Re: WSSE and Client Annotations in CXF 2.2.3

Posted by Ralf Josephy <ra...@cybercon.de>.
http://xfire.codehaus.org/JSR+181+Annotations ?

Ralf


Am 16.09.2009 um 09:04 schrieb Ralf Josephy:

> Thx
>
> Ralf
>
> P.S. I guess, it's jaxws:outInterceptors and jaxws:inInterceptors
>
>
> Am 16.09.2009 um 04:33 schrieb Daniel Kulp:
>
>>
>>
>> You really have two options:
>>
>> 1) Create a cxf.xml file that defines a jaxws:client bean with
>> a) createdFromAPI attribute set to true
>> b) the "id" set to the qname of the endpoint in the wsdl
>> In this case, you can configure the interceptors and such on the  
>> client using
>> the properties on the jaxws:client element.
>>
>> 2)  Programmatically: see:
>>  http://cxf.apache.org/docs/jax-ws-configuration.html
>> The section entitled: Configuring an Endpoint/Client Proxy Using  
>> CXF APIs
>>
>>
>> Dan
>>
>>
>>
>>
>> On Tue September 15 2009 4:58:13 am Karl Schmeing wrote:
>>> Hi,
>>>
>>> i am using WSSE with authentication and encryption.
>>>
>>>
>>> Therefore I configured my clientApplication.xml
>>>
>>> <bean id="clientFactory"
>>> class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"> <property
>>> name="serviceClass" value="demo.spring.ProductServiceImpl" />
>>>
>>>       <property name="outInterceptors">
>>>           <list>
>>>               <bean
>>> class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor" /> <ref
>>> bean="wss4jOutConfiguration" />
>>>           </list>
>>>       </property>
>>>       <property name="inInterceptors">
>>>           <list>
>>>               <bean
>>> class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" /> <ref
>>> bean="wss4jInConfiguration" />
>>>           </list>
>>>       </property>
>>>   </bean>
>>>
>>>
>>> When I use wsdl2java I get a client.
>>>
>>>
>>>
>>> @WebServiceClient(name = "ProductServicesBLA",
>>>                 wsdlLocation =
>>> "file:/Users/karlschmeing/Documents/workspace/cxf-webservices/src/ 
>>> b2b-bla-
>>> productservicesbla.wsdl", targetNamespace =
>>> "http://www.server.de/b2b/contract/bla/productservicesbla_v01_00")
>>>
>>> public class ProductServicesBLA_Service extends Service {
>>>
>>>   public final static URL WSDL_LOCATION;
>>>   public final static QName SERVICE = new
>>> QName("http://www.server.de/locationname", "ProductServicesBLA");  
>>> public
>>> final static QName ProductServicesBLAPort = new
>>> QName("http://http://www.server.de/locationname",  
>>> "ProductServicesBLA");
>>> static {
>>>       URL url = null;
>>>       try {
>>>           url = new
>>> URL("file:/Users/karlschmeing/Documents/workspace/cxf-webservices/ 
>>> src/b2b-
>>> bla-productservicestbla.wsdl"); } catch (MalformedURLException e) {
>>>           System.err.println("Can not initialize the default wsdl  
>>> from
>>> file:/Users/karlschmeing/Documents/workspace/cxf-webservices/src/ 
>>> b2b-bla-p
>>> roductservicesbla.wsdl"); // e.printStackTrace();
>>>       }
>>>       WSDL_LOCATION = url;
>>>   }
>>>
>>>   public ProductServicesBLA_Service(URL wsdlLocation) {
>>>       super(wsdlLocation, SERVICE);
>>>   }
>>>
>>> How can i integrate the WebServiceClient into the Spring  
>>> configuration? Is
>>> it possible to annotate the in and out interceptor?
>>>
>>> Regards,
>>>
>>> Ralf Josephy
>>>
>>
>> -- 
>> Daniel Kulp
>> dkulp@apache.org
>> http://www.dankulp.com/blog
>
>
> ralf.josephy@cybercon.de
>
>
> Tel.: +49-(0)228/227776-0
> Fax : +49-(0)228/227776-28
>
> cyber:con - Gesellschaft für neue Medien mbH
> Firmensitz: Königswinterer Str. 374, 53227 Bonn
> Registergericht: Amtsgericht Bonn, HRB 15523
> Geschäftsführer: Oliver Runge, Michael Göckel
> Umsatzsteuer-ID: DE178714321
>
>
>


ralf.josephy@cybercon.de


Tel.: +49-(0)228/227776-0
Fax : +49-(0)228/227776-28

cyber:con - Gesellschaft für neue Medien mbH
Firmensitz: Königswinterer Str. 374, 53227 Bonn
Registergericht: Amtsgericht Bonn, HRB 15523
Geschäftsführer: Oliver Runge, Michael Göckel
Umsatzsteuer-ID: DE178714321




Re: WSSE and Client Annotations in CXF 2.2.3

Posted by Ralf Josephy <ra...@cybercon.de>.
Thx

Ralf

P.S. I guess, it's jaxws:outInterceptors and jaxws:inInterceptors


Am 16.09.2009 um 04:33 schrieb Daniel Kulp:

>
>
> You really have two options:
>
> 1) Create a cxf.xml file that defines a jaxws:client bean with
>  a) createdFromAPI attribute set to true
>  b) the "id" set to the qname of the endpoint in the wsdl
> In this case, you can configure the interceptors and such on the  
> client using
> the properties on the jaxws:client element.
>
> 2)  Programmatically: see:
>   http://cxf.apache.org/docs/jax-ws-configuration.html
> The section entitled: Configuring an Endpoint/Client Proxy Using CXF  
> APIs
>
>
> Dan
>
>
>
>
> On Tue September 15 2009 4:58:13 am Karl Schmeing wrote:
>> Hi,
>>
>> i am using WSSE with authentication and encryption.
>>
>>
>> Therefore I configured my clientApplication.xml
>>
>> <bean id="clientFactory"
>> class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"> <property
>> name="serviceClass" value="demo.spring.ProductServiceImpl" />
>>
>>        <property name="outInterceptors">
>>            <list>
>>                <bean
>> class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor" /> <ref
>> bean="wss4jOutConfiguration" />
>>            </list>
>>        </property>
>>        <property name="inInterceptors">
>>            <list>
>>                <bean
>> class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" /> <ref
>> bean="wss4jInConfiguration" />
>>            </list>
>>        </property>
>>    </bean>
>>
>>
>> When I use wsdl2java I get a client.
>>
>>
>>
>> @WebServiceClient(name = "ProductServicesBLA",
>>                  wsdlLocation =
>> "file:/Users/karlschmeing/Documents/workspace/cxf-webservices/src/ 
>> b2b-bla-
>> productservicesbla.wsdl", targetNamespace =
>> "http://www.server.de/b2b/contract/bla/productservicesbla_v01_00")
>>
>> public class ProductServicesBLA_Service extends Service {
>>
>>    public final static URL WSDL_LOCATION;
>>    public final static QName SERVICE = new
>> QName("http://www.server.de/locationname", "ProductServicesBLA");  
>> public
>> final static QName ProductServicesBLAPort = new
>> QName("http://http://www.server.de/locationname",  
>> "ProductServicesBLA");
>> static {
>>        URL url = null;
>>        try {
>>            url = new
>> URL("file:/Users/karlschmeing/Documents/workspace/cxf-webservices/ 
>> src/b2b-
>> bla-productservicestbla.wsdl"); } catch (MalformedURLException e) {
>>            System.err.println("Can not initialize the default wsdl  
>> from
>> file:/Users/karlschmeing/Documents/workspace/cxf-webservices/src/ 
>> b2b-bla-p
>> roductservicesbla.wsdl"); // e.printStackTrace();
>>        }
>>        WSDL_LOCATION = url;
>>    }
>>
>>    public ProductServicesBLA_Service(URL wsdlLocation) {
>>        super(wsdlLocation, SERVICE);
>>    }
>>
>> How can i integrate the WebServiceClient into the Spring  
>> configuration? Is
>> it possible to annotate the in and out interceptor?
>>
>> Regards,
>>
>> Ralf Josephy
>>
>
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog


ralf.josephy@cybercon.de


Tel.: +49-(0)228/227776-0
Fax : +49-(0)228/227776-28

cyber:con - Gesellschaft für neue Medien mbH
Firmensitz: Königswinterer Str. 374, 53227 Bonn
Registergericht: Amtsgericht Bonn, HRB 15523
Geschäftsführer: Oliver Runge, Michael Göckel
Umsatzsteuer-ID: DE178714321




Re: WSSE and Client Annotations in CXF 2.2.3

Posted by Daniel Kulp <dk...@apache.org>.

You really have two options:

1) Create a cxf.xml file that defines a jaxws:client bean with 
  a) createdFromAPI attribute set to true
  b) the "id" set to the qname of the endpoint in the wsdl 
In this case, you can configure the interceptors and such on the client using 
the properties on the jaxws:client element.

2)  Programmatically: see:
   http://cxf.apache.org/docs/jax-ws-configuration.html
The section entitled: Configuring an Endpoint/Client Proxy Using CXF APIs


Dan




On Tue September 15 2009 4:58:13 am Karl Schmeing wrote:
> Hi,
> 
> i am using WSSE with authentication and encryption.
> 
> 
> Therefore I configured my clientApplication.xml
> 
> <bean id="clientFactory"
>  class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"> <property
>  name="serviceClass" value="demo.spring.ProductServiceImpl" />
> 
>         <property name="outInterceptors">
>             <list>
>                 <bean
>  class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor" /> <ref
>  bean="wss4jOutConfiguration" />
>             </list>
>         </property>
>         <property name="inInterceptors">
>             <list>
>                 <bean
>  class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" /> <ref
>  bean="wss4jInConfiguration" />
>             </list>
>         </property>
>     </bean>
> 
> 
> When I use wsdl2java I get a client.
> 
> 
> 
> @WebServiceClient(name = "ProductServicesBLA",
>                   wsdlLocation =
>  "file:/Users/karlschmeing/Documents/workspace/cxf-webservices/src/b2b-bla-
> productservicesbla.wsdl", targetNamespace =
>  "http://www.server.de/b2b/contract/bla/productservicesbla_v01_00")
> 
> public class ProductServicesBLA_Service extends Service {
> 
>     public final static URL WSDL_LOCATION;
>     public final static QName SERVICE = new
>  QName("http://www.server.de/locationname", "ProductServicesBLA"); public
>  final static QName ProductServicesBLAPort = new
>  QName("http://http://www.server.de/locationname", "ProductServicesBLA");
>  static {
>         URL url = null;
>         try {
>             url = new
>  URL("file:/Users/karlschmeing/Documents/workspace/cxf-webservices/src/b2b-
> bla-productservicestbla.wsdl"); } catch (MalformedURLException e) {
>             System.err.println("Can not initialize the default wsdl from
>  file:/Users/karlschmeing/Documents/workspace/cxf-webservices/src/b2b-bla-p
> roductservicesbla.wsdl"); // e.printStackTrace();
>         }
>         WSDL_LOCATION = url;
>     }
> 
>     public ProductServicesBLA_Service(URL wsdlLocation) {
>         super(wsdlLocation, SERVICE);
>     }
> 
> How can i integrate the WebServiceClient into the Spring configuration? Is
>  it possible to annotate the in and out interceptor?
> 
> Regards,
> 
> Ralf Josephy
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog