Re: service caching

2008-03-03 Thread Christopher Cheng
wsdl is indeed cached in WSDLManagerImpl.definitionsMap

After reading the codes, I have some questions. My workstation is a PentiumD
3GHz with 1.5GB RAM

In the class 
"org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(String
url)",
"setService(factory.create());" takes 3 seconds
"getDataBinding().initialize(getService());" takes 2 seconds

These 2 methods are called even in 2nd calls. Can you also cache the
services perhaps using jakarta commons-pool? or eh-cache?

By the way, I found that the wsdl is put into the definitionMap twice if "
WSDLManagerImpl.getDefinition(URL url)" is called. First in
"getDefintion(URL url)" at line 147 and second in "loadDefinition(String
url)" at line 201.


On Mon, Mar 3, 2008 at 4:22 PM, Christopher Cheng <
[EMAIL PROTECTED]> wrote:

> wsdl is indeed cached in WSDLManagerImpl.definitionsMap
>
> After reading the codes, I have some questions. My workstation is a
> PentiumD 3GHz with 1.5GB RAM
>
> In the class "
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(String
> url)",
> "setService(factory.create());" takes 3 seconds
> "getDataBinding().initialize(getService());" takes 2 seconds
>
> These 2 methods are called even in 2nd calls. Can you also cache the
> services perhaps using jakarta commons-pool? or eh-cache?
>
> By the way, I found that the wsdl is put into the definitionMap twice if "
> WSDLManagerImpl.getDefinition(URL url)" is called. First in
> "getDefintion(URL url)" at line 147 and second in "loadDefinition(String
> url)" at line 201.
>
>
>
> On Mon, Mar 3, 2008 at 9:43 AM, Willem Jiang <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
> >
> > I just went through the code, we really cache the WSDL definition in
> > CXF.
> > Could you send your test case and wsdl file to me ? I may need to trace
> > it for more information.
> >
> > Regards,
> >
> > Willem
> > Christopher Cheng wrote:
> > > I think the issue is still there. I used a for loop to execute the
> > same
> > > call, all takes approximately the same time to create service. I guess
> > that
> > > the service itself is not cached.
> > >
> > > On Sun, Mar 2, 2008 at 11:43 AM, Willem Jiang <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > >
> > >> Here is the JIRA[1] which describe the same thing that you want.
> > >> I don't know if it was really resolved, could you try the latest
> > >> released CXF 2.0.4 for it.
> > >>
> > >> If the issue is still there, please let me know , I will put it to my
> > >> next week todo list.
> > >>
> > >> [1]https://issues.apache.org/jira/browse/CXF-699
> > >> [2]http://cwiki.apache.org/CXF/download.html
> > >>
> > >> Willem.
> > >>
> > >> Christopher Cheng wrote:
> > >>
> > >>> I am migrating from Axis1.2 to CXF 2.0.3
> > >>>
> > >>> I understand that it will take a long time to build for the first
> > time.
> > >>>
> > >> What
> > >>
> > >>> I am wondering is that why it takes so long for the second and third
> > >>>
> > >> time?
> > >>
> > >>> Is there any caching of services? Axis does not seem to have this
> > issue.
> > >>>
> > >>>
> > >>>
> > >>> Christopher Cheng wrote:
> > >>>
> > >>>
> >  Attached is the log
> > 
> >  - Original Message -
> >  From: "Willem Jiang" <[EMAIL PROTECTED]>
> >  To: 
> >  Sent: Saturday, March 01, 2008 8:53 PM
> >  Subject: Re: service caching?
> > 
> > 
> > 
> > 
> > > Hi
> > >
> > > Could you set the logger level to FINE ?
> > > So we can get more information about the service publishing.
> > >
> > > Willem.
> > >
> > > Christopher Cheng wrote:
> > >
> > >
> > >> When I call the service as a client, it takes 5 seconds to load.
> > I am
> > >> not
> > >> sure whether it takes 5 seconds to create the service or it takes
> > 5
> > >> seconds
> > >> to look up for ciper filters. I am wondering if the services are
> > >> cached...
> > >>  Feb 29, 2008 2:14:42 PM
> > >> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > >> buildServiceFromWSDL
> > >> INFO: Creating Service
> > >> {https://webservices.sabre.com/websvc}OTA_HotelAvailService
> > from WSDL:
> > >> file:/C:/Java/abacus-webconnect-1.14.0.rc1
> > >>
> > >> /wsdl/OTA_HotelAvailLLS1.4.1RQ.wsdl
> > >>
> > >> Feb 29, 2008 2:14:47 PM org.apache.cxf.transport.https.SSLUtils
> > >> getCiphersuites
> > >> INFO: The cipher suites have not been configured, falling back to
> > >>
> > >> cipher
> > >>
> > >> suite filters.
> > >> Feb 29, 2008 2:14:47 PM org.apache.cxf.transport.https.SSLUtils
> > >> getCiphersFromList
> > >> INFO: The cipher suites have been set to
> > SSL_RSA_WITH_RC4_128_MD5,
> > >> SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_DES_CBC_SHA,
> > >> SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA,
> > >> 

unsubscribe

2008-03-03 Thread François Petitit



Re: service caching

2008-03-03 Thread Willem Jiang

Yes,  create the service and initialize the data binding take lots of time.

Since CXF build a new service and data binding for each endpoint , I 
think we could cached the service object with the service name. This 
feature is useful for a big WSDL with one service and several ports.


Any thought?

For the WSDLManagerImpl.getDefinition(), one put is taking the URL as the KEY 
and the other put is using the url.toString() as the Key.


Willem.

Christopher Cheng wrote:

wsdl is indeed cached in WSDLManagerImpl.definitionsMap

After reading the codes, I have some questions. My workstation is a PentiumD
3GHz with 1.5GB RAM

In the class 
"org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(String
url)",
"setService(factory.create());" takes 3 seconds
"getDataBinding().initialize(getService());" takes 2 seconds

These 2 methods are called even in 2nd calls. Can you also cache the
services perhaps using jakarta commons-pool? or eh-cache?

By the way, I found that the wsdl is put into the definitionMap twice if "
WSDLManagerImpl.getDefinition(URL url)" is called. First in
"getDefintion(URL url)" at line 147 and second in "loadDefinition(String
url)" at line 201.


On Mon, Mar 3, 2008 at 4:22 PM, Christopher Cheng <
[EMAIL PROTECTED]> wrote:

  

wsdl is indeed cached in WSDLManagerImpl.definitionsMap

After reading the codes, I have some questions. My workstation is a
PentiumD 3GHz with 1.5GB RAM

In the class "
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(String
url)",
"setService(factory.create());" takes 3 seconds
"getDataBinding().initialize(getService());" takes 2 seconds

These 2 methods are called even in 2nd calls. Can you also cache the
services perhaps using jakarta commons-pool? or eh-cache?

By the way, I found that the wsdl is put into the definitionMap twice if "
WSDLManagerImpl.getDefinition(URL url)" is called. First in
"getDefintion(URL url)" at line 147 and second in "loadDefinition(String
url)" at line 201.



On Mon, Mar 3, 2008 at 9:43 AM, Willem Jiang <[EMAIL PROTECTED]>
wrote:



Hi,

I just went through the code, we really cache the WSDL definition in
CXF.
Could you send your test case and wsdl file to me ? I may need to trace
it for more information.

Regards,

Willem
Christopher Cheng wrote:
  

I think the issue is still there. I used a for loop to execute the


same
  

call, all takes approximately the same time to create service. I guess


that
  

the service itself is not cached.

On Sun, Mar 2, 2008 at 11:43 AM, Willem Jiang <[EMAIL PROTECTED]>
wrote:




Here is the JIRA[1] which describe the same thing that you want.
I don't know if it was really resolved, could you try the latest
released CXF 2.0.4 for it.

If the issue is still there, please let me know , I will put it to my
next week todo list.

[1]https://issues.apache.org/jira/browse/CXF-699
[2]http://cwiki.apache.org/CXF/download.html

Willem.

Christopher Cheng wrote:

  

I am migrating from Axis1.2 to CXF 2.0.3

I understand that it will take a long time to build for the first


time.
  

What

  

I am wondering is that why it takes so long for the second and third



time?

  

Is there any caching of services? Axis does not seem to have this


issue.
  


Christopher Cheng wrote:




Attached is the log

- Original Message -
From: "Willem Jiang" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, March 01, 2008 8:53 PM
Subject: Re: service caching?




  

Hi

Could you set the logger level to FINE ?
So we can get more information about the service publishing.

Willem.

Christopher Cheng wrote:




When I call the service as a client, it takes 5 seconds to load.
  

I am
  

not
sure whether it takes 5 seconds to create the service or it takes
  

5
  

seconds
to look up for ciper filters. I am wondering if the services are
cached...
 Feb 29, 2008 2:14:42 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service
{https://webservices.sabre.com/websvc}OTA_HotelAvailService
  

from WSDL:
  

file:/C:/Java/abacus-webconnect-1.14.0.rc1

  

/wsdl/OTA_HotelAvailLLS1.4.1RQ.wsdl

  

Feb 29, 2008 2:14:47 PM org.apache.cxf.transport.https.SSLUtils
getCiphersuites
INFO: The cipher suites have not been configured, falling back to

  

cipher

  

suite filters.
Feb 29, 2008 2:14:47 PM org.apache.cxf.transport.https.SSLUtils
getCiphersFromList
INFO: The cipher suites have been set to
  

SSL_RSA_WITH_RC4_128_MD5,
  

SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_DES_CBC_SHA,
SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC

Plans about WS-Trust

2008-03-03 Thread Mayank Mishra

G'day all,

Can some kindly give an idea about any probable dates/months/version of 
including WS-Trust in future CXF releases.
According to [1]. WS-Trust may go in CXF 2.2. There is a possibility 
WS-Trust slipping into CXF 2.2, but when can we expect 2.2 release. Any 
status information on this will be really helpful.


Thanking You,

With Regards,
Mayank


[1]. http://incubator.apache.org/cxf/roadmap.html


Re: WSDL2Java error when using binding customization

2008-03-03 Thread Jesse McLaughlin

Thanks Jim.  I've figured out why it didn't work for me.  It seems that this
binding file won't work because I am importing my type definitions (which
are in a seperate xsd file) as opposed to including them inline in the WSDL
document itself.  Here's what the preamble of my WSDL looks like:


http://www.test.com/TestService/"; 
xmlns:tns="http://www.test.com/TestService/";
xmlns:test="http://www.test.com/test";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns="http://schemas.xmlsoap.org/wsdl/";>

http://www.test.com/test"; location="types.xsd"/>

...

I verified this by removing the import and in-lining my types, and
everything works.

My problem is that I don't know how to construct a binding file that works
when an import is used.  Do I now need to specify a schemaLocation
attribute? If so, what is the value?  And what would be the proper value for
the node attribute on the  element in this case?

Could someone provide an example of a binding file that would work?

Thanks,
Jesse.



jim ma wrote:
> 
> Hi Jesse,
> 
> I just tried this binding file with hello_world.wsdl and it works.
> 
> Can you check if there is some typo/error in your wsdl and make sure the
> 
> xpath expression is right for your wsdl .
> 
> Cheers
> 
> Jim Ma
> 
> 
> On Sun, Mar 2, 2008 at 7:13 PM, Jesse McLaughlin <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Hi there,
>>
>> I am trying to use CXF to generate a JAXB client from a WSDL, and I want
>> all
>> the generated objects to implement java.io.Serializable.  To do this, I
>> pass
>> the following bindings file to WSDL2Java, using the -b option:
>>
>> 
>> >  xmlns:jaxws="http://java.sun.com/xml/ns/jaxws";
>>  xmlns:jaxb="http://java.sun.com/xml/ns/jaxb";
>>  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
>>  xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>> 
>>
>> 
>> 
>>
>> When I run WSDL2Java, it gives me the following error:
>>
>>"WSDLToJava Error : Could not find any node with the XPath expression:
>> //wsdl:definitions/wsdl:types/xsd:schema"
>>
>> The client is generated normally if I don't pass this file.  I am using
>> CXF
>> 2.0.4 with JDK5 on OS X.
>>
>> Note that I have read on JIRA that since CXF 2.0.3, neither the
>> wsdlLocation
>> nor schemaLocation attributes are required when doing this sort of
>> customization (https://issues.apache.org/jira/browse/CXF-1094).
>>
>> Does anyone know what I am doing wrong here or why it does not work?
>>
>> Thanks,
>> Jesse.
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/WSDL2Java-error-when-using-%3Cjaxb%3Aserializable-%3E-binding-customization-tp15786637p15786637.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/WSDL2Java-error-when-using-%3Cjaxb%3Aserializable-%3E-binding-customization-tp15786637p15799909.html
Sent from the cxf-user mailing list archive at Nabble.com.



Rampart and CXF

2008-03-03 Thread John-M Baker
Hi,

Does CXF easily support Rampart security? I.e. is there some sample code 
showing me how to set the authentication credentials?

John Baker
-- 
Web SSO 
IT Infrastructure 
Deutsche Bank London

URL:  http://websso.cto.gt.intranet.db.com


---

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and delete this e-mail. Any unauthorized copying, 
disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional 
EU corporate and regulatory disclosures.

Re: Illegal Protocol https for HTTP URLConnection Factory

2008-03-03 Thread yulinxp

Yes I did set up http conduit for it. It's simliar to my first client setup.

HPRetrieverWS ss = new HPRetrieverWS (); 
HPRetrieverWSSoap hrPort = ss.getHPRetrieverWS WSSoap();   

org.apache.cxf.endpoint.Client client = ClientProxy.getClient(hrPort
; 
HTTPConduit httpConduit = (HTTPConduit) client.getConduit();   
//httpConduit.getClient().setAllowChunking(false); 

TLSClientParameters tlsParams = new TLSClientParameters(); 
tlsParams.setSecureSocketProtocol("SSL"); 
//tlsParams.getCipherSuites().add("SSL_RSA_WITH_3DES_EDE_CBC_SHA"); 
//tlsParams.getCipherSuites().add("SSL_RSA_WITH_RC4_128_MD5"); 
httpConduit.setTlsClientParameters(tlsParams); 

:-(


What's your 2nd CXF Client 's configuration?
Did you set the Client Parameters for it ?
Here is one http conduit per client in CXF.

Willem


-- 
View this message in context: 
http://www.nabble.com/Illegal-Protocol-https-for-HTTP-URLConnection-Factory-tp15798054p15804762.html
Sent from the cxf-user mailing list archive at Nabble.com.



WS-Security - signature problems

2008-03-03 Thread Kasper Hansen
I am rather new to using the cxf. I checked out from svn and had a
look at the samples in the disrubution folder. I didn't find a sample
for the ws-security so I decided to make one myself.
I started with the UsernameToken and this worked fine, I added the
logging interceptor and i could see in the SOAP headers that
everything was working fine. But then I wanted to sign the message, I
followed the instrucions at the cxf page to make the keystores but i
cannot get it to work. When I run my server and client, the server
runs fine and so does the client, but before I saw the messages in my
client windows that was sent but now it seems that nothing gets send,
but there is no errors to see even though I turned logging on the log
ALL.

Here is what i have in my server.xml file:

  
  

  




  

  


 









And in my client.xml file

 
  

  





  

  


   











Thr request never reaches the server because it doesn't get send, here
is the last output in the client command prompt:

 [java]
 [java] 03-03-2008 14:13:11
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
 [java] FINE: Invoking handleMessage on interceptor
org.apache.cxf.jaxws.handler.logical.LogicalHandlerOutIntercepto
[EMAIL PROTECTED]
 [java] 03-03-2008 14:13:11
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
 [java] FINE: Invoking handleMessage on interceptor
[EMAIL PROTECTED]
 [java] 03-03-2008 14:13:11
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
 [java] FINE: Invoking handleMessage on interceptor
[EMAIL PROTECTED]
 [java] 03-03-2008 14:13:11
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
 [java] FINE: Invoking handleMessage on interceptor
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInt
[EMAIL PROTECTED]
 [java] 03-03-2008 14:13:11
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal
handleM
essage
 [java] FINE: WSDoAllSender: enter invoke()
 [java] 03-03-2008 14:13:11
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal
handleM
essage
 [java] FINE: Action: 35
 [java] 03-03-2008 14:13:11
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal
handleM
essage
 [java] FINE: Actor: null
 [java] 03-03-2008 14:13:11 org.apache.ws.security.WSSConfig loadProvider
 [java] FINE: The provider JuiCE could not be added:
org.apache.security.juice.provider.JuiCEProviderOpenSSL
 [java] 03-03-2008 14:13:11 org.apache.ws.security.util.Loader getResource
 [java] FINE: Trying to find [client_sign.properties] using
[EMAIL PROTECTED] class loader.
 [java] 03-03-2008 14:13:11
org.apache.ws.security.components.crypto.CryptoFactory loadClass
 [java] FINE: Using Crypto Engine
[org.apache.ws.security.components.crypto.Merlin]
 [java] 03-03-2008 14:13:11 org.apache.ws.security.util.Loader getResource
 [java] FINE: Trying to find [client-keystore.jks] using
[EMAIL PROTECTED] class loader.
 [java] 03-03-2008 14:13:11
org.apache.ws.security.handler.WSHandler doSenderAction
 [java] FINE: Performing Action: 1
 [java] 03-03-2008 14:13:11
org.apache.ws.security.message.WSSecUsernameToken build
 [java] FINE: Begin add username token...
 [java] 03-03-2008 14:13:11
org.apache.ws.security.handler.WSHandler doSenderAction
 [java] FINE: Performing Action: 32
 [java] 03-03-2008 14:13:11
org.apache.ws.security.message.WSSecTimestamp build
 [java] FINE: Begin add timestamp...
 [java] 03-03-2008 14:13:11
org.apache.ws.security.handler.WSHandler doSenderAction
 [java] FINE: Performing Action: 2
 [java] 03-03-2008 14:13:11
org.apache.ws.security.message.WSSecSignature build
 [java] FINE: Beginning signing...
 [java] 03-03-2008 14:13:11
org.apache.ws.security.message.WSSecSignature prepare
 [java] FINE: automatic sig algo detection: RSA
 [java] 03-03-2008 14:13:11
org.apache.xml.security.algorithms.SignatureAlgorithm 
 [java] FINE: Create URI
"http://www.w3.org/2000/09/xmldsig#rsa-sha1"; class "class
org.apache.xml.security.algorithm
s.implementations.SignatureBaseRSA$SignatureRSASHA1"
 [java] 03-03-2008 14:13:11
org.apache.xml.security.algorithms.JCEMapper translateURItoJCEID
 [java] FINE: Request for URI http://www.w3.org/2000/09/xmldsig#rsa-sha1
 [java] 03-03-2008 14:13:11
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA

 [java] FINE: Created SignatureDSA using SHA1withRSA
 [java] 03-03-2008 14:13:11
org.apache.xml.security.utils.ElementProxy 
 [java] FINE: setElement("ds:SignatureMethod", "null")
 [java] 03-03-2008 14:13:11
org.apache.xml.security.algorithms.Signature

RE: WS-Security - signature problems

2008-03-03 Thread O hEigeartaigh, Colm

Can you attach the full code for your sample?

Colm.

-Original Message-
From: Kasper Hansen [mailto:[EMAIL PROTECTED] 
Sent: 03 March 2008 13:30
To: cxf-user@incubator.apache.org
Subject: WS-Security - signature problems

I am rather new to using the cxf. I checked out from svn and had a
look at the samples in the disrubution folder. I didn't find a sample
for the ws-security so I decided to make one myself.
I started with the UsernameToken and this worked fine, I added the
logging interceptor and i could see in the SOAP headers that
everything was working fine. But then I wanted to sign the message, I
followed the instrucions at the cxf page to make the keystores but i
cannot get it to work. When I run my server and client, the server
runs fine and so does the client, but before I saw the messages in my
client windows that was sent but now it seems that nothing gets send,
but there is no errors to see even though I turned logging on the log
ALL.

Here is what i have in my server.xml file:

  
  

  




  

  


 









And in my client.xml file

 
  

  





  

  


   











Thr request never reaches the server because it doesn't get send, here
is the last output in the client command prompt:

 [java]
 [java] 03-03-2008 14:13:11
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
 [java] FINE: Invoking handleMessage on interceptor
org.apache.cxf.jaxws.handler.logical.LogicalHandlerOutIntercepto
[EMAIL PROTECTED]
 [java] 03-03-2008 14:13:11
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
 [java] FINE: Invoking handleMessage on interceptor
[EMAIL PROTECTED]
 [java] 03-03-2008 14:13:11
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
 [java] FINE: Invoking handleMessage on interceptor
[EMAIL PROTECTED]
 [java] 03-03-2008 14:13:11
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
 [java] FINE: Invoking handleMessage on interceptor
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInt
[EMAIL PROTECTED]
 [java] 03-03-2008 14:13:11
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptor
Internal
handleM
essage
 [java] FINE: WSDoAllSender: enter invoke()
 [java] 03-03-2008 14:13:11
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptor
Internal
handleM
essage
 [java] FINE: Action: 35
 [java] 03-03-2008 14:13:11
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptor
Internal
handleM
essage
 [java] FINE: Actor: null
 [java] 03-03-2008 14:13:11 org.apache.ws.security.WSSConfig
loadProvider
 [java] FINE: The provider JuiCE could not be added:
org.apache.security.juice.provider.JuiCEProviderOpenSSL
 [java] 03-03-2008 14:13:11 org.apache.ws.security.util.Loader
getResource
 [java] FINE: Trying to find [client_sign.properties] using
[EMAIL PROTECTED] class loader.
 [java] 03-03-2008 14:13:11
org.apache.ws.security.components.crypto.CryptoFactory loadClass
 [java] FINE: Using Crypto Engine
[org.apache.ws.security.components.crypto.Merlin]
 [java] 03-03-2008 14:13:11 org.apache.ws.security.util.Loader
getResource
 [java] FINE: Trying to find [client-keystore.jks] using
[EMAIL PROTECTED] class loader.
 [java] 03-03-2008 14:13:11
org.apache.ws.security.handler.WSHandler doSenderAction
 [java] FINE: Performing Action: 1
 [java] 03-03-2008 14:13:11
org.apache.ws.security.message.WSSecUsernameToken build
 [java] FINE: Begin add username token...
 [java] 03-03-2008 14:13:11
org.apache.ws.security.handler.WSHandler doSenderAction
 [java] FINE: Performing Action: 32
 [java] 03-03-2008 14:13:11
org.apache.ws.security.message.WSSecTimestamp build
 [java] FINE: Begin add timestamp...
 [java] 03-03-2008 14:13:11
org.apache.ws.security.handler.WSHandler doSenderAction
 [java] FINE: Performing Action: 2
 [java] 03-03-2008 14:13:11
org.apache.ws.security.message.WSSecSignature build
 [java] FINE: Beginning signing...
 [java] 03-03-2008 14:13:11
org.apache.ws.security.message.WSSecSignature prepare
 [java] FINE: automatic sig algo detection: RSA
 [java] 03-03-2008 14:13:11
org.apache.xml.security.algorithms.SignatureAlgorithm 
 [java] FINE: Create URI
"http://www.w3.org/2000/09/xmldsig#rsa-sha1"; class "class
org.apache.xml.security.algorithm
s.implementations.SignatureBaseRSA$SignatureRSASHA1"
 [java] 03-03-2008 14:13:11
org.apache.xml.security.algorithms.JCEMapper translateURItoJCEID
 [java] FINE: Request for URI
http://www.w3.org/2000/09/xmldsig#rsa-sha1
 [java] 03-03-2008 14:13:11
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA

 [java] FINE: Created Signatu

RE: SOAPFaultException from Provider not written to SOAP response

2008-03-03 Thread Bokde, Dhiraj
Hi Dan, 

What change do I need to make to my cxf.xml to use the workaround you
suggest? I tried just adding the bean, but apparently it doesn't have a
default ctor. 

Thanks,
Dhiraj. 

> -Original Message-
> From: Daniel Kulp [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 29, 2008 12:47 PM
> To: cxf-user@incubator.apache.org
> Cc: Bokde, Dhiraj
> Subject: Re: SOAPFaultException from Provider not written to SOAP
response
> 
> 
> It doesn't seem to be working anyway you look at it.   I have a fix
I'm
> testing now.  :-(
> 
> The "workaround" right now that MIGHT work would be to use spring
> configuration to
> org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor
> to the outFaultChain of the service.  That's what my fix is basically
> doing.   Currently, in provider mode, the outFaultChain isn't putting
> the proper soap:env/body in place cause that interceptor is missing.
> 
> Dan
> 
> 
> On Thursday 28 February 2008, Bokde, Dhiraj wrote:
> > Hi,
> >
> > I am using CXF version 2.0.4-incubator in an application that
> > implements the JAX-WS Provider interface. The application
> > throws a SOAPFaultException on error, but the client gets the HTTP
> > message below, which does not have a SOAP Envelope and hence cannot
be
> > parsed.
> >
> > The code snippet that throws the SOAPFaultException is also
included.
> > What's the right way of creating and throwing a SOAPFaultException?
> >
> > 
> > Message errMessage = new Message("UNEXPECTED_ERROR",
> > BUNDLE, e.getMessage());
> > LOG.error(errMessage, e);
> > Fault fault = new Fault(errMessage));
> > SOAPFault soapFault =
> > SOAPFactory.newInstance().createFault();
> > soapFault.setFaultCode(fault.getFaultCode());
> > soapFault.setFaultString(fault.getMessage());
> > throw new SOAPFaultException(soapFault);
> > 
> >
> > 
> > --
> > Feb 28, 2008 1:03:57 PM
> > org.apache.cxf.interceptor.LoggingInInterceptor logging
> > INFO: Inbound Message
> > 
> > Encoding: UTF-8
> > Headers: {Content-Length=[342], Server=[Jetty(6.1.6)],
> > content-type=[text/xml; c
> > harset=utf-8]}
> > Messages:
> > Message:
> >
> > Payload:  > xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/";> >
xmlns:ns2="http://cxf.apache.org/faultcode";>ns2:server >lt string>Invalid Request Message: [Line: -1, Column: -1: Empty XML
> > response from validation script:
> > identity.xslt].
> > --
> > 
> >
> >
> > Regards,
> > Dhiraj.
> >
> > Dhiraj Bokde
> > Principal Consultant
> > [EMAIL PROTECTED]
> > --
> > IONA Technologies PLC
> > 1-800-ORBIX-4U
> > http://www.iona.com
> > Making Software Work Together
> > --
> 
> 
> 
> --
> J. Daniel Kulp
> Principal Engineer, IONA
> [EMAIL PROTECTED]
> http://www.dankulp.com/blog


RE: WS-Security - signature problems

2008-03-03 Thread kasperih

I have attached all the files that you asked for. Its the entire
folder with all the relvant files.

- keytool -genkey -alias football-client -keypass keyStorePassword
-keystore  client-keystore.jks -storepass keyStorePassword -dname
"cn=football-client" -keyalg RSA

- keytool -selfcert -alias football-client -keystore
client-keystore.jks -   storepass keyStorePassword -keypass
keyStorePassword

- keytool -export -alias football-client -file key.rsa -keystore
client-keystore.jks -storepass keyStorePassword

- keytool -import -alias football-client  -file key.rsa -keystore
server-keystore.jks -storepass keyStorePassword


These are the commands I used in order to create the keys.


Regards
Kasper H



O hEigeartaigh, Colm wrote:
> 
> 
> Can you attach the full code for your sample?
> 
> Colm.
> 
> -Original Message-
> From: Kasper Hansen [mailto:[EMAIL PROTECTED] 
> Sent: 03 March 2008 13:30
> To: cxf-user@incubator.apache.org
> Subject: WS-Security - signature problems
> 
> I am rather new to using the cxf. I checked out from svn and had a
> look at the samples in the disrubution folder. I didn't find a sample
> for the ws-security so I decided to make one myself.
> I started with the UsernameToken and this worked fine, I added the
> logging interceptor and i could see in the SOAP headers that
> everything was working fine. But then I wanted to sign the message, I
> followed the instrucions at the cxf page to make the keystores but i
> cannot get it to work. When I run my server and client, the server
> runs fine and so does the client, but before I saw the messages in my
> client windows that was sent but now it seems that nothing gets send,
> but there is no errors to see even though I turned logging on the log
> ALL.
> 
> Here is what i have in my server.xml file:
> 
>class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
>class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
> 
>   
> 
> 
>  value="football.demo.server.ServerPasswordCallback" />
>  value="server_sign.properties"/>
>   
> 
>   
> 
> 
>  
> 
> 
> 
> 
> 
> 
> 
> 
> 
> And in my client.xml file
> 
>   class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor" />
>class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
> 
>   
> 
> 
> 
>  value="football.demo.client.ClientPasswordCallback" />
> 
>   
> 
>   
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Thr request never reaches the server because it doesn't get send, here
> is the last output in the client command prompt:
> 
>  [java]
>  [java] 03-03-2008 14:13:11
> org.apache.cxf.phase.PhaseInterceptorChain doIntercept
>  [java] FINE: Invoking handleMessage on interceptor
> org.apache.cxf.jaxws.handler.logical.LogicalHandlerOutIntercepto
> [EMAIL PROTECTED]
>  [java] 03-03-2008 14:13:11
> org.apache.cxf.phase.PhaseInterceptorChain doIntercept
>  [java] FINE: Invoking handleMessage on interceptor
> [EMAIL PROTECTED]
>  [java] 03-03-2008 14:13:11
> org.apache.cxf.phase.PhaseInterceptorChain doIntercept
>  [java] FINE: Invoking handleMessage on interceptor
> [EMAIL PROTECTED]
>  [java] 03-03-2008 14:13:11
> org.apache.cxf.phase.PhaseInterceptorChain doIntercept
>  [java] FINE: Invoking handleMessage on interceptor
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInt
> [EMAIL PROTECTED]
>  [java] 03-03-2008 14:13:11
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptor
> Internal
> handleM
> essage
>  [java] FINE: WSDoAllSender: enter invoke()
>  [java] 03-03-2008 14:13:11
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptor
> Internal
> handleM
> essage
>  [java] FINE: Action: 35
>  [java] 03-03-2008 14:13:11
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptor
> Internal
> handleM
> essage
>  [java] FINE: Actor: null
>  [java] 03-03-2008 14:13:11 org.apache.ws.security.WSSConfig
> loadProvider
>  [java] FINE: The provider JuiCE could not be added:
> org.apache.security.juice.provider.JuiCEProviderOpenSSL
>  [java] 03-03-2008 14:13:11 org.apache.ws.security.util.Loader
> getResource
>  [java] FINE: Trying to find [client_sign.properties] using
> [EMAIL PROTECTED] class loader.
>  [java] 03-03-2008 14:13:11
> org.apache.ws.security.components.crypto.CryptoFactory loadClass
>  [java] FINE: Using Crypto Engine
> [org.apache.ws.security.components.crypto.Merlin]
>  [java] 03-03-2008 14:13:11 org.apache.ws.security.util.Loader
> getResource
>  [java] FINE: Trying to find [client-keystore.jks] using
> [EMAIL PROTECTED] class loader.
>  [java] 03-03-2008 14:13:11
> org.apache.ws.security.handler.WSHand

Re: SOAPFaultException from Provider not written to SOAP response

2008-03-03 Thread Daniel Kulp
On Monday 03 March 2008, Bokde, Dhiraj wrote:
> Hi Dan,
>
> What change do I need to make to my cxf.xml to use the workaround you
> suggest? I tried just adding the bean, but apparently it doesn't have
> a default ctor.

Right.  Add a constructor-arg for it:



That should do it.

Dan



>
> Thanks,
> Dhiraj.
>
> > -Original Message-
> > From: Daniel Kulp [mailto:[EMAIL PROTECTED]
> > Sent: Friday, February 29, 2008 12:47 PM
> > To: cxf-user@incubator.apache.org
> > Cc: Bokde, Dhiraj
> > Subject: Re: SOAPFaultException from Provider not written to SOAP
>
> response
>
> > It doesn't seem to be working anyway you look at it.   I have a fix
>
> I'm
>
> > testing now.  :-(
> >
> > The "workaround" right now that MIGHT work would be to use spring
> > configuration to
> > org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor
> > to the outFaultChain of the service.  That's what my fix is
> > basically doing.   Currently, in provider mode, the outFaultChain
> > isn't putting the proper soap:env/body in place cause that
> > interceptor is missing.
> >
> > Dan
> >
> > On Thursday 28 February 2008, Bokde, Dhiraj wrote:
> > > Hi,
> > >
> > > I am using CXF version 2.0.4-incubator in an application that
> > > implements the JAX-WS Provider interface. The application
> > > throws a SOAPFaultException on error, but the client gets the HTTP
> > > message below, which does not have a SOAP Envelope and hence
> > > cannot
>
> be
>
> > > parsed.
> > >
> > > The code snippet that throws the SOAPFaultException is also
>
> included.
>
> > > What's the right way of creating and throwing a
> > > SOAPFaultException?
> > >
> > > 
> > > Message errMessage = new Message("UNEXPECTED_ERROR",
> > > BUNDLE, e.getMessage());
> > > LOG.error(errMessage, e);
> > > Fault fault = new Fault(errMessage));
> > > SOAPFault soapFault =
> > > SOAPFactory.newInstance().createFault();
> > > soapFault.setFaultCode(fault.getFaultCode());
> > > soapFault.setFaultString(fault.getMessage());
> > > throw new SOAPFaultException(soapFault);
> > > 
> > >
> > > 
> > > --
> > > Feb 28, 2008 1:03:57 PM
> > > org.apache.cxf.interceptor.LoggingInInterceptor logging
> > > INFO: Inbound Message
> > > 
> > > Encoding: UTF-8
> > > Headers: {Content-Length=[342], Server=[Jetty(6.1.6)],
> > > content-type=[text/xml; c
> > > harset=utf-8]}
> > > Messages:
> > > Message:
> > >
> > > Payload:  > > xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/";>
> xmlns:ns2="http://cxf.apache.org/faultcode";>ns2:server
> > >lt string>Invalid Request Message: [Line: -1, Column: -1: Empty XML
> > > response from validation script:
> > > identity.xslt].
> > > --
> > > 
> > >
> > >
> > > Regards,
> > > Dhiraj.
> > >
> > > Dhiraj Bokde
> > > Principal Consultant
> > > [EMAIL PROTECTED]
> > > --
> > > IONA Technologies PLC
> > > 1-800-ORBIX-4U
> > > http://www.iona.com
> > > Making Software Work Together
> > > --
> >
> > --
> > J. Daniel Kulp
> > Principal Engineer, IONA
> > [EMAIL PROTECTED]
> > http://www.dankulp.com/blog



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


Re: Illegal Protocol https for HTTP URLConnection Factory

2008-03-03 Thread Daniel Kulp

Yea.  I hit this while testing your testcase as well.   For some oddball 
reason, using an address like "https" doesn't allow https to actually be 
used.   You MUST configure a TLSClientParameters thing on the conduit 
prior to connecting.   Kind of strange and I'm not exactly sure why.  
Thus, you have to get the TLS thing configured either via spring config 
or programatic config.  

In anycase, I fixed it this morning.   :-)I'm going to deploy new 
2.0.5 and 2.1 snapshots later today.

Dan




On Monday 03 March 2008, yulinxp wrote:
> My excitement for my first CXF client connection didn't last long.
> Now I have another problem for my 2nd CXF client connection to
> https://mdf.ingenixmedpoint.com/mdfwebservices/hpretriever.asmx?WSDL
>
>
> The same exception happens even after I set httpconduit SSL.
> Why it would get a HTTP URLConnection Factory at the first  place??
>
> :confused:
>
> org.apache.cxf.interceptor.Fault: Could not send Message.
>   at
> org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Mess
>ageSenderInterceptor.java:48) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
>rChain.java:207) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205) at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135
>) at $Proxy27.getHealthProfileNDA(Unknown Source)
>   at
> https.mdf_ingenixmedpoint_com.mdfwebservices.hpretriever.HPRetrieverWS
>Soap_HPRetrieverWSSoap_Client.main(HPRetrieverWSSoap_HPRetrieverWSSoap_
>Client.java:57) Caused by: java.io.IOException: Illegal Protocol https
> for HTTP URLConnection Factory.
>   at
> org.apache.cxf.transport.http.HttpURLConnectionFactoryImpl.createConne
>ction(HttpURLConnectionFactoryImpl.java:44) at
> org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:474
>) at
> org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Mess
>ageSenderInterceptor.java:46) ... 7 more
> Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could
> not send Message.
>   at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175
>) at $Proxy27.getHealthProfileNDA(Unknown Source)
>   at
> https.mdf_ingenixmedpoint_com.mdfwebservices.hpretriever.HPRetrieverWS
>Soap_HPRetrieverWSSoap_Client.main(HPRetrieverWSSoap_HPRetrieverWSSoap_
>Client.java:57) Caused by: org.apache.cxf.interceptor.Fault: Could not
> send Message. at
> org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Mess
>ageSenderInterceptor.java:48) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
>rChain.java:207) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205) at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135
>) ... 2 more
> Caused by: java.io.IOException: Illegal Protocol https for HTTP
> URLConnection Factory.
>   at
> org.apache.cxf.transport.http.HttpURLConnectionFactoryImpl.createConne
>ction(HttpURLConnectionFactoryImpl.java:44) at
> org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:474
>) at
> org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Mess
>ageSenderInterceptor.java:46) ... 7 more



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


Re: WSDL2Java error when using binding customization

2008-03-03 Thread Daniel Kulp

It should just be something like:


http://java.sun.com/xml/ns/jaxb";
  xmlns:xs="http://www.w3.org/2001/XMLSchema";>








Dan



On Monday 03 March 2008, Jesse McLaughlin wrote:
> Thanks Jim.  I've figured out why it didn't work for me.  It seems
> that this binding file won't work because I am importing my type
> definitions (which are in a seperate xsd file) as opposed to including
> them inline in the WSDL document itself.  Here's what the preamble of
> my WSDL looks like:
>
> 
>  targetNamespace="http://www.test.com/TestService/";
> xmlns:tns="http://www.test.com/TestService/";
> xmlns:test="http://www.test.com/test";
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns="http://schemas.xmlsoap.org/wsdl/";>
>
> http://www.test.com/test";
> location="types.xsd"/>
>
> ...
>
> I verified this by removing the import and in-lining my types, and
> everything works.
>
> My problem is that I don't know how to construct a binding file that
> works when an import is used.  Do I now need to specify a
> schemaLocation attribute? If so, what is the value?  And what would be
> the proper value for the node attribute on the  element
> in this case?
>
> Could someone provide an example of a binding file that would work?
>
> Thanks,
> Jesse.
>
> jim ma wrote:
> > Hi Jesse,
> >
> > I just tried this binding file with hello_world.wsdl and it works.
> >
> > Can you check if there is some typo/error in your wsdl and make sure
> > the
> >
> > xpath expression is right for your wsdl .
> >
> > Cheers
> >
> > Jim Ma
> >
> >
> > On Sun, Mar 2, 2008 at 7:13 PM, Jesse McLaughlin
> > <[EMAIL PROTECTED]>
> >
> > wrote:
> >> Hi there,
> >>
> >> I am trying to use CXF to generate a JAXB client from a WSDL, and I
> >> want all
> >> the generated objects to implement java.io.Serializable.  To do
> >> this, I pass
> >> the following bindings file to WSDL2Java, using the -b option:
> >>
> >> 
> >>  >>  xmlns:jaxws="http://java.sun.com/xml/ns/jaxws";
> >>  xmlns:jaxb="http://java.sun.com/xml/ns/jaxb";
> >>  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> >>  xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
> >> 
> >>
> >> 
> >> 
> >>
> >> When I run WSDL2Java, it gives me the following error:
> >>
> >>"WSDLToJava Error : Could not find any node with the XPath
> >> expression: //wsdl:definitions/wsdl:types/xsd:schema"
> >>
> >> The client is generated normally if I don't pass this file.  I am
> >> using CXF
> >> 2.0.4 with JDK5 on OS X.
> >>
> >> Note that I have read on JIRA that since CXF 2.0.3, neither the
> >> wsdlLocation
> >> nor schemaLocation attributes are required when doing this sort of
> >> customization (https://issues.apache.org/jira/browse/CXF-1094).
> >>
> >> Does anyone know what I am doing wrong here or why it does not
> >> work?
> >>
> >> Thanks,
> >> Jesse.
> >>
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/WSDL2Java-error-when-using-%3Cjaxb%3Aserializ
> >>able-%3E-binding-customization-tp15786637p15786637.html Sent from
> >> the cxf-user mailing list archive at Nabble.com.



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


Re: service caching

2008-03-03 Thread Daniel Kulp

Christopher,

We cannot just "reuse" the Service model objects as they are completely 
modifiable at runtime. For example, one proxy could be reconfigured with 
new address or have additional interceptors added or similar.  Those 
shouldn't affect others.

On option that propably would make sense is to add a fast "clone" 
functionality to the entire service model so we could cache one, and 
then clone it whenever one is really needed.   All the individual 
versions could be modified and not affect the original.   However, doing 
that would be quite a bit of work as there are a LOT of classes that 
would need to be updated to support that.

Patches towards that end would be great.   :-)

Dan


On Monday 03 March 2008, Christopher Cheng wrote:
> wsdl is indeed cached in WSDLManagerImpl.definitionsMap
>
> After reading the codes, I have some questions. My workstation is a
> PentiumD 3GHz with 1.5GB RAM
>
> In the class
> "org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServ
>iceFromWSDL(String url)",
> "setService(factory.create());" takes 3 seconds
> "getDataBinding().initialize(getService());" takes 2 seconds
>
> These 2 methods are called even in 2nd calls. Can you also cache the
> services perhaps using jakarta commons-pool? or eh-cache?
>
> By the way, I found that the wsdl is put into the definitionMap twice
> if " WSDLManagerImpl.getDefinition(URL url)" is called. First in
> "getDefintion(URL url)" at line 147 and second in
> "loadDefinition(String url)" at line 201.
>
>
> On Mon, Mar 3, 2008 at 4:22 PM, Christopher Cheng <
>
> [EMAIL PROTECTED]> wrote:
> > wsdl is indeed cached in WSDLManagerImpl.definitionsMap
> >
> > After reading the codes, I have some questions. My workstation is a
> > PentiumD 3GHz with 1.5GB RAM
> >
> > In the class "
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildSer
> >viceFromWSDL(String url)",
> > "setService(factory.create());" takes 3 seconds
> > "getDataBinding().initialize(getService());" takes 2 seconds
> >
> > These 2 methods are called even in 2nd calls. Can you also cache the
> > services perhaps using jakarta commons-pool? or eh-cache?
> >
> > By the way, I found that the wsdl is put into the definitionMap
> > twice if " WSDLManagerImpl.getDefinition(URL url)" is called. First
> > in "getDefintion(URL url)" at line 147 and second in
> > "loadDefinition(String url)" at line 201.
> >
> >
> >
> > On Mon, Mar 3, 2008 at 9:43 AM, Willem Jiang
> > <[EMAIL PROTECTED]>
> >
> > wrote:
> > > Hi,
> > >
> > > I just went through the code, we really cache the WSDL definition
> > > in CXF.
> > > Could you send your test case and wsdl file to me ? I may need to
> > > trace it for more information.
> > >
> > > Regards,
> > >
> > > Willem
> > >
> > > Christopher Cheng wrote:
> > > > I think the issue is still there. I used a for loop to execute
> > > > the
> > >
> > > same
> > >
> > > > call, all takes approximately the same time to create service. I
> > > > guess
> > >
> > > that
> > >
> > > > the service itself is not cached.
> > > >
> > > > On Sun, Mar 2, 2008 at 11:43 AM, Willem Jiang
> > > > <[EMAIL PROTECTED]>
> > > >
> > > > wrote:
> > > >> Here is the JIRA[1] which describe the same thing that you
> > > >> want. I don't know if it was really resolved, could you try the
> > > >> latest released CXF 2.0.4 for it.
> > > >>
> > > >> If the issue is still there, please let me know , I will put it
> > > >> to my next week todo list.
> > > >>
> > > >> [1]https://issues.apache.org/jira/browse/CXF-699
> > > >> [2]http://cwiki.apache.org/CXF/download.html
> > > >>
> > > >> Willem.
> > > >>
> > > >> Christopher Cheng wrote:
> > > >>> I am migrating from Axis1.2 to CXF 2.0.3
> > > >>>
> > > >>> I understand that it will take a long time to build for the
> > > >>> first
> > >
> > > time.
> > >
> > > >> What
> > > >>
> > > >>> I am wondering is that why it takes so long for the second and
> > > >>> third
> > > >>
> > > >> time?
> > > >>
> > > >>> Is there any caching of services? Axis does not seem to have
> > > >>> this
> > >
> > > issue.
> > >
> > > >>> Christopher Cheng wrote:
> > >  Attached is the log
> > > 
> > >  - Original Message -
> > >  From: "Willem Jiang" <[EMAIL PROTECTED]>
> > >  To: 
> > >  Sent: Saturday, March 01, 2008 8:53 PM
> > >  Subject: Re: service caching?
> > > 
> > > > Hi
> > > >
> > > > Could you set the logger level to FINE ?
> > > > So we can get more information about the service publishing.
> > > >
> > > > Willem.
> > > >
> > > > Christopher Cheng wrote:
> > > >> When I call the service as a client, it takes 5 seconds to
> > > >> load.
> > >
> > > I am
> > >
> > > >> not
> > > >> sure whether it takes 5 seconds to create the service or it
> > > >> takes
> > >
> > > 5
> > >
> > > >> seconds
> > > >> to look up for ciper filters. I am wondering if the
> > > >> services are cached...
> > > >>  Feb 29, 2008 2:14:42 

Re: Illegal Protocol https for HTTP URLConnection Factory

2008-03-03 Thread Benson Margulies
I just finished deploying a snapshot.

On Mon, Mar 3, 2008 at 3:27 PM, Daniel Kulp <[EMAIL PROTECTED]> wrote:

>
> Yea.  I hit this while testing your testcase as well.   For some oddball
> reason, using an address like "https" doesn't allow https to actually be
> used.   You MUST configure a TLSClientParameters thing on the conduit
> prior to connecting.   Kind of strange and I'm not exactly sure why.
> Thus, you have to get the TLS thing configured either via spring config
> or programatic config.
>
> In anycase, I fixed it this morning.   :-)I'm going to deploy new
> 2.0.5 and 2.1 snapshots later today.
>
> Dan
>
>
>
>
> On Monday 03 March 2008, yulinxp wrote:
> > My excitement for my first CXF client connection didn't last long.
> > Now I have another problem for my 2nd CXF client connection to
> > https://mdf.ingenixmedpoint.com/mdfwebservices/hpretriever.asmx?WSDL
> >
> >
> > The same exception happens even after I set httpconduit SSL.
> > Why it would get a HTTP URLConnection Factory at the first  place??
> >
> > :confused:
> >
> > org.apache.cxf.interceptor.Fault: Could not send Message.
> >   at
> > org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Mess
> >ageSenderInterceptor.java:48) at
> > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
> >rChain.java:207) at
> > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254) at
> > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205) at
> > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at
> > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135
> >) at $Proxy27.getHealthProfileNDA(Unknown Source)
> >   at
> > https.mdf_ingenixmedpoint_com.mdfwebservices.hpretriever.HPRetrieverWS
> >Soap_HPRetrieverWSSoap_Client.main(HPRetrieverWSSoap_HPRetrieverWSSoap_
> >Client.java:57) Caused by: java.io.IOException: Illegal Protocol https
> > for HTTP URLConnection Factory.
> >   at
> > org.apache.cxf.transport.http.HttpURLConnectionFactoryImpl.createConne
> >ction(HttpURLConnectionFactoryImpl.java:44) at
> > org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:474
> >) at
> > org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Mess
> >ageSenderInterceptor.java:46) ... 7 more
> > Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could
> > not send Message.
> >   at
> > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175
> >) at $Proxy27.getHealthProfileNDA(Unknown Source)
> >   at
> > https.mdf_ingenixmedpoint_com.mdfwebservices.hpretriever.HPRetrieverWS
> >Soap_HPRetrieverWSSoap_Client.main(HPRetrieverWSSoap_HPRetrieverWSSoap_
> >Client.java:57) Caused by: org.apache.cxf.interceptor.Fault: Could not
> > send Message. at
> > org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Mess
> >ageSenderInterceptor.java:48) at
> > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
> >rChain.java:207) at
> > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254) at
> > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205) at
> > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at
> > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135
> >) ... 2 more
> > Caused by: java.io.IOException: Illegal Protocol https for HTTP
> > URLConnection Factory.
> >   at
> > org.apache.cxf.transport.http.HttpURLConnectionFactoryImpl.createConne
> >ction(HttpURLConnectionFactoryImpl.java:44) at
> > org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:474
> >) at
> > org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Mess
> >ageSenderInterceptor.java:46) ... 7 more
>
>
>
> --
> J. Daniel Kulp
> Principal Engineer, IONA
> [EMAIL PROTECTED]
> http://www.dankulp.com/blog
>


Re: REST CDATA Marshalling

2008-03-03 Thread Daniel Kulp

Yea, there really is NOT a way to do this with JAXB.   Jaxb doesn't call 
the writeCData method on the XmlStreamWriter at all, ever.  (I just 
grepped the source).   The ONLY way I can see to do this would be write 
a XmlStreamWriter wrapper that wraps the "real" writer and keeps track 
of the element it's in and if in the appropriate element, foward the 
writeCharacters calls to writeCData calls instead.  Not sure how worth 
it that would be.

Dan

On Saturday 01 March 2008, Todd Orr wrote:
> I'm attempting to get String data wrapped in CDATA before being
> returned to the client. I do not want special characters to be
> escaped. First I tried simply wrapping the properties in my getters
> with the CDATA block. Unfortunately, JAXB continued to escape all the
> special characters.
>
> I found this post:
> http://forum.java.sun.com/thread.jspa?threadID=607524&messageID=353193
>1. Although promising, I could not find out how to setup JAXB in my
> applicationContext in such a way to set this as the XMLSerializer.
>
> Has anyone accomplished this? It seems as though it would be a fairly
> common need.
>
> Thanks,
> T



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


Re: Is it thread safe to use an instance variable @WebServiceProvider?

2008-03-03 Thread Daniel Kulp

As Willem mentioned, this is definitely not thread safe using the default 
setups.   

With 2.1, we have new Factories that can be used to help these cases.  
The "default" is a SingleInstance thing where you would need to be 
concerned with thread safety.   However, you will be able to configure 
a "pool" of instances where a single object is used to service the 
request, then returned back to the pool.

Some of it is talked about in the thread:
http://www.nabble.com/WebServiceContext-not-injected-in-endpoint-to15708465.html#a15732342


Dan

On Saturday 01 March 2008, Landslide wrote:
> Is it thread safe to use an instance variable "quote" as below?
>
> import javax.xml.ws.Provider;
> import javax.xml.ws.Service;
> import javax.xml.ws.ServiceMode;
> import javax.xml.ws.WebServiceProvider;
>
> @WebServiceProvider(portName="stockQuoteReporterPort"
> serviceName="stockQuoteReporter")
> @ServiceMode(value="Service.Mode.MESSAGE")
> public class  StockQuoteReporterProvider implements
> Provider {
> private Quote quote;
>
> public StockQuoteReporterProvider()
>   {
>quote = new Quote();
>   }
>
> public SOAPMessage invoke(SOAPMessage request)
>   {
>   quote.setIntProperty(123);
>
>   SOAPBody requestBody = request.getSOAPBody();
>   if(requestBody.getElementName.getLocalName.equals("getStockPrice"))
> {
> MessageFactory mf = MessageFactory.newInstance();
> SOAPFactory sf = SOAPFactory.newInstance();
>
> SOAPMessage response = mf.createMessage();
> SOAPBody respBody = response.getSOAPBody();
> Name bodyName = sf.createName("getStockPriceResponse");
> respBody.addBodyElement(bodyName);
> SOAPElement respContent = respBody.addChildElement("price");
> respContent.setValue("123.00");
> response.saveChanges();
> return response;
> }
> ...
>   }
> }



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


Re: Rampart and CXF

2008-03-03 Thread Daniel Kulp

By "rampart security", I assume you mean WS-Security?

If so, there is a good blog entry at:
http://domagojtechtips.blogspot.com/2007/08/cxf-spring-and-ws-security-putting-it.html
and another at:
http://www.lumidant.com/blog/apache-cxf-tutorial-ws-security-with-spring/

Dan


On Monday 03 March 2008, John-M Baker wrote:
> Hi,
>
> Does CXF easily support Rampart security? I.e. is there some sample
> code showing me how to set the authentication credentials?
>
> John Baker



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


CXF & Spring Transactions

2008-03-03 Thread Michael McCaskill

I'm coming from Spring-Webservices. I like that CXF supports contract-last
since I'm in a prototype, rapid development phase for my work project. But
I've noticed that weird things happen when using CXF with Spring
Transactions.

It appears that after so many web service calls, the DBCP pool is exhausted
and connections aren't returned. This wasn't happening with
Spring-Webservices. I've tried the 2.1-incubator-SNAPSHOT as well. It needs
to be said that I am filtering out the Spring-2.0.6 dependencies and opting
for 2.5. I'm using Spring's @Transactional annotation, JAXB,
JaxWsProxyFactoryBean on client, jaxws:endpoint on server, Hibernate 3.1 and
Oracle 9.2.0.8.
-- 
View this message in context: 
http://www.nabble.com/CXF---Spring-Transactions-tp15814197p15814197.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: request/response wrapper with wsdl2java

2008-03-03 Thread Daniel Kulp
On Saturday 01 March 2008, Michael Nelson wrote:
> For non-trivial methods, WSDL2Java forces me to deal with
> request/response wrapper classes in the client code it generates (see
> the 1st method as compared to the 2nd method). Is there a way to
> prevent this?

Probably not.  There are very explicit rules about when we can unwrap the 
type into  the second form.   Section 2.3.1.2 of the JAX-WS spec:


(i) The operation’s input and output messages (if present) each contain 
only a single part
(ii) The input message part refers to a global element declaration whose 
localname is equal to the operation name
(iii) The output message (if present) part refers to a global element 
declaration
(iv) The elements referred to by the input and output message (if 
present) parts (henceforth referred to as wrapper elements) are both 
complex types defined using the xsd:sequence compositor 
(v) The wrapper elements only contain child elements, they MUST not 
contain other structures such as wildcards (element or attribute), 
xsd:choice, substitution groups (element references are not permitted) 
or attributes; furthermore, they MUST not be nillable.


Hope that helps explan things a bit.

Dan



>
> Thanks,
> -mike
>
> Examples:
>
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> @WebResult(name = "getCustomerResponse", targetNamespace = "
> http://customer.acme.com";, partName = "parameters")
> @WebMethod
> public com.acme.customer.GetCustomerResponse getCustomer(
> @WebParam(partName = "parameters", name = "getCustomer",
> targetNamespace = "http://customer.acme.com";)
> GetCustomer parameters
> ) throws CustomerNotFoundFault;
>
> @RequestWrapper(localName = "deleteCustomer2", targetNamespace = "
> http://customer.acme.com";, className =
> "com.acme.customer.DeleteCustomer2") @ResponseWrapper(localName =
> "deleteCustomer2Response", targetNamespace =
> "http://customer.acme.com";, className = "
> com.acme.customer.DeleteCustomer2Response")
> @WebMethod
> public void deleteCustomer2(
> @WebParam(name = "id", targetNamespace =
> "http://customer.acme.com";) long id
> );



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


Re: Illegal Protocol https for HTTP URLConnection Factory

2008-03-03 Thread yulinxp

Is it in here?
http://people.apache.org/repo/m2-incubating-repository
I don't see 2.0.5 snapshot.




I just finished deploying a snapshot.

On Mon, Mar 3, 2008 at 3:27 PM, Daniel Kulp <[EMAIL PROTECTED]> wrote:

>
> Yea.  I hit this while testing your testcase as well.   For some oddball
> reason, using an address like "https" doesn't allow https to actually be
> used.   You MUST configure a TLSClientParameters thing on the conduit
> prior to connecting.   Kind of strange and I'm not exactly sure why.
> Thus, you have to get the TLS thing configured either via spring config
> or programatic config.
>
> In anycase, I fixed it this morning.   :-)I'm going to deploy new
> 2.0.5 and 2.1 snapshots later today.
>
> Dan
>

-- 
View this message in context: 
http://www.nabble.com/Illegal-Protocol-https-for-HTTP-URLConnection-Factory-tp15798054p15814651.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: Illegal Protocol https for HTTP URLConnection Factory

2008-03-03 Thread Daniel Kulp

He deployed a 2.1 snapshot.   I'm about to start a 2.0.5 snapshot.  Will 
hopefully be done in an hour or so.

Dan


On Monday 03 March 2008, yulinxp wrote:
> Is it in here?
> http://people.apache.org/repo/m2-incubating-repository
> I don't see 2.0.5 snapshot.
>
>
>
>
> I just finished deploying a snapshot.
>
> On Mon, Mar 3, 2008 at 3:27 PM, Daniel Kulp <[EMAIL PROTECTED]> wrote:
> > Yea.  I hit this while testing your testcase as well.   For some
> > oddball reason, using an address like "https" doesn't allow https to
> > actually be used.   You MUST configure a TLSClientParameters thing
> > on the conduit prior to connecting.   Kind of strange and I'm not
> > exactly sure why. Thus, you have to get the TLS thing configured
> > either via spring config or programatic config.
> >
> > In anycase, I fixed it this morning.   :-)I'm going to deploy
> > new 2.0.5 and 2.1 snapshots later today.
> >
> > Dan



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


Re: passing a flag from impl method to interceptor

2008-03-03 Thread Daniel Kulp



On Friday 29 February 2008, Daniel Lipofsky wrote:
> Those all sound good, but unfortunately I am pretty much
> a web-services newbie, I don't have a clue how to
> implement that, especially the @WebParam sugestion.
> Do I need some entries in the WSDL, etc?

If you want to define it in the wsdl, you would create a new schema 
element like:


Then to your out message, just add another part like:



And then in your soap binding for the output:



You can see the wsdl in our samples/soap_header dir as an example.

Dan



>
> the old implementation was basically outputing this:
>
>  xmlns:h="http://www.foobar.com/connector-1.5/headers_ns.xsd";>
> 
> false
> 
> ...
>
> or
> ...
> true
> ...
>
> so there are a few involved: a namespace, a node, and
> an attribute.  I don't have to keep it the same, so maybe
> I can make it a lot simplier, I just need to basically
> communicate overflow=[true|false] somehow.
>
> Thanks,
> Dan
>
> On Friday 29 February 2008, Daniel Kulp wrote:
> > Of course, I typed all that and forgot the most obvious way:
> >
> > Just add a parameter to your method like:
> >
> > @WebParam(header = true, mode = Mode.OUT)
> > Holder header
> >
> > Dan
> >
> > On Friday 29 February 2008, Daniel Kulp wrote:
> > > OK.   This is turning into another FAQ type thing that
> >
> > possibly needs
> >
> > > a sample
> > >
> > > There are a couple options open to you:
> > >
> > > First, you need the context injected in:
> > > @Resource
> > > WebServiceContext context;
> > >
> > > 1) Standard JAX-WS API's:  throw the value in the
> > > WebServiceContext and in a SoapHandler, use it to modify the SAAJ
> > > object model.   This is pure JAXWS and would work on any JAX-WS
> > > implementation.  The "problem" is that with the SAAJ model, it
> > > breaks streaming and performance suffers.
> > >
> > > 2) context + CXF interceptor: again, from your impl, throw
> >
> > a value in
> >
> > > the WebServiceContext and then grab that from the message in your
> > > interceptor.   You can then call the
> >
> > soapMessage.getHeaders() thing to
> >
> > > get the list of headers and add a Header object to it.
> > >
> > > 3) Context only: no interceptors needed.  In you impl do:
> > >
> > > context.
> > > ... build a org.apache.cxf.headers.Header object ...
> > > List hdrList = (List)ctx.get(Header.HEADER_LIST));
> > > hdrList.add(hdr);
> > >
> > > And example of this would be our system test that test this:
> >
> > http://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/tes
> >t/
> >
> > >java/org/apache/cxf/systest/outofband/header/
> > >
> > >
> > > 3 is definitely the simplest.   No interceptors needed.  Nothing
> > > really to configure, etc
> > >
> > >
> > > Dan
> > >
> > > On Friday 29 February 2008, Daniel Lipofsky wrote:
> > > > I have a csae where I want to set something in the SOAP
> > > > response header based on what happened in the execution of
> > > > the method implementation.
> > > >
> > > > I suppose I want to extend AbstractSoapInterceptor, but what
> > > > I can't figure out is how to pass a flag from the method
> > > > to the interceptor.  I thought about sticking it in the
> > > > ServletRequest attribute map but I don't see a way to access
> > > > that from the interceptor.  Any way to do it would be fine.
> > > >
> > > > also is there an example of adding an element to a SOAP header?
> > > >
> > > > Thanks,
> > > > Dan



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


RE: request/response wrapper with wsdl2java

2008-03-03 Thread Daniel Lipofsky
First try and read the section in this wiki titled
"How can I switch my generated web service method calls
from wrapper style to non wrapper-style (or vice-versa)?"
http://cwiki.apache.org/confluence/display/CXF20DOC/WSDL+to+Java 

and the related section referenced in the JAX-WS 2.1 specification.

That being said I didn't have too much luck with the
enableWrapperStyle flag.  Instead I am controlling it with
the naming convention - which is case sensitive.  So if I
name the operation "GetObjects" vesus "getObjects" it
changes style from wrapped to unwrapped (either way the
generated java method is called "getObjects").

- Dan


> -Original Message-
> From: Michael Nelson [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, March 01, 2008 6:21 AM
> To: cxf-user@incubator.apache.org
> Subject: request/response wrapper with wsdl2java
> 
> For non-trivial methods, WSDL2Java forces me to deal with 
> request/response
> wrapper classes in the client code it generates (see the 1st method as
> compared to the 2nd method). Is there a way to prevent this?
> 
> Thanks,
> -mike
> 
> Examples:
> 
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> @WebResult(name = "getCustomerResponse", targetNamespace = "
> http://customer.acme.com";, partName = "parameters")
> @WebMethod
> public com.acme.customer.GetCustomerResponse getCustomer(
> @WebParam(partName = "parameters", name = "getCustomer",
> targetNamespace = "http://customer.acme.com";)
> GetCustomer parameters
> ) throws CustomerNotFoundFault;
> 
> @RequestWrapper(localName = "deleteCustomer2", targetNamespace = "
> http://customer.acme.com";, className = 
> "com.acme.customer.DeleteCustomer2")
> @ResponseWrapper(localName = "deleteCustomer2Response", 
> targetNamespace
> = "http://customer.acme.com";, className = "
> com.acme.customer.DeleteCustomer2Response")
> @WebMethod
> public void deleteCustomer2(
> @WebParam(name = "id", targetNamespace = 
> "http://customer.acme.com";)
> long id
> );
> 


RE: passing a flag from impl method to interceptor

2008-03-03 Thread Daniel Lipofsky
So I added a header on the server side using the code below,
I can see the header in client side logging, but how do I
grab it on the client side?  I tried an interceptor but it is
not finding any headers.  What am I doing wrong?

Server side code:

Document d = DOMUtils.createDocument();
Element overflowElem = d.createElement("overflow");
overflowElem.setTextContent(String.valueOf(overflow));
QName q = new QName(SCHEMA_PREFIX + "headers_ns.xsd",
"OverflowHeader", "h");
SoapHeader overflowHeader = new SoapHeader(q, overflowElem);
...
List headers = CastUtils.cast((List)
messageContext.get(Header.HEADER_LIST));
...
headers.add(overflowHeader);


Client side logging shows:

http://schemas.xmlsoap.org/soap/envelope/";>
false
...

Client side code:

class HeaderInterceptor extends AbstractSoapInterceptor {

public HeaderInterceptor() {
super(Phase.READ);
}

public void handleMessage(SoapMessage message) throws Fault {
List headers = message.getHeaders();
if(headers.size() == 0) {
log.info("HEADER.size = 0");
return;
}
for (int i = 0; i < headers.size(); i++) {
log.info("HEADER " + i + ": " + headers.get(i).getName());
}
}
}

Thanks,
Dan


> -Original Message-
> From: Daniel Lipofsky [mailto:[EMAIL PROTECTED] 
> Sent: Friday, February 29, 2008 1:23 PM
> To: cxf-user@incubator.apache.org
> Subject: RE: passing a flag from impl method to interceptor
> 
> Those all sound good, but unfortunately I am pretty much
> a web-services newbie, I don't have a clue how to
> implement that, especially the @WebParam sugestion.
> Do I need some entries in the WSDL, etc?
> 
> the old implementation was basically outputing this:
> 
>  xmlns:h="http://www.foobar.com/connector-1.5/headers_ns.xsd";>
> 
> false
> 
> ...
> 
> or
> ...
> true
> ...
> 
> so there are a few involved: a namespace, a node, and
> an attribute.  I don't have to keep it the same, so maybe
> I can make it a lot simplier, I just need to basically
> communicate overflow=[true|false] somehow.
> 
> Thanks,
> Dan
> 
> On Friday 29 February 2008, Daniel Kulp wrote:
> > 
> > Of course, I typed all that and forgot the most obvious way:
> > 
> > Just add a parameter to your method like:
> > 
> > @WebParam(header = true, mode = Mode.OUT)
> > Holder header
> > 
> > Dan
> > 
> > 
> > 
> > On Friday 29 February 2008, Daniel Kulp wrote:
> > > OK.   This is turning into another FAQ type thing that 
> > possibly needs
> > > a sample
> > >
> > > There are a couple options open to you:
> > >
> > > First, you need the context injected in:
> > > @Resource
> > > WebServiceContext context;
> > >
> > > 1) Standard JAX-WS API's:  throw the value in the 
> WebServiceContext
> > > and in a SoapHandler, use it to modify the SAAJ object 
> model.   This
> > > is pure JAXWS and would work on any JAX-WS implementation.  The
> > > "problem" is that with the SAAJ model, it breaks streaming and
> > > performance suffers.
> > >
> > > 2) context + CXF interceptor: again, from your impl, throw 
> > a value in
> > > the WebServiceContext and then grab that from the message in your
> > > interceptor.   You can then call the 
> > soapMessage.getHeaders() thing to
> > > get the list of headers and add a Header object to it.
> > >
> > > 3) Context only: no interceptors needed.  In you impl do:
> > >
> > > context.
> > > ... build a org.apache.cxf.headers.Header object ...
> > > List hdrList = (List)ctx.get(Header.HEADER_LIST));
> > > hdrList.add(hdr);
> > >
> > > And example of this would be our system test that test this:
> > > 
> > 
> http://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/
> > >java/org/apache/cxf/systest/outofband/header/
> > >
> > >
> > > 3 is definitely the simplest.   No interceptors needed.  Nothing
> > > really to configure, etc
> > >
> > >
> > > Dan
> > >
> > > On Friday 29 February 2008, Daniel Lipofsky wrote:
> > > > I have a csae where I want to set something in the SOAP
> > > > response header based on what happened in the execution of
> > > > the method implementation.
> > > >
> > > > I suppose I want to extend AbstractSoapInterceptor, but what
> > > > I can't figure out is how to pass a flag from the method
> > > > to the interceptor.  I thought about sticking it in the
> > > > ServletRequest attribute map but I don't see a way to access
> > > > that from the interceptor.  Any way to do it would be fine.
> > > >
> > > > also is there an example of adding an element to a SOAP header?
> > > >
> > > > Thanks,
> > > > Dan
> 


Re: CXF 2.0.4 and Websphere version 6.1.0.9 with WS feature pack

2008-03-03 Thread Satishstp

I have followed all instructions for Websphere from the CXF Wiki site. I
think there seems to be some conflict between CXF and Websphere -Web
services Feature Pack installation. If I uninstall Web Services Feature Pack
then I don’t get any errors.

Satish


dkulp wrote:
> 
> 
>> WSWS4100E: Method createFault() of class javax.xml.soap.SOAPFactory is
>> not supported in SAAJ 1.2.
>>
> 
> That's the error the concerns me the most.   Looks like WebSphere has an 
> old version of SAAJ or something.  JAX-WS requires SAAJ 1.3, not 1.2.   
> 
> I hate to ask a silly question, but have you followed all the 
> instructions for WebSphere at:
> http://cwiki.apache.org/CXF20DOC/appserverguide.html
> 
> Dan
> 
> 
> 
> On Friday 29 February 2008, Satishstp wrote:
>> Thank you, removing the wstx-asl jar worked for me on the service. But
>> the client is throwing following exception after getting the response
>> back from the service.
>>
>> Feb 29, 2008 4:29:18 PM org.apache.cxf.phase.PhaseInterceptorChain
>> doIntercept
>> INFO: Interceptor has thrown exception, unwinding now
>> org.apache.cxf.interceptor.Fault: Could not create
>> XMLStreamReader(encoding UTF-8).
>>  at
>> org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInter
>>ceptor.java:67) at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
>>rChain.java:208) at
>> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429) at
>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRe
>>sponse(HTTPConduit.java:1955) at
>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HT
>>TPConduit.java:1791) at
>> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66
>>) at
>> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
>> at
>> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndin
>>gInterceptor.handleMessage(MessageSenderInterceptor.java:62) at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
>>rChain.java:208) at
>> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276) at
>> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222) at
>> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135
>>) at $Proxy25.getEmployee(Unknown Source)
>>  at com.xyz.auth.client.Client.main(Client.java:32)
>> Caused by: javax.xml.stream.XMLStreamException: java.io.IOException:
>> stream is closed
>>  at
>> com.ibm.xml.xlxp.api.stax.msg.StAXMessageProvider.throwXMLStreamExcept
>>ion(StAXMessageProvider.java:63) at
>> com.ibm.xml.xlxp.api.stax.XMLStreamReaderImpl.setDocumentEntity(XMLStr
>>eamReaderImpl.java:313) at
>> com.ibm.xml.xlxp.api.stax.XMLStreamReaderImpl.(XMLStreamReaderIm
>>pl.java:298) at
>> com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl.createXMLStreamReader(XM
>>LInputFactoryImpl.java:1005) at
>> com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl.createXMLStreamReaderInt
>>ernal(XMLInputFactoryImpl.java:1115) at
>> com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl.createXMLStreamReader(XM
>>LInputFactoryImpl.java:1182) at
>> org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInter
>>ceptor.java:65) ... 14 more
>> Caused by: java.io.IOException: stream is closed
>>  at
>> sun.net.www.http.ChunkedInputStream.ensureOpen(ChunkedInputStream.java
>>:182) at
>> sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:661)
>> at java.io.FilterInputStream.read(FilterInputStream.java:134) at
>> sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpU
>>RLConnection.java:2186) at
>> sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpU
>>RLConnection.java:2181) at
>> sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpU
>>RLConnection.java:2170) at
>> com.ibm.xml.xlxp.api.util.encoding.UTF8EncodingSupport.checkUTF8BOM(UT
>>F8EncodingSupport.java:118) at
>> com.ibm.xml.xlxp.api.util.encoding.UTF8EncodingSupport.load(UTF8Encodi
>>ngSupport.java:77) at
>> com.ibm.xml.xlxp.api.util.encoding.ByteStreamDataSource.load(ByteStrea
>>mDataSource.java:72) at
>> com.ibm.xml.xlxp.api.util.encoding.UTF8EncodingSupport.loadFromByteStr
>>eam(UTF8EncodingSupport.java:61) at
>> com.ibm.xml.xlxp.api.util.SimpleParsedEntityFactory.loadFromByteStream
>>(SimpleParsedEntityFactory.java:325) at
>> com.ibm.xml.xlxp.api.util.SimpleParsedEntityFactory.setByteStreamSourc
>>e(SimpleParsedEntityFactory.java:146) at
>> com.ibm.xml.xlxp.api.sax.impl.SAX2ParsedEntityFactory.readFromInputSou
>>rce(SAX2ParsedEntityFactory.java:150) at
>> com.ibm.xml.xlxp.api.sax.impl.SAX2ParsedEntityFactory.createParsedEnti
>>ty(SAX2ParsedEntityFactory.java:75) at
>> com.ibm.xml.xlxp.api.stax.XMLStreamReaderImpl.setDocumentEntity(XMLStr
>>eamReaderImpl.java:311) ... 19 more
>> WSWS4100E: Method createFault() of class javax.xml.soap.SOAPFactory is
>> not supported in SAAJ 1.2.
>>
>> dkulp wrote:
>> > Int

Re: passing a flag from impl method to interceptor

2008-03-03 Thread Daniel Kulp



On Monday 03 March 2008, Daniel Lipofsky wrote:
> So I added a header on the server side using the code below,
> I can see the header in client side logging, but how do I
> grab it on the client side?  I tried an interceptor but it is
> not finding any headers.  What am I doing wrong?

READ phase is propably too early.   They probably haven't been read yet.   
Change the phase to USER_LOGICAL.

That said, on the client side, like the server side, you don't need the 
interceptor.   

((BindingProvider)proxy).getResponseContext().get(Header.HEADER_LIST);

should return the List objects.

One more note though:  header elements SHOULD be namespace qualfied per 
the soap spec.   You aren't putting the overflow element into a 
namespace when you create it so many toolkits may have issues with that.   
Use the createElementNS call.

Dan



>
> Server side code:
>
> Document d = DOMUtils.createDocument();
> Element overflowElem = d.createElement("overflow");
> overflowElem.setTextContent(String.valueOf(overflow));
> QName q = new QName(SCHEMA_PREFIX + "headers_ns.xsd",
> "OverflowHeader", "h");
> SoapHeader overflowHeader = new SoapHeader(q, overflowElem);
> ...
> List headers = CastUtils.cast((List)
> messageContext.get(Header.HEADER_LIST));
> ...
> headers.add(overflowHeader);
>
>
> Client side logging shows:
>
> http://schemas.xmlsoap.org/soap/envelope/";>
> false
> ...
>
> Client side code:
>
> class HeaderInterceptor extends AbstractSoapInterceptor {
>
> public HeaderInterceptor() {
> super(Phase.READ);
> }
>
> public void handleMessage(SoapMessage message) throws Fault {
> List headers = message.getHeaders();
> if(headers.size() == 0) {
> log.info("HEADER.size = 0");
> return;
> }
> for (int i = 0; i < headers.size(); i++) {
> log.info("HEADER " + i + ": " + headers.get(i).getName());
> }
> }
> }
>
> Thanks,
> Dan
>
> > -Original Message-
> > From: Daniel Lipofsky [mailto:[EMAIL PROTECTED]
> > Sent: Friday, February 29, 2008 1:23 PM
> > To: cxf-user@incubator.apache.org
> > Subject: RE: passing a flag from impl method to interceptor
> >
> > Those all sound good, but unfortunately I am pretty much
> > a web-services newbie, I don't have a clue how to
> > implement that, especially the @WebParam sugestion.
> > Do I need some entries in the WSDL, etc?
> >
> > the old implementation was basically outputing this:
> >
> >  > xmlns:h="http://www.foobar.com/connector-1.5/headers_ns.xsd";>
> > 
> > false
> > 
> > ...
> >
> > or
> > ...
> > true
> > ...
> >
> > so there are a few involved: a namespace, a node, and
> > an attribute.  I don't have to keep it the same, so maybe
> > I can make it a lot simplier, I just need to basically
> > communicate overflow=[true|false] somehow.
> >
> > Thanks,
> > Dan
> >
> > On Friday 29 February 2008, Daniel Kulp wrote:
> > > Of course, I typed all that and forgot the most obvious way:
> > >
> > > Just add a parameter to your method like:
> > >
> > > @WebParam(header = true, mode = Mode.OUT)
> > > Holder header
> > >
> > > Dan
> > >
> > > On Friday 29 February 2008, Daniel Kulp wrote:
> > > > OK.   This is turning into another FAQ type thing that
> > >
> > > possibly needs
> > >
> > > > a sample
> > > >
> > > > There are a couple options open to you:
> > > >
> > > > First, you need the context injected in:
> > > > @Resource
> > > > WebServiceContext context;
> > > >
> > > > 1) Standard JAX-WS API's:  throw the value in the
> >
> > WebServiceContext
> >
> > > > and in a SoapHandler, use it to modify the SAAJ object
> >
> > model.   This
> >
> > > > is pure JAXWS and would work on any JAX-WS implementation.  The
> > > > "problem" is that with the SAAJ model, it breaks streaming and
> > > > performance suffers.
> > > >
> > > > 2) context + CXF interceptor: again, from your impl, throw
> > >
> > > a value in
> > >
> > > > the WebServiceContext and then grab that from the message in
> > > > your interceptor.   You can then call the
> > >
> > > soapMessage.getHeaders() thing to
> > >
> > > > get the list of headers and add a Header object to it.
> > > >
> > > > 3) Context only: no interceptors needed.  In you impl do:
> > > >
> > > > context.
> > > > ... build a org.apache.cxf.headers.Header object ...
> > > > List hdrList =
> > > > (List)ctx.get(Header.HEADER_LIST)); hdrList.add(hdr);
> > > >
> > > > And example of this would be our system test that test this:
> >
> > http://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/tes
> >t/
> >
> > > >java/org/apache/cxf/systest/outofband/header/
> > > >
> > > >
> > > > 3 is definitely the simplest.   No interceptors needed.  Nothing
> > > > really to configure, etc
> > > >
> > > >
> > > > Dan
> > > >
> > > > On Friday 29 February 2008, Daniel Lipofsky wrote:
> > > > > I have a csae where I want to set something in the SOAP
> > > > > response header ba

2.1 javadoc posted

2008-03-03 Thread Benson Margulies
http://incubator.apache.org/cxf/javadoc/2.1-SNAPSHOT/


Re: CXF confuses operations

2008-03-03 Thread Glen Mazza
That's not WS-I Basic Profile compliant, because for many web service
stacks, it is the parameters that are used to determine which operation
is called.If you run wsdl2java with the validation option you should
see a warning to that effect.  Metro also would complain about that,
although they provide an override option accepting that I believe.

Glen

Am Sonntag, den 02.03.2008, 14:28 -0500 schrieb Scott Anderson:
> If I create two operations with different messages, but which have the
> parameters of the same name (which are unwrapped), CXF is unable to
> distinguish which operation I was referring to, despite it being specified
> in the POST URL. Is there any good solution to this, other than using GET or
> changing the parameter names?
> Thanks
> Scott



Re: CXF & Spring Transactions

2008-03-03 Thread Glen Mazza
Can you mock out the web service calls to confirm that it is CXF eating
up your DBCP pool and nothing something else?

Glen

Am Montag, den 03.03.2008, 13:19 -0800 schrieb Michael McCaskill:
> I'm coming from Spring-Webservices. I like that CXF supports contract-last
> since I'm in a prototype, rapid development phase for my work project. But
> I've noticed that weird things happen when using CXF with Spring
> Transactions.
> 
> It appears that after so many web service calls, the DBCP pool is exhausted
> and connections aren't returned. This wasn't happening with
> Spring-Webservices. I've tried the 2.1-incubator-SNAPSHOT as well. It needs
> to be said that I am filtering out the Spring-2.0.6 dependencies and opting
> for 2.5. I'm using Spring's @Transactional annotation, JAXB,
> JaxWsProxyFactoryBean on client, jaxws:endpoint on server, Hibernate 3.1 and
> Oracle 9.2.0.8.



Re: service caching

2008-03-03 Thread Christopher Cheng
I haven't read the codes of Axis, but I have been using it for 2 years and
it doesn't have this problem.
Having an overhead for 5-8 seconds is not an option for a production system
in term of performance

What you are saying is that all the services must implement Clonable
interface?

On Tue, Mar 4, 2008 at 4:48 AM, Daniel Kulp <[EMAIL PROTECTED]> wrote:

>
> Christopher,
>
> We cannot just "reuse" the Service model objects as they are completely
> modifiable at runtime. For example, one proxy could be reconfigured with
> new address or have additional interceptors added or similar.  Those
> shouldn't affect others.
>
> On option that propably would make sense is to add a fast "clone"
> functionality to the entire service model so we could cache one, and
> then clone it whenever one is really needed.   All the individual
> versions could be modified and not affect the original.   However, doing
> that would be quite a bit of work as there are a LOT of classes that
> would need to be updated to support that.
>
> Patches towards that end would be great.   :-)
>
> Dan
>
>
> On Monday 03 March 2008, Christopher Cheng wrote:
> > wsdl is indeed cached in WSDLManagerImpl.definitionsMap
> >
> > After reading the codes, I have some questions. My workstation is a
> > PentiumD 3GHz with 1.5GB RAM
> >
> > In the class
> > "org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServ
> >iceFromWSDL(String url)",
> > "setService(factory.create());" takes 3 seconds
> > "getDataBinding().initialize(getService());" takes 2 seconds
> >
> > These 2 methods are called even in 2nd calls. Can you also cache the
> > services perhaps using jakarta commons-pool? or eh-cache?
> >
> > By the way, I found that the wsdl is put into the definitionMap twice
> > if " WSDLManagerImpl.getDefinition(URL url)" is called. First in
> > "getDefintion(URL url)" at line 147 and second in
> > "loadDefinition(String url)" at line 201.
> >
> >
> > On Mon, Mar 3, 2008 at 4:22 PM, Christopher Cheng <
> >
> > [EMAIL PROTECTED]> wrote:
> > > wsdl is indeed cached in WSDLManagerImpl.definitionsMap
> > >
> > > After reading the codes, I have some questions. My workstation is a
> > > PentiumD 3GHz with 1.5GB RAM
> > >
> > > In the class "
> > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildSer
> > >viceFromWSDL(String url)",
> > > "setService(factory.create());" takes 3 seconds
> > > "getDataBinding().initialize(getService());" takes 2 seconds
> > >
> > > These 2 methods are called even in 2nd calls. Can you also cache the
> > > services perhaps using jakarta commons-pool? or eh-cache?
> > >
> > > By the way, I found that the wsdl is put into the definitionMap
> > > twice if " WSDLManagerImpl.getDefinition(URL url)" is called. First
> > > in "getDefintion(URL url)" at line 147 and second in
> > > "loadDefinition(String url)" at line 201.
> > >
> > >
> > >
> > > On Mon, Mar 3, 2008 at 9:43 AM, Willem Jiang
> > > <[EMAIL PROTECTED]>
> > >
> > > wrote:
> > > > Hi,
> > > >
> > > > I just went through the code, we really cache the WSDL definition
> > > > in CXF.
> > > > Could you send your test case and wsdl file to me ? I may need to
> > > > trace it for more information.
> > > >
> > > > Regards,
> > > >
> > > > Willem
> > > >
> > > > Christopher Cheng wrote:
> > > > > I think the issue is still there. I used a for loop to execute
> > > > > the
> > > >
> > > > same
> > > >
> > > > > call, all takes approximately the same time to create service. I
> > > > > guess
> > > >
> > > > that
> > > >
> > > > > the service itself is not cached.
> > > > >
> > > > > On Sun, Mar 2, 2008 at 11:43 AM, Willem Jiang
> > > > > <[EMAIL PROTECTED]>
> > > > >
> > > > > wrote:
> > > > >> Here is the JIRA[1] which describe the same thing that you
> > > > >> want. I don't know if it was really resolved, could you try the
> > > > >> latest released CXF 2.0.4 for it.
> > > > >>
> > > > >> If the issue is still there, please let me know , I will put it
> > > > >> to my next week todo list.
> > > > >>
> > > > >> [1]https://issues.apache.org/jira/browse/CXF-699
> > > > >> [2]http://cwiki.apache.org/CXF/download.html
> > > > >>
> > > > >> Willem.
> > > > >>
> > > > >> Christopher Cheng wrote:
> > > > >>> I am migrating from Axis1.2 to CXF 2.0.3
> > > > >>>
> > > > >>> I understand that it will take a long time to build for the
> > > > >>> first
> > > >
> > > > time.
> > > >
> > > > >> What
> > > > >>
> > > > >>> I am wondering is that why it takes so long for the second and
> > > > >>> third
> > > > >>
> > > > >> time?
> > > > >>
> > > > >>> Is there any caching of services? Axis does not seem to have
> > > > >>> this
> > > >
> > > > issue.
> > > >
> > > > >>> Christopher Cheng wrote:
> > > >  Attached is the log
> > > > 
> > > >  - Original Message -
> > > >  From: "Willem Jiang" <[EMAIL PROTECTED]>
> > > >  To: 
> > > >  Sent: Saturday, March 01, 2008 8:53 PM
> > > >  Subject: Re: service caching?
> > > > 
> > > > > H