Re: How to get HttpURLConnection of Dispatch client

2010-03-09 Thread Andrew Clegg


Eoghan Glynn-4 wrote:
> 
> Yes that exactly the sort of thing I had in mind.
> 
> The exact phase isn't really that important in this case, as the real
> action
> occurs asynchronously, presumably a relatively long time after *all* the
> outbound phases have been traversed. (Assuming the timeout is
> realistically
> long)
> 

Okay, great. When it's been in production for a bit and I'm happy there's no
hidden gotchas, I'll submit it for consideration via JIRA.

Thanks for your help,

Andrew.

-- 
View this message in context: 
http://old.nabble.com/How-to-get-HttpURLConnection-of-Dispatch-client-tp27834705p27839084.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: How to get HttpURLConnection of Dispatch client

2010-03-09 Thread Andrew Clegg


Eoghan Glynn-4 wrote:
> 
> However the HTTPConduit does cache the current connection in the
> HTTPConduit.KEY_HTTP_CONNECTION
> property (i.e. "http.connection") property on the message object, so you
> could experiment by writing an interceptor that retrieves the value of
> this
> property and manipulates the connection directly.
> 

Is this the kind of thing you mean?

http://pastebin.com/yxkwULAK

It seems to work so far but I need to test it a bit more thoroughly to make
sure it's not doing anything completely unexpected. I'd appreciate any
feedback about whether it's attached to the right phase (PRE_STREAM) too, as
I'm not too familiar with interceptors.

Thanks,

Andrew.

-- 
View this message in context: 
http://old.nabble.com/How-to-get-HttpURLConnection-of-Dispatch-client-tp27834705p27838542.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: How to get HttpURLConnection of Dispatch client

2010-03-09 Thread Andrew Clegg


Eoghan Glynn-4 wrote:
> 
> The HTTPURLConnection is retrieved on demand when the invocation is being
> prepared. So its not statically associated with the interceptor chain.
> 
> However the HTTPConduit does cache the current connection in the
> HTTPConduit.KEY_HTTP_CONNECTION
> property (i.e. "http.connection") property on the message object, so you
> could experiment by writing an interceptor that retrieves the value of
> this
> property and manipulates the connection directly.
> 

Okay, thanks, I'll try that. It's a bit of a shame that there's no way to
force an ongoing request to abort. Would you be interested in a patch? Or is
this use case too unusual?

Cheers,

Andrew.

-- 
View this message in context: 
http://old.nabble.com/How-to-get-HttpURLConnection-of-Dispatch-client-tp27834705p27837275.html
Sent from the cxf-user mailing list archive at Nabble.com.



How to get HttpURLConnection of Dispatch client

2010-03-09 Thread Andrew Clegg

Hi,

Given a Dispatch that's been invoked asynchronously (or in another thread,
manually) -- is it possible to get at the underlying HttpURLConnection that
it's using?

I can see how you get to the Conduit but then I get a bit stuck.

Here's the reason I'm asking:

I'm having trouble with a misbehaving remote SOAP service that sends regular
XML comments in the response stream while it's 'thinking', i.e.:



... but sometimes goes wrong and never returns the proper results. This
means that my client sits waiting and taking up resources for hours.

The httpClientPolicy.setReceiveTimeout() method doesn't help in this case,
as it sets the read timeout of the connection -- and the javadocs for
URLConnection say:

"A non-zero value specifies the timeout when reading from Input stream when
a connection is established to a resource. If the timeout expires before
there is data available for read, a java.net.SocketTimeoutException is
raised."

In this particular case, because of the comments sent by the service,
there's data to read, so the service never times out.

What I'd like to do instead is have a timer that forcibly disconnects after
a particular timeout. However, it doesn't respond to interrupting the
thread, so I need to get to the connection, close its streams and
disconnect. Otherwise, it will just sit there, taking up a thread pool slot,
some memory and a socket, until the service at the other end finally gives
up. And -- strictly speaking -- I have no guarantee that it ever will.

Any ideas?

Thanks,

Andrew.


-- 
View this message in context: 
http://old.nabble.com/How-to-get-HttpURLConnection-of-Dispatch-client-tp27834705p27834705.html
Sent from the cxf-user mailing list archive at Nabble.com.



ServiceConstructionException when upgrading to 2.2.5

2009-11-20 Thread Andrew Clegg

Hi everyone,

I just upgraded an old service that was running on 2.2.2 to 2.2.5, and it
didn't start. I got the Tomcat error page appended to the bottom of this
email. (At the bottom it says the full stacktrace is in the logs, but
actually it isn't, it's all on that page.)

Any idea what else I might need to do to make my service 2.2.5-compliant?
>From the stacktrace it looks like it's failing to pick up the WSDL from
inside the JAR file, maybe. My cxf-servlet.xml has the service defined
thusly:

   

and the WSDL is in src/main/webapp/WEB-INF/wsdl/ . This is with Maven, this
setup worked fine before.

Thanks,

Andrew.

Stacktrace follows:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

javax.servlet.ServletException: Servlet.init() for servlet WebServicePort
threw exception

org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)

root cause

org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'FrontEndService': Invocation of init method failed; nested
exception is javax.xml.ws.WebServiceException:
org.apache.cxf.service.factory.ServiceConstructionException: Failed to
create service.

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)

org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)

org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)

org.apache.cxf.transport.servlet.CXFServlet.loadAdditionalConfig(CXFServlet.java:166)

org.apache.cxf.transport.servlet.CXFServlet.updateContext(CXFServlet.java:134)

org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:101)
org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:70)

org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFServlet.java:78)

org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)

root cause

javax.xml.ws.WebServiceException:
org.apache.cxf.service.factory.ServiceConstructionException: Failed to
create service.
org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:275)
org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209)
org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:404)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowir

Re: Example wsdl2java catalog file

2009-08-18 Thread Andrew Clegg
2009/8/18 Shannon Hastings :
> I am looking for an example of the format of the wsdl2java catalog file.  I
> notice it has an option to take a catalog file and I am curious if this is a
> file where a list of namespace to package mapping can live and if so what is
> the format of this file.

AFAIK this is passed straight through to xjc, so try here:

https://jaxb.dev.java.net/guide/Fixing_broken_references_in_schema.html

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Design questions CXF//my need

2009-08-13 Thread Andrew Clegg
I'm not sure about some of your questions as I've only worked in
WSDL-first SOAP services. I'm sure others can help with these though.

2009/8/13 Live Nono :

> - feeding the service with my own Guice managed objects

Yes. There's no direct integration (CXF uses Spring for DI, not
Guice), but you can create an Injector in your service implementation
object's constructor and then do an injectMembers( this ) or whatever
to bring up the rest of your object graph.

Or you could try it via the Spring/Guice integration approach:

http://www.jroller.com/mindcrime/entry/an_example_of_integrating_guice

> - making it available through my own web application (namely a wicket one)

Not sure what you mean here -- do you want a single web app to contain
wicket stuff and CXF stuff? It's probably more flexible to build them
into separate WARs that you can deploy alongside each other. But it
may be possible to do this (anyone?).

> - integration with maven and m2eclipse

Yes, this works very well.

> (ability to launch my web
> service as a Java embedded app from eclipse would be a bonus)

Umm, not sure...

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Asynchronous Invocation and connection keep alive on the TCP level

2009-08-06 Thread Andrew Clegg
2009/8/5 conficio :

> My question is: Does the asynchronous Web service some active polling across
> the TCP connection to keep it alive? Is that the solution I'm looking for,
> Asynchronous invocation?

I'm happy to be corrected if wrong, but I believe the actual TCP
conversation is basically the same for CXF sync/async service
invocation, it just *appears* to work asynchronously from the POV of
the client code.

For really long-running jobs you are probably better off doing proper
server-side asynchronous services with persistent state, like this:

http://www.jroller.com/gmazza/entry/creating_service_side_asynchronous_web

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Error after turning on Schema Validation

2009-08-01 Thread Andrew Clegg
Well it *sounds* like the WSDL defines an element called arg0 in one
of the operations that your SOAP message doesn't contain, but it's a
bit hard to say more without seeing the WSDL and the SOAP message in
question :-)

Andrew.

2009/8/1 Suneet Shah :
> Hello,
>
> I am getting the following error after turning on schema validation in my
> services.
> I am using SoapUI to test the services. What am I doing wrong and how I can
> get past this?
>
> thanks
>
> Aug 1, 2009 12:38:10 AM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept
> INFO: Interceptor has thrown exception, unwinding now
>  org.apache.cxf.interceptor.Fault: Unmarshalling Error: cvc-elt.1: Cannot
> find the declaration of element 'arg0'.
>       at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:622)
>       at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:527)
>       at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:114)
>       at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.getPara(DocLiteralInInterceptor.java:242)
>       at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:120)
>       at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>       at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
>       at
> org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)
>



-- 
:: http://biotext.org.uk/ ::


Re: Namespace problem in webservice response

2009-07-29 Thread Andrew Clegg
2009/7/29 amit_9b :

> So the soap response I desire is :
>  DESIRED RESPONSE 
> http://schemas.xmlsoap.org/soap/envelope/";>
>  
>    http://prime.simplesoft.org/2009/xsd";>
>      
>        Near Neighbors
>        Find near neighbors in cpd collection
>        
>           id="1">
>            LSN of gili near neighbors
>          
>          
>            Structure of near neighbors
>          
>        
>      
>      
>        gili Near Neighbors 2
>        Find near neighbors in gili cpd
> collection
>        
>           id="1">
>            LSN of gili near neighbors
>          
>          
>            Structure of gili near neighbors
>          
>        
>      
>    
>  
> 
>  DESIRED RESPONSE ENDS

This doesn't make sense. You're declaring a namespace prefix 'ns2' and
then never referring to it. Why would you want to do that?

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: webservice with cxf, spring, hibernate: Application has thrown exception

2009-07-28 Thread Andrew Clegg
2009/7/28 homer84 :

> The problem is with the webservice: I've been trying it with soapUI3.0 and I
> only get this error (without much details):
>
> org.apache.cxf.phase.PhaseInterceptorChain doIntercept INFO: Application has
> thrown exception, unwinding now org/hibernate/Session

Is this the whole text of the exception? It looks like it's been
truncated somewhere.

Check the server logs (e.g. catalina.out or catalina.*.log if you're
using Tomcat) to see if you can find the error in there -- it should
have the full text plus a stacktrace. There's no way to tell what's
wrong from pom.xml, that's just Maven project configuration stuff.

BTW you posted the exact same message 3 times so far...

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: JAX-WS Client Exceptions (that do not propagate to the Web Container)

2009-07-23 Thread Andrew Clegg
Doesn't *any* exception thrown during invocation of a web method get
sent to the client without reaching the container?

This is my understanding anyway.

Andrew.

2009/7/23 robertojimen...@terra.es :
> What is the correct way in JAX-WS to throw exceptions to the Client (or 
> caller) and not propagate to my Web Container?
> (In JAX-RS javax.ws.rs.WebApplicationException does the equivalent of what I 
> want)
>
>
> Ahora tambi�n puedes acceder a tu correo Terra desde el m�vil.
> Inf�rmate pinchando aqu�.
>
>
>



-- 
:: http://biotext.org.uk/ ::


Re: Thanks to the Committers

2009-07-23 Thread Andrew Clegg
2009/7/22 Ron Grimes :
> Dan, Benson, Sergey, et al,
>
> Just wanted to let you guys (the committers) know that you do a great
> job and all of your support is greatly appreciated.

Hear hear! Out of all the open-source tools I use, CXF has by far the
best community support, and your engagement with us users is great.

Keep up the good work :-)

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Array out of bounds deep in JVM setting up endpoint?

2009-07-16 Thread Andrew Clegg
It's a long shot admittedly...

I found an ArrayIndexOutOfBoundsException while publishing an endpoint once:

https://issues.apache.org/jira/browse/CXF-1852

... but the stracktrace does look very different.

Andrew.

2009/7/15 Benson Margulies :
> run webapp [Program]
>        /Users/benson/x/trunk/third-party-tools/maven/bin/mvn
> webapp [Remote Java Application]
>        Java HotSpot(TM) Client VM[localhost:4000]
>                Thread [main] (Suspended (exception 
> ArrayIndexOutOfBoundsException))
>                        SignatureParser.current() line: 79 [local variables 
> unavailable]
>                        SignatureParser.parseSuperInterfaces() line: 424
>                        SignatureParser.parseClassSignature() line: 171
>                        SignatureParser.parseClassSig(String) line: 126
>                        ClassRepository.parse(String) line: 34
>                        ClassRepository.parse(String) line: 23
>                        ClassRepository(AbstractRepository).(String,
> GenericsFactory) line: 56
>                        
> ClassRepository(GenericDeclRepository).(String,
> GenericsFactory) line: 30
>                        ClassRepository.(String, GenericsFactory) line: 
> 30
>                        ClassRepository.make(String, GenericsFactory) line: 47
>                        Class.getGenericInfo() line: 
>                        Class.getTypeParameters() line: 615
>                        ParameterizedTypeImpl.validateConstructorArguments() 
> line: 39
>                        ParameterizedTypeImpl.(Class, Type[], Type) 
> line: 35
>                        ParameterizedTypeImpl.make(Class, Type[], Type) 
> line: 77
>                        CoreReflectionFactory.makeParameterizedType(Type, 
> Type[], Type) line: 86
>                        Reifier.visitClassTypeSignature(ClassTypeSignature) 
> line: 122
>                        ClassTypeSignature.accept(TypeTreeVisitor) line: 31
>                        ClassRepository.getSuperclass() line: 66
>                        Class.getGenericSuperclass() line: 671
>                        GenericTypeResolver.getTypeVariableMap(Class) line: 154
>                        GenericTypeResolver.resolveReturnType(Method, Class) 
> line: 99
>                        GenericTypeAwarePropertyDescriptor.getPropertyType() 
> line: 76
>                        TypeConverterDelegate.convertIfNecessary(Object, 
> Object,
> PropertyDescriptor) line: 138
>                        BeanWrapperImpl.convertForProperty(Object, String) 
> line: 386
>                        
> DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).convertForProperty(Object,
> String, BeanWrapper, TypeConverter) line: 1288
>                        
> DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).applyPropertyValues(String,
> BeanDefinition, BeanWrapper, PropertyValues) line: 1249
>                        
> DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).populateBean(String,
> AbstractBeanDefinition, BeanWrapper) line: 1010
>                        
> DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).doCreateBean(String,
> RootBeanDefinition, Object[]) line: 472
>                        AbstractAutowireCapableBeanFactory$1.run() line: 409
>                        AccessController.doPrivileged(PrivilegedAction,
> AccessControlContext) line: not available [native method]
>                        
> DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).createBean(String,
> RootBeanDefinition, Object[]) line: 380
>                        BeanDefinitionValueResolver.resolveInnerBean(Object, 
> String,
> BeanDefinition) line: 219
>                        
> BeanDefinitionValueResolver.resolveValueIfNecessary(Object, Object)
> line: 117
>                        
> DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).applyPropertyValues(String,
> BeanDefinition, BeanWrapper, PropertyValues) line: 1245
>                        
> DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).populateBean(String,
> AbstractBeanDefinition, BeanWrapper) line: 1010
>                        
> DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).doCreateBean(String,
> RootBeanDefinition, Object[]) line: 472
>                        AbstractAutowireCapableBeanFactory$1.run() line: 409
>                        AccessController.doPrivileged(PrivilegedAction,
> AccessControlContext) line: not available [native method]
>                        
> DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).createBean(String,
> RootBeanDefinition, Object[]) line: 380
>                        AbstractBeanFactory$1.getObject() line: 264
>                        
> DefaultListableBeanFactory(DefaultSingletonBeanRegistry).getSingleton(String,
> ObjectFactory) line: 221
>                        
> DefaultListableBeanFactory(AbstractBeanFactory).doGetBean(String,
> Class, Object[], boolean) line: 261
>        

Re: begginer - java version

2009-07-16 Thread Andrew Clegg
Sorry, I meant what is the problem with Java 6?

2009/7/16 Andrew Clegg :
> 2009/7/15 Seba González :
>> I'm using for first CXF. When I tried the "A simple JAX-WS service"
>> sample, I had to run it in java 5. Then I tried to implement something
>> like that in my project, but it's hard to move my project to v5. So, is
>> it possible to migrate the sample to java 6?
>
> We use CXF with Java 6 extensively. What is the problem you get when
> you try to use it with 5?
>
> Andrew.
>
> --
> :: http://biotext.org.uk/ ::
>



-- 
:: http://biotext.org.uk/ ::


Re: begginer - java version

2009-07-16 Thread Andrew Clegg
2009/7/15 Seba González :
> I'm using for first CXF. When I tried the "A simple JAX-WS service"
> sample, I had to run it in java 5. Then I tried to implement something
> like that in my project, but it's hard to move my project to v5. So, is
> it possible to migrate the sample to java 6?

We use CXF with Java 6 extensively. What is the problem you get when
you try to use it with 5?

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: CXF is WSI Basci Profile 1.1 compliant?

2009-07-14 Thread Andrew Clegg
2009/7/14 Kid_79 :
>
> Hi all,
> Where I can to see if CXF is WSI Basci Profile 1.1 compliant?
>
> I try in internet but I have not found exactly the answer.

It's not up to CXF to enforce WS-I BP compliance. You can build all
kinds of web services with CXF, especially if you use the
Provider/Dispatch model (raw XML)... But you *can* build BP compliant
services with it.

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Schema Validation in CXF

2009-07-06 Thread Andrew Clegg
This is a FAQ!

http://cxf.apache.org/faq.html

Andrew.

2009/7/6 Suneet Shah :
> Hello
>
> I have service that I have created with CXF 2.2.1 / JAX-WS annotations and
> deployed it onto JBoss. However, none of the rules are being honored - ie.
> Elements in the wrong order are allowed, so are missing elements when they
> are marked as required.  Is there a way to turn on validation so that these
> errors are caught?   I generated a service in Axis using the same wsdl and
> the validation is working there.
>
> Thanks
> Suneet
>
>



-- 
:: http://biotext.org.uk/ ::


Re: Internal server error

2009-07-02 Thread Andrew Clegg
These are all client-side errors. You need to tail the server's
logfiles while you make a request in order to see what's happening on
the server side. There's no way to tell what's going on from these
alone.

The client isn't actually doing anything wrong -- it's correctly
failing to parse an HTML response from the server.

Andrew.

2009/7/2 Naresh Tallapelli :
> I am getting the response payload as:  HTML 2.0//EN"> But in request or response processing I have never seen this
>
> Thanks,
> Naresh
>
> On Thu, Jul 2, 2009 at 8:59 PM, Naresh Tallapelli <
> naresh.tallape...@gmail.com> wrote:
>
>> Sorry. Please find the complete stack trace before, barring some of our
>> code:
>>
>> INFO: Inbound Message
>> 
>> Encoding: ISO-8859-1
>> Headers: {content-type=[text/html; charset=iso-8859-1], connection=[close],
>> Date=[Thu, 02 Jul 2009 13:12:15 GMT], Content-Length=[535]}
>> Messages:
>> Message:
>>
>> Payload: 
>> 
>> 500 Internal Server Error
>> 
>> Internal Server Error
>> The server encountered an internal error or
>> misconfiguration and was unable to complete
>> your request.
>> Please contact the server administrator,
>>  ad...@localhost and inform them of the time the error occurred,
>> and anything you might have done that may have
>> caused the error.
>> More information about this error may be available
>> in the server error log.
>> 
>>
>> --
>> Jul 2, 2009 6:47:17 PM org.apache.cxf.phase.PhaseInterceptorChain
>> doIntercept
>> INFO: Interceptor has thrown exception, unwinding now
>> org.apache.cxf.interceptor.Fault: Response was of unexpected text/html
>> ContentType.  Incoming portion of HTML stream: > "-//IETF//DTD HTML 2.0//EN">
>> 
>> 500 Internal Server Error
>> 
>> Internal Server Error
>> The server encountered an internal error or
>> misconfiguration and was unable to complete
>> your request.
>> Please contact the server administrator,
>>  ad...@localhost and inform them of the time the error occurred,
>> and anything you might have done that may have
>> caused the error.
>> More information about this error may be available
>> in the server error log.
>> 
>>
>>     at
>> org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:73)
>>     at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
>>     at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
>>     at
>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2029)
>>     at
>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1865)
>>     at java.util.zip.DeflaterOutputStream.close(Unknown Source)
>>     at
>> org.apache.cxf.io.AbstractWrappedOutputStream.close(AbstractWrappedOutputStream.java:68)
>>     at
>> org.apache.cxf.io.AbstractThresholdOutputStream.close(AbstractThresholdOutputStream.java:102)
>>     at
>> org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
>>     at
>> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:170)
>>     at
>> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
>>     at
>> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:593)
>>     at
>> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
>>     at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
>>     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
>>     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
>>     at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>>     at
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
>>     at $Proxy73.getVulnerabilityImportResult(Unknown Source)
>>     .
>>     .
>>     .
>>     at java.lang.Thread.run(Unknown Source)
>> Caused by: javax.xml.ws.soap.SOAPFaultException: Response was of unexpected
>> text/html ContentType.  Incoming portion of HTML stream: > PUBLIC "-//IETF//DTD HTML 2.0//EN">
>> 
>> 500 Internal Server Error
>> 
>> Internal Server Error
>> The server encountered an internal error or
>> misconfiguration and was unable to complete
>> your request.
>> Please contact the server administrator,
>>  ad...@localhost and inform them of the time the error occurred,
>> and anything you might have done that may have
>> caused the error.
>> More information about this error may be available
>> in the server error log.
>> 
>>
>>     at
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
>>     .
>>     .
>>     ... 9 more
>> Caused by: org.apache.cxf.interceptor.Fault: Response was of unexpected
>> text/html ContentType.  Incoming portion of HTML stream: > PUBLIC "-//IETF//DTD HTML 2.0//EN">
>> 
>> 500 Internal Server Error
>> 
>> Internal Server Error
>> The server encountered an i

Re: Internal server error

2009-06-30 Thread Andrew Clegg
2009/6/30 Naresh Tallapelli :

> More information about this error may be available
> in the server error log.

Are you writing the server, the client or both? Have you looked in the
server's error log (or asked the server admin to do so)?

There's no way to help without seeing the details of the error.

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Sending a void dateTime using SOAP

2009-06-29 Thread Andrew Clegg
2009/6/29 robertojimen...@terra.es :
> I am using CXF SOAP to communicate to a system that seems to require an 
> element when not sending a dateTime and it seems if I send null with CXF the 
> element it is not sent.
> The method that wsdl2java generated uses a XMLGregorianCalendar for this 
> field.
>
> This element works:
> 
> but as I said CXF does not send it when I call it with null.
>
> How may I send the void date value but sending the element so the other 
> system does not tell me I am not sending it?

Make it nillable="true" in the WSDL?

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Configuring streaming web services: error on the call to invoke

2009-06-24 Thread Andrew Clegg
2009/6/24 Daniel Kulp :

> For SAXSource and StreamSource, a "CachedOutputStream" is created and wrapped
> with an XMLStreamWriter and the XML stuff is copied from the XMLStreamReader
> into the writer and then a StreamSource or SAXSource is created from that
> stream.  This is semi-low memory as the CachedOutputStream will cache in files
> on disk if it gets too large.   However, it ends up parsing all the XML to
> copy it (and fix namespaces) and then passed as a stream to the app which, in
> general, then parses the XML again.  Thus, it may have performance impact.

Okay, thanks for the info.

> If the Provider is marked just "Source" or "DOMSource", then it parses into a
> DOM and returns a DOMSource.   This allows you to work with the DOM without
> reparsing.   However, that's probably more memory intensive.

The Provider is new in 2.2 right? This actually allowed me to
simplify some of my code, for a service that requires parsed input but
can produce streamed output very quickly. Thanks :-)

> One thing I keep meaning to try getting to work is to allow
> Provider to get the raw XMLStreamReader that we use.  That
> would provide the best performing and best memory usage scenario.   It's just
> not working yet.

That would be awesome. What are the major stumbling blocks? I'm
tempted to have a go myself, although if it's giving you serious
trouble, I'm not sure how much help I could be...

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: CXF - WSDL : Newbie question

2009-06-24 Thread Andrew Clegg
2009/6/24 xpsytor :
> Will take a look at the link you've mentioned here.
>
> About the method definitions for returned class, I'm sorry - I should have 
> probably said definition for my getter and setter methods. Yes, they - 
> including the constructor isn't generating. The class is literally empty. The 
> ObjectFactory class does have a newInstance() for returned class but its 
> pretty much useless as the returned class is abstract.

Okay, cool, I thought for a minute you might have been under a
misconception about what was possible over SOAP.

As Dan said, the XmlSeeAlso tricks (as described in that article)
might fix this, if it can pick up the correct class 'content' from the
concrete classes referred to.

If it doesn't help, post some code...

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: CXF - WSDL : Newbie question

2009-06-24 Thread Andrew Clegg
2009/6/24 xpsytor :

> In my case, method return type is an abstract class, wherein the actual
> object returned is of its subclasses.
> Problem 1: This subclass-es is missing in wsdl

Not too sure about how this is handled -- someone here with more
Java-first experience can help.

This might give you some pointers though:

http://weblogs.java.net/blog/kohlert/archive/2006/10/jaxws_and_type.html

> Problem 2: The method return type class has become EMPTY. All method
> definitions inside the original abstract class are gone!

Okay -- let me see if I've got this straight.

CXF is generating a WSDL from your annotated server-side code,
including definitions for classes which some of the methods return.

Then you're generating client-side code from the WSDL.

You can't expect the client-side classes to contain method definitions
-- how could you get business logic from a WSDL? A WSDL is only a way
of describing operations and the data structures they work on, it's
not a way of expressing Java code in XML!

The client-side generated classes should have constructors, fields,
getters and setters though -- if they're missing these, there's a
problem with the WSDL.

> Hope that explanation was clear without me printing out the actual classes
> involved here.

Beyond this point, it's hard to say much more without code examples...

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: CXF - WSDL : Newbie question

2009-06-24 Thread Andrew Clegg
2009/6/24  :
> Hello group!
>
> I am new to using CXF and have run into initial hiccups. Using JAX-WS styled 
> notations I have deployed my services on tomcat in testing env.
> For consumption, I generated local stubs using the published wsdl. The 
> problem is that not all classes are getting generated and some of them are 
> half baked.

What exactly are the problems? People here can probably help you iron them out.

> What I'd like to ask group here is that - is it a common/professional 
> practice to alter your wsdl manually according to your needs? Or do you make 
> changes elsewhere (in the java stubs themselves)?

I avoid Java-first for various pretty good reasons [1] but I would
imagine issues in the generated code suggest issues in the WSDL which
in turn suggest issues in the annotations.

It's generally bad practice to alter any generated code isn't it? It
puts a manual step in your build process which will recur whenever you
change the original Java.

Andrew.

[1] 
http://static.springframework.org/spring-ws/sites/1.5/reference/html/why-contract-first.html


-- 
:: http://biotext.org.uk/ ::


Re: Configuring streaming web services: error on the call to invoke

2009-06-24 Thread Andrew Clegg
2009/6/22 Daniel Kulp :

> 2)  Until you move up to 2.2.1 or 2.2.2, you aren't going to benefit from
> using a StreamSource anyway.  In fact, it will be really problematic as it
> will go stream -> stax -> DOM -> stream for incoming and stream -> DOM -> stax
> -> stream on the outgoing.      For 2.2.2, the incoming stays the same, but
> the outgoing will go directly stream -> stax -> stream.

Does CXF *always* parse the stream to a DOM tree before delivering it,
even in 2.2.2? Is there no way to override this?

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Does CXF web service can return HTTP exceptions?

2009-06-24 Thread Andrew Clegg
Actually, I may have mislead you *slightly*... :-)

It is actually recommended that the SOAP stack sets a 500 response
code when returning a SOAP fault over HTTP, but this shouldn't be the
responsibility of the application developer.

However, I just ran across this CXF issue (while looking for something
else) that says CXF doesn't currently do this automatically:

http://issues.apache.org/jira/browse/CXF-999

Fortunately, someone has posted a solution. If having a 500 code as
well as a SOAP Fault is important for your app, you can follow the
instructions on that page to set it up.

Andrew.

2009/6/24 tutu :
>
> ok, thanks a lot for your responses and your help Andrew.
>
> tugdual
>
>
> Andrew Clegg-2 wrote:
>>
>> 2009/6/24 tutu :
>>>
>>> thanks for your response andrew,
>>> so i must put my 500 code in a SAUP Fault with my message? Is that right?
>>> Do
>>
>> Don't think in terms of HTTP error codes -- these are not really
>> relevant to SOAP, for the reasons I mentioned.
>>
>> A SOAP client will see a SOAP fault and handle it appropriately, e.g.
>> a Java one will turn it into an exception on the client side.
>>
>>> you know the easiest way
>>> to add SAUP faults to a webservice wsdl-first?
>>
>> Have a look at some of Glen's tutorials, e.g.:
>>
>> http://www.jroller.com/gmazza/entry/database_crud_actions_with_web
>>
>> You can also throw any unchecked exception from a web service, and
>> it'll be converted to a SOAP fault automatically, but it is better
>> practice to declare them in the WSDL.
>>
>> Andrew.
>>
>> --
>> :: http://biotext.org.uk/ ::
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Does-CXF-web-service-can-return-HTTP-exceptions--tp24180699p24181914.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::


Re: Does CXF web service can return HTTP exceptions?

2009-06-24 Thread Andrew Clegg
2009/6/24 tutu :
>
> thanks for your response andrew,
> so i must put my 500 code in a SAUP Fault with my message? Is that right? Do

Don't think in terms of HTTP error codes -- these are not really
relevant to SOAP, for the reasons I mentioned.

A SOAP client will see a SOAP fault and handle it appropriately, e.g.
a Java one will turn it into an exception on the client side.

> you know the easiest way
> to add SAUP faults to a webservice wsdl-first?

Have a look at some of Glen's tutorials, e.g.:

http://www.jroller.com/gmazza/entry/database_crud_actions_with_web

You can also throw any unchecked exception from a web service, and
it'll be converted to a SOAP fault automatically, but it is better
practice to declare them in the WSDL.

Andrew.

--
:: http://biotext.org.uk/ ::


Re: Does CXF web service can return HTTP exceptions?

2009-06-24 Thread Andrew Clegg
I don't think so -- this is well outside normal SOAP behaviour. Errors
should be reported as SOAP Faults sent back in a normal SOAP envelope,
otherwise clients won't handle them correctly.

There may be a way to hack this behaviour (someone from the CXF team
might know) but I'd highly recommend against doing so.

Remember as well that SOAP is transport-independent -- SOAP services
can't assume they're running on HTTP, it might be JMS or direct TCP or
even an email :-)

Andrew.

2009/6/24 tutu :
>
> SOAP web services
>
> tutu wrote:
>>
>> Hi all,
>>
>> Does anybody know if cxf web service can return HTTP exceptions with
>> configurable messages?
>> In other words, does a web service can return HTTP 500: application error/
>> database problem?
>>
>> thanks in advance,
>>
>> tugdual
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Does-CXF-web-service-can-return-HTTP-exceptions--tp24180699p24181305.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::


Re: Does CXF web service can return HTTP exceptions?

2009-06-24 Thread Andrew Clegg
SOAP or REST?

2009/6/24 tutu :
>
> Hi all,
>
> Does anybody know if cxf web service can return HTTP exceptions with
> configurable messages?
> In other words, does a web service can return HTTP 500: application error/
> database problem?
>
> thanks in advance,
>
> tugdual
> --
> View this message in context: 
> http://www.nabble.com/Does-CXF-web-service-can-return-HTTP-exceptions--tp24180699p24180699.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::


In and out logging -- can't get it to work

2009-06-23 Thread Andrew Clegg
Hi folks,

I'm trying to set up request/response logging via log4j, as described here:

http://cwiki.apache.org/CXF20DOC/debugging.html

and elaborated on here:

http://www.techper.net/2008/01/30/configuring-cxf-logging-to-go-through-log4j/

However, it's not playing nice...

I have the following stanza in my cxf-servlet.xml:







(where cxf="http://cxf.apache.org/core";)

I have a file org.apache.cxf.Logger which contains the following line:

org.apache.cxf.common.logging.Log4jLogger

This ends up at WEB-INF/classes/META-INF/cxf/org.apache.cxf.Logger
relative to the root of the web app.

And my log4j.properties looks like this:

log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.maxFileSize=10240KB
log4j.appender.file.maxBackupIndex=5
log4j.appender.file.File=/var/log/EMBRACE/enfin-war.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %5p [%t]
%c{1}:%L - %m%n
log4j.rootLogger=info, file
log4j.logger.org.apache.cxf.interceptor.LoggingInInterceptor=info, file
log4j.logger.org.apache.cxf.interceptor.LoggingOutInterceptor=info, file

I know CXF is using log4j because I get messages in enfin-war.log like:

2009-06-23 13:12:47,565  INFO [http-8080-1] ServerImpl:91 - Setting
the server's publish address to be /EnfinFuncNetService

But there's no sign of the SOAP messages.

I tried replacing the bus feature in CXF's config with explicit bean
definitions:






















Now I get the following acknowledgement in enfin-war.log that this is
being read OK:

2009-06-23 13:26:54,390  INFO [http-8080-1]
DefaultListableBeanFactory:414 - Pre-instantiating singletons in
org.springframework.beans.factory.support.defaultlistablebeanfact...@52ae76:
defining beans [EnfinFuncNetService,logInbound,logOutbound,cxf];
parent: 
org.springframework.beans.factory.support.defaultlistablebeanfact...@22c5e6

... but still no message logging. Any ideas?

Thanks yet again in advance,

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: IllegalAccessError: tried to access method org.apache.cxf.service.model.BindingOperationInfo. ...

2009-06-23 Thread Andrew Clegg
Actually an 'mvn clean' seems to have fixed this, should have tried
before posting! Must have been older jars stuck in build path
somewhere.

So ignore me :-) I'll post again if it recurs and won't go away.

2009/6/23 Andrew Clegg :
> PS... I should also have mentioned that one of my JUnit tests brings
> the exact same service up from the same WSDL using the same endpoint
> implementor, in an embedded instance of Jetty, without problems, using
> the Endpoint.publish mechanism.
>
> This particular problem only seems to occur when Spring constructs the 
> service.
>
> Andrew.
>
> 2009/6/22 Andrew Clegg 
>>
>> Evening all,
>>
>> I've just upgraded to CXF 2.2.2 from 2.1.4, and now I get the
>> exception below when I try to deploy my application. It's a Provider
>> service that also acts as a Dispatch client to another set of
>> services, and uses (directly or indirectly) Spring, Guice and
>> Hibernate.
>>
>> Any idea how I could go about diagnosing this? It looked to me like
>> maybe there were two versions of CXF in the classpath, but Maven's
>> dependency hierarchy doesn't show a conflict.
>>
>> There's nothing fancy in my CXF config, my service is just created like this:
>>
>>   >      implementor="info.cathdb.funcnet.impl.FrontEndServiceProviderFacade"
>>      endpointName="funcnet:FrontEndPort"
>>      serviceName="funcnet:FrontEndService"
>>      address="/FrontEndService"
>>      wsdlLocation="WEB-INF/wsdl/Services.wsdl">
>>   
>>
>> Thanks in advance!
>>
>> Andrew.
>>
>> Stacktrace follows:
>>
>>
>> Jun 22, 2009 8:44:37 PM org.apache.catalina.core.ApplicationContext log
>> SEVERE: StandardWrapper.Throwable
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'FrontEndService': Invocation of init method
>> failed; nested exception is java.lang.IllegalAccessError: tried to
>> access method 
>> org.apache.cxf.service.model.BindingOperationInfo.(Lorg/apache/cxf/service/model/BindingInfo;Lorg/apache/cxf/service/model/OperationInfo;)V
>> from class org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean
>> Caused by: java.lang.IllegalAccessError: tried to access method
>> org.apache.cxf.service.model.BindingOperationInfo.(Lorg/apache/cxf/service/model/BindingInfo;Lorg/apache/cxf/service/model/OperationInfo;)V
>> from class org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean
>>        at 
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperationsForProvider(JaxWsServiceFactoryBean.java:322)
>>        at 
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:236)
>>        at 
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:328)
>>        at 
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:420)
>>        at 
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:190)
>>        at 
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:163)
>>        at 
>> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
>>        at 
>> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:117)
>>        at 
>> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:167)
>>        at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:346)
>>        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:259)
>>        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209)
>>        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:404)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>        at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1242)
>>        at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory

Re: IllegalAccessError: tried to access method org.apache.cxf.service.model.BindingOperationInfo. ...

2009-06-22 Thread Andrew Clegg
PS... I should also have mentioned that one of my JUnit tests brings
the exact same service up from the same WSDL using the same endpoint
implementor, in an embedded instance of Jetty, without problems, using
the Endpoint.publish mechanism.

This particular problem only seems to occur when Spring constructs the service.

Andrew.

2009/6/22 Andrew Clegg 
>
> Evening all,
>
> I've just upgraded to CXF 2.2.2 from 2.1.4, and now I get the
> exception below when I try to deploy my application. It's a Provider
> service that also acts as a Dispatch client to another set of
> services, and uses (directly or indirectly) Spring, Guice and
> Hibernate.
>
> Any idea how I could go about diagnosing this? It looked to me like
> maybe there were two versions of CXF in the classpath, but Maven's
> dependency hierarchy doesn't show a conflict.
>
> There's nothing fancy in my CXF config, my service is just created like this:
>
>         implementor="info.cathdb.funcnet.impl.FrontEndServiceProviderFacade"
>      endpointName="funcnet:FrontEndPort"
>      serviceName="funcnet:FrontEndService"
>      address="/FrontEndService"
>      wsdlLocation="WEB-INF/wsdl/Services.wsdl">
>   
>
> Thanks in advance!
>
> Andrew.
>
> Stacktrace follows:
>
>
> Jun 22, 2009 8:44:37 PM org.apache.catalina.core.ApplicationContext log
> SEVERE: StandardWrapper.Throwable
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'FrontEndService': Invocation of init method
> failed; nested exception is java.lang.IllegalAccessError: tried to
> access method 
> org.apache.cxf.service.model.BindingOperationInfo.(Lorg/apache/cxf/service/model/BindingInfo;Lorg/apache/cxf/service/model/OperationInfo;)V
> from class org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean
> Caused by: java.lang.IllegalAccessError: tried to access method
> org.apache.cxf.service.model.BindingOperationInfo.(Lorg/apache/cxf/service/model/BindingInfo;Lorg/apache/cxf/service/model/OperationInfo;)V
> from class org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean
>        at 
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperationsForProvider(JaxWsServiceFactoryBean.java:322)
>        at 
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:236)
>        at 
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:328)
>        at 
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:420)
>        at 
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:190)
>        at 
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:163)
>        at 
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
>        at 
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:117)
>        at 
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:167)
>        at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:346)
>        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:259)
>        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209)
>        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:404)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1242)
>        at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208)
>        at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
>        at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
>        at 
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
>        at 
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
>      

IllegalAccessError: tried to access method org.apache.cxf.service.model.BindingOperationInfo. ...

2009-06-22 Thread Andrew Clegg
Evening all,

I've just upgraded to CXF 2.2.2 from 2.1.4, and now I get the
exception below when I try to deploy my application. It's a Provider
service that also acts as a Dispatch client to another set of
services, and uses (directly or indirectly) Spring, Guice and
Hibernate.

Any idea how I could go about diagnosing this? It looked to me like
maybe there were two versions of CXF in the classpath, but Maven's
dependency hierarchy doesn't show a conflict.

There's nothing fancy in my CXF config, my service is just created like this:

   
   

Thanks in advance!

Andrew.

Stacktrace follows:


Jun 22, 2009 8:44:37 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'FrontEndService': Invocation of init method
failed; nested exception is java.lang.IllegalAccessError: tried to
access method 
org.apache.cxf.service.model.BindingOperationInfo.(Lorg/apache/cxf/service/model/BindingInfo;Lorg/apache/cxf/service/model/OperationInfo;)V
from class org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean
Caused by: java.lang.IllegalAccessError: tried to access method
org.apache.cxf.service.model.BindingOperationInfo.(Lorg/apache/cxf/service/model/BindingInfo;Lorg/apache/cxf/service/model/OperationInfo;)V
from class org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean
at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperationsForProvider(JaxWsServiceFactoryBean.java:322)
at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:236)
at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:328)
at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:420)
at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:190)
at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:163)
at 
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
at 
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:117)
at 
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:167)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:346)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:259)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:404)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1242)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at 
org.apache.cxf.transport.servlet.CXFServlet.loadAdditionalConfig(CXFServlet.java:166)
at 
org.apache.cxf.transport.servlet.CXFServlet.updateContext(CXFServlet.java:134)
at 
org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:101)
at 
org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:70)
at 
org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFServlet.java:79)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at 
org.apac

Re: How to return a Fault messgae

2009-06-19 Thread Andrew Clegg
Plus any unchecked exception you throw will get converted into a SOAP
fault for you, with a faultcode of soap:Server and a faultstring equal
to the message of the exception.

Andrew.

2009/6/18 Daniel Kulp 
>
> On Thu June 18 2009 3:25:14 am xinxinwang wrote:
> > My service implements Provider. I like to return a fault message if
> > an exception happends inside the invoke() method. How can I return the
> > fault message?
>
> I think you would just throw a SOAPFaultException with the details of your
> faults and stuff filled in it.
>
> --
> Daniel Kulp
> dk...@apache.org
> http://www.dankulp.com/blog



--
:: http://biotext.org.uk/ ::


Re: Source code to add to my dependency libraries

2009-06-04 Thread Andrew Clegg
2009/6/3 sortakool :
>
> Hopefully this question makes sense.
>
> Is there a downloadable jar/zip file of the CXF source code to link to the
> CXF class binaries?

It's all on http://cxf.apache.org/download.html .

Or if you're using Maven, do mvn eclipse:eclipse -DdownloadSources=true .

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Tracking WSDLToJava Error: Thrown by JAXB : Two declarations cause a collision

2009-05-27 Thread Andrew Clegg
2009/5/27 cmarshall :
>
> The Eclipse plugin that launches wsdl2java includes the -validate and it is
> not producing anything intelligible.  The wsdl that produces the issue can
> be retrieved from:
>
> https://adcenterapi.microsoft.com/Api/Advertiser/V5.1/CampaignManagement/CampaignManagementService.svc?wsdl

Hmm, I see what you mean. I tried it with xjc directly and it wasn't
much more use -- it just refers to line 1 of the same XSD file over
and over.

You may have more luck asking the JAXB people as this is nothing
really to do with CXF -- any JAXB-based tool would have the same
response. Might be worth trying CXF with Aegis instead of JAXB.

http://cwiki.apache.org/CXF20DOC/aegis-databinding.html

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Tracking WSDLToJava Error: Thrown by JAXB : Two declarations cause a collision

2009-05-27 Thread Andrew Clegg
2009/5/26 cmarshall :

> I suspect this is likely to be an error in their wsdl but it is huge and has
> three imports in the schema.  What is the process that one should use to
> track down this error?  Hopefully something better than manually reading
> through the wsdl. Note: using the Eclipse WebServicesTools with Apache 1
> code generation is successful.

If you use the -validate option for wsdl2java, it should tell you
what's wrong with it, and where. This is turned off by default (not
sure why).

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: null values populated from non-null response

2009-05-23 Thread Andrew Clegg
2009/5/23 Timothy Waxland :
> Hi
>
> thanks for responding.
> i turned on validation on the client side and it through an exception where
> i expected it to - so i'm pretty sure their response is not correct.  (i
> couldn't find the validate option in soapUI)

It's in the right mouse button menu if you click on the actual XML
text of a request or response. But if CXF schema validation rejects
it, that's a good enough sign :-)

There may be some JAXB option that allows you to override namespaces,
but I'm just guessing here. Failing that I guess you could write an
interceptor to 'fix' the incoming message with an XSLT transformation
(or other means) before JAXB unmarshalling takes place. Or write a
Dispatch client that processes the raw XML without using databinding
-- that way it wouldn't matter if the message didn't match the schema.

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: null values populated from non-null response

2009-05-22 Thread Andrew Clegg
2009/5/22 Timothy Waxland :

> with the above, all is well but i can not impose that on the server (client
> webmethods system). i fear i have missed something simple that is causing my
> client components to not be populated with respective values. i also
> understood from my reading that the above soap response is valid (dumb
> naming aside) and that even though the prefix is not used, the fact that it
> is declared is enough and it should also apply to child elements. from the
> w3c recommendation i read: (http://www.w3.org/TR/REC-xml-names)
>
> 
>  
> 
>
> so in my similar case, even though x does not include the prefix, the
> namespace prefixed by edi applies to x and all its contents.

Unless I'm very much mistaken, the phrase 'the "edi" prefix is bound
to http://ecommerce.example.org/schema for the "x" element and
contents' doesn't mean 'the x element and all its children are in the
http://ecommerce.example.org/schema namespace'. It means, I thought,
'anywhere you use the edi prefix in the x element or any of its
children, it will be bound to http://ecommerce.example.org/schema'.
But AFAIK unprefixed elements will still be in the default namespace.

Apologies if that's what you meant and I'm misunderstanding...

> in my case,
> which i believe is the same, it seems to fail. using soapUI (or even in my
> own integration tests using a fake but running web service) the whole thing
> works fine. but as an example the default response that soapUI generates
> uses prefixes everywhere as does my fake web service. in any case, i believe
> the response to be valid and something on the cxf end is misinterpreting or
> not applying the namespace correctly.

Hard to tell much without your WSDL, but what happens when:

(a) you right-click on the problematic message in soapUI and choose 'Validate'?

(b) you turn on schema validation in CXF?

Andrew.



-- 
:: http://biotext.org.uk/ ::


Re: XSD level validations for CXF incoming SOAP requests

2009-05-22 Thread Andrew Clegg
http://cxf.apache.org/faq.html

See the bit about schema validation. You can do this at either/both of
the client and/or server sides I believe.

Andrew.

2009/5/22 vimalaharan :
>
> Hi,
>
> I have converted the WSDLs to java classes and using it in both the Server
> side and the Client side. XSD related parameter validations are not done
> because those validations were not imported into the generated Java classes.
> But I want to make sure that these validations are done at the Server side.
>
> In the Server side, Incoming SOAP requests are coming with the respective
> XSD reference. So can CXF validate those parameters based on the
> validations, which are specified in the XSD files.
>
> Advanced Thanks
>
> regards,
> vimal
> --
> View this message in context: 
> http://www.nabble.com/XSD-level-validations-for-CXF-incoming-SOAP-requests-tp23668402p23668402.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::


Re: Apache CXF for SOAP over HTTPS

2009-05-13 Thread Andrew Clegg
2009/5/13 hezjing :
> Hi
>
> I have a project that requires us to develop a client/server which send
> request/response (over HTTPS) in the following format:
...
> There is no WSDL.
>
> Can we use Apache CXF to develop this type of client/server?

You can use Dispatch clients [1] and Provider services [2] to
send/receive arbitrary XML messages without requiring a WSDL, if you
have to follow that exact spec.

As far as I know there is no problem at all with using these over
HTTPS [3] but I haven't personally done it myself.

Andrew.

[1] http://cwiki.apache.org/CXF20DOC/jax-ws-dispatch-api.html
[2] http://cwiki.apache.org/CXF20DOC/provider-services.html
[3] 
http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html

-- 
:: http://biotext.org.uk/ ::


Re: CXF with own Classloader

2009-05-09 Thread Andrew Clegg
2009/5/8 ladidaaa :

> Is there a way to use CXF with its own classloader which has own versions of
> Jars ?

I came across this project yesterday, would this help?

http://www.pomstrap.techlab.smk.fr/en/

Andrew.


-- 
:: http://biotext.org.uk/ ::


Question about SOAP Faults on the client side

2009-04-29 Thread Andrew Clegg
Evening all,

Is it correct to say that if I see an exception like this in a CXF client:


org.apache.cxf.binding.soap.SoapFault: Bad file descriptor
at 
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java
:75)
at 
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:
46)
at 
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:
35)
at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226)
at 
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.
java:96)
at 
org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor.handleMessage(DispatchInDatabindingInterce
ptor.java:138)
at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226)
at org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:347)
at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2102)
at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1980)
at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1905)
at 
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:600)
at 
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSende
rInterceptor.java:62)
at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226)
at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:186)
... 7 more


... this means there was an error in the remote (non-CXF) service, and
"Bad file descriptor" is the error message thrown by the service?

I'm seeing quite a few of these in my logs, and trying to make sure
it's actually a problem on the service side, so I know whether to
panic or not.

Thanks,

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Problem with enabling Schema Validation

2009-04-25 Thread Andrew Clegg
The error you originally posted said:


soap:Client
Unmarshalling Error: cvc-elt.1: Cannot find the declaration of
element 'Activating'.


but the closest element name in this WSDL is 'Activeren'. Typo?

Andrew.

2009/4/24 venuireddy :
>
> It's a bit difficult to provide the real wsdl (because of confidentiality) so
> here is derived version
>
> 
>  targetNamespace="http://gateway.test.company.nl/";
> xmlns:tns="http://gateway.test.company.nl/";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
>  
> http://www.w3.org/2001/XMLSchema";
> xmlns="http://gateway.test.company.nl/"; attributeFormDefault="unqualified"
> elementFormDefault="unqualified"
> targetNamespace="http://gateway.test.company.nl/";>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
>  
>    
>    
>  
>  
>    
>    
>  
>  
>    
>    
>  
>  
>    
>    
>  
>  
>    
>      
>    
>       message="tns:ophalenVersieResponse">
>    
>    
>    
>      
>    
>      
>    
>    
>  
>  
>     transport="http://schemas.xmlsoap.org/soap/http"/>
>    
>      
>      
>        
>      
>      
>        
>      
>    
>    
>      
>      
>        
>      
>      
>        
>      
>    
>  
>  
>     binding="tns:WebServiceServiceSoapBinding">
>      http://localhost:9090/TestServicePort"/>
>    
>  
> 
>
>
> The message
> http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:gat="http://gateway.test.company.nl/";>
>   
>   
>      
>         
>            ?
>         
>      
>   
> 
>
>
>
>
> Andrew Clegg-2 wrote:
>>
>> 2009/4/24 venuireddy :
>>
>>> Is there anybody who can explain this behavior or point me into a
>>> direction
>>> on how to fix it ?
>>
>> It's a bit difficult if you don't post your WSDL or an example message
>> that causes the error :-)
>>
>> Andrew.
>>
>> --
>> :: http://biotext.org.uk/ ::
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Problem-with-enabling-Schema-Validation-tp23218029p23218429.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::


Re: Problem with enabling Schema Validation

2009-04-24 Thread Andrew Clegg
2009/4/24 venuireddy :

> Is there anybody who can explain this behavior or point me into a direction
> on how to fix it ?

It's a bit difficult if you don't post your WSDL or an example message
that causes the error :-)

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: packaging question

2009-04-24 Thread Andrew Clegg
2009/4/24 Glen Mazza :

> It would defeat one of the main purposes of Maven if you used a different
> directory layout with that tool.

+1 for this -- if you use Maven, stick with the Maven, layout
otherwise other plugins won't know where to look for things and it'll
be a nightmare of extra configuration...

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Create a Service Using CXF Using Https Protocol

2009-04-22 Thread Andrew Clegg
There's a wsdl_first_https example service in the $CXF_HOME/samples directory...

2009/4/22 Bazaj, Taru (IDEAS) :
> Hi,
>
>
>
> I am trying to use CXF to write a web service that would talk to a WCF
> client over HTTPS. However, I am having issues with parsing the incoming
> message and getting a signature from it. There is not much documentation
> available on the web to guide me how to use certificates while writing a
> CXF service.
>
>
>
> If anyone has ever written/came accross a CXF service that uses https,
> please point me to it. Any sample/example is welcome.
>
>
>
> Thanks,
>
> Taru
>
>
>
> Taru Bazaj
> Morgan Stanley | Technology
> Bldg. 5, Sector 30, Mindspace, Goregaon (West)
> Mumbai (Ex Bombay), 400 090
> Phone: +91 22 6641-0281
> taru.ba...@morganstanley.com 
>
>
> --
> NOTICE: If received in error, please destroy and notify sender. Sender does 
> not intend to waive confidentiality or privilege. Use of this email is 
> prohibited when received in error. Morgan Stanley may monitor and store 
> emails to the extent permitted by applicable law.
>



-- 
:: http://biotext.org.uk/ ::


Re: packaging question

2009-04-21 Thread Andrew Clegg
One of Glen's excellent tutorials covers packaging and deploying using
both Maven and Ant:

http://www.jroller.com/gmazza/date/20080417

Andrew.

2009/4/21 Bruce Edge :
> Apologies, some rookie questions here.
>
> What's the minimum env I need to run cxf and how should it be packaged up
> along with the java code for deployment on jetty (or tomcat)?
> Any implications to cxf servelet vs spring?
> Is there anything smaller, and if so, what do I lose?
>
> Specific RTFM references are appreciated too. It's just a huge FM.
>
> Lastly, are there any examples of Makefiles, maven, ant scripts, etc  that
> do this?
>
> Thanks, Bruce
>



-- 
:: http://biotext.org.uk/ ::


CXF tutorial (was Re: How to add Stylesheet to XML returned from server?)

2009-04-08 Thread Andrew Clegg
2009/4/8 sridhar veerappan :
> Hi,
>
> I am new To CXF, Can you anyone help me how to build the application with
> minimal setup with Jboss or Tomcat,Java,eclipse,Ant/Maven,Web service with a
> sample application to test.

Like this?

http://www.jroller.com/gmazza/entry/creating_a_wsdl_first_web1

Doesn't cover Eclipse but you don't really need to do anything special
in Eclipse.

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Compiling JAX-WS service implementation classes on SoyLatte

2009-04-06 Thread Andrew Clegg
2009/4/6 Ian Roberts :
> Andrew Clegg wrote:
>>> The problem is that SoyLatte's version of javax.xml.ws.Service doesn't
>>> seem to have this method, just the Class and QName, Class versions of
>>> getPort, like in Java 5.
>
> To override this you'll need to put the 2.1 API jar in SoyLatte's
> lib/endorsed directory.

That did the trick! Thanks.

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Compiling JAX-WS service implementation classes on SoyLatte

2009-04-06 Thread Andrew Clegg
Sorry, I meant "JAX-WS API 2.1 jar".

2009/4/6 Andrew Clegg :
> Hi,
>
> I'm trying to get a CXF project built on Linux JDK 6 to compile on OS
> X Tiger under SoyLatte (a port of BSD Java 6).
>
> It's almost all gone pretty seamlessly, but in the service
> implementation classes generated by the Maven wsdl2java goal have a
> problem with one of the getPort methods:
>
>
>   �...@webendpoint(name = "CodaCathPort")
>    public CodaCathPortType getCodaCathPort(WebServiceFeature... features) {
>        return super.getPort(CodaCathPort, CodaCathPortType.class, features);
>    }
>
>
> The method getPort(QName, Class) in the type Service is not
> applicable for the arguments (QName, Class,
> WebServiceFeature[])
>
>
> The problem is that SoyLatte's version of javax.xml.ws.Service doesn't
> seem to have this method, just the Class and QName, Class versions of
> getPort, like in Java 5.
>
> Has anyone encountered this problem before? I tried to work around it
> by manually adding the JAX-WS API 2.0 jar to my Maven dependencies,
> but this didn't make a difference. Is there a way to make the compiler
> use the version of Service from the API jar, or alternatively, to tell
> CXF to omit this method (I don't use it anywhere)?
>
> I can work around it for now by editing the generated class files, but
> if anyone has a better idea, I'd appreciate it!
>
> Thanks,
>
> Andrew.
>
> --
> :: http://biotext.org.uk/ ::
>



-- 
:: http://biotext.org.uk/ ::


Compiling JAX-WS service implementation classes on SoyLatte

2009-04-06 Thread Andrew Clegg
Hi,

I'm trying to get a CXF project built on Linux JDK 6 to compile on OS
X Tiger under SoyLatte (a port of BSD Java 6).

It's almost all gone pretty seamlessly, but in the service
implementation classes generated by the Maven wsdl2java goal have a
problem with one of the getPort methods:


@WebEndpoint(name = "CodaCathPort")
public CodaCathPortType getCodaCathPort(WebServiceFeature... features) {
return super.getPort(CodaCathPort, CodaCathPortType.class, features);
}


The method getPort(QName, Class) in the type Service is not
applicable for the arguments (QName, Class,
WebServiceFeature[])


The problem is that SoyLatte's version of javax.xml.ws.Service doesn't
seem to have this method, just the Class and QName, Class versions of
getPort, like in Java 5.

Has anyone encountered this problem before? I tried to work around it
by manually adding the JAX-WS API 2.0 jar to my Maven dependencies,
but this didn't make a difference. Is there a way to make the compiler
use the version of Service from the API jar, or alternatively, to tell
CXF to omit this method (I don't use it anywhere)?

I can work around it for now by editing the generated class files, but
if anyone has a better idea, I'd appreciate it!

Thanks,

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Recommended way to have a web method stream results back to client?

2009-04-03 Thread Andrew Clegg
2009/4/2 Joe-D Morrison :
> Earlier I asked about customizing XML serialization in CXF and got some
> helpful suggestions, but I left out an important detail.  I need to write
> a "streaming" SOAP service that returns an enormous amount of XML without
> storing the entire response in memory at any time.

I've done this by using JAX-WS Provider services which
build their own XML payload and don't bother with databinding.

http://cwiki.apache.org/CXF20DOC/provider-services.html

e.g. I have a service which reads records from a database (via
Hibernate but that's not important), converts them into XML and
streams them directly into the message body. There's a data access
object which iterates over the record list, converting it into XML,
and supplying an iterator of its own which returns Strings containing
XML fragments (one per database row).

Then I have another class:

http://biotext.org.uk/iteratorreader-streaming-character-data-from-an-iterator/

which wraps this Iterator in a Reader, and the web service
wraps this Reader in a StreamSource (providing a header and footer
which contain the start and end message part elements) and returns it
to CXF for streaming back to the client. That link explains it in
slightly more detail.

Disclaimer: I have no idea whether this is the best way to do it or not :-)

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Using DataHandler for attachments

2009-04-01 Thread Andrew Clegg
For clients that don't support attachments properly, you can always
save the file to a temporary static location on your webserver with a
non-guessable name, and send a URL instead. Then have a scheduled task
that removes such files older than a certain age.

I believe we've done this before with older services in the Perl
world. Bit of a hack but it works...

Andrew.

2009/4/1 Arby :
> I understand where you are coming from and I've posted in gSOAP's forums as
> well to ask about some hints regarding this problem since gSOAP is suppose
> to be fully compliant with the MTOM standard for transferring files.  Is
> there any other C++ SOAP client that you would recommend?
> I thought perhaps if someone else has come across this issue before, it
> might be useful to post here as well.
>
> Before I was using Base64String to transfer small files - the Java service's
> upload method would accept a binary file encoded to a Base64 string and it's
> very trivial to create a Base64 string in C++ so there were no problems.
> However, that approach does not work for large files because the entire file
> has to be read into a buffer before encoding it into a Base64 string.
>
> Thanks for your responses.
>
> On Tue, Mar 31, 2009 at 6:09 PM, Glen Mazza  wrote:
>
>>
>> Java InputStream <> C++ InputStream (assuming the latter exists).  Your way
>> of thinking still seems strange:
>> "successfully developed a C++ client for a Java service that uses MTOM"
>> should not be the issue.  The real question should be: "successfully
>> developed a C++ client for a web service that uses MTOM".
>>
>> Your C++ client needs to be able to receive (or send) an MTOM attachment
>> with zero knowledge of the programming language being used to create the
>> web
>> service provider.  If you need to know, or otherwise are factoring into
>> consideration, the programming language the web service provider was
>> implemented in, I don't think you're approaching the problem correctly.
>> Your question still seems best for a C++ web services forum (unless someone
>> here has experience writing C++ SOAP clients.)
>>
>> Glen
>>
>>
>> Arby wrote:
>> >
>> > Right. So in order to use the Java service's upload method, I have to
>> > provide a DataHandler object (that references a file) and from what I
>> > understand, DataHandler is just a wrapper for an InputStream. So if I
>> were
>> > to construct my own DataHandler class in C++ and pass an input stream to
>> > the
>> > Java Service's upload method, it should be ok. But how would the Java
>> > service cast the InputStream into a DataHandler object before processing
>> > the
>> > upload request? Also, I can't use Base64String because the attachments
>> are
>> > quite large and the buffer would easily overflow. Has
>> > anyone successfully developed a C++ client for a Java service that uses
>> > MTOM
>> > for file transfer? Any help would be appreciated.
>> >
>> > On Tue, Mar 31, 2009 at 3:15 PM, Glen Mazza 
>> wrote:
>> >
>> >>
>> >> I think you're approaching the problem the wrong way.  The Java
>> >> DataHandler
>> >> class, when being used from the web service provider, would not have any
>> >> clue what programming language the client is written in.  It's just XML
>> >> (and
>> >> a MIME attachment) over the wire.  So I think you would need to go to
>> >> some
>> >> help forum for the language that you wish to write your SOAP client in
>> >> and
>> >> ask how you can receive MTOM attachments--i.e., what is C++'s equivalent
>> >> for
>> >> Java's DataHandler.
>> >>
>> >> Glen
>> >>
>> >>
>> >> Arby wrote:
>> >> >
>> >> > Hello,   I have a CXF service running for transferring files that I
>> >> would
>> >> > like to be consumed by a C++ client. Currently I am looking at gSOAP
>> to
>> >> > implement the client side but before I start, is there any known way
>> of
>> >> > using DataHandler to transfer files from a Java service to a non-Java
>> >> > client? I've been digging around for months and any help would be
>> >> > appreciated.
>> >> >
>> >> > Thanks.
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Using-DataHandler-for-attachments-tp22810928p22815936.html
>> >> Sent from the cxf-user mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Using-DataHandler-for-attachments-tp22810928p22817988.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
>



-- 
:: http://biotext.org.uk/ ::


Re: WS stops responding after a while

2009-03-26 Thread Andrew Clegg
Would debugging into the service with Eclipse (or equivalent) remote
debugging help? You could set some breakpoints in your service and see
if any of them get hit when you send a request. Or just hit Suspend
while the client's waiting for a response, and see where the service
is waiting.

Andrew.

2009/3/26 Vassilis Virvilis :
> Hi everybody,
>
> The problem is pesistent with cxf-2.1.3 and cxf-2.2
>
> I have a WS that stops responding after a while. After that no client can 
> connect and read time outs are happening on the client. The issue is (I 
> think) a little bit accelerated whe the services is accessed by multiple 
> clients...
>
> On the server however I got no logs indicating a problem...
>
> I am at loss here. Without a backtrace I can't even google it up.
>
> Can you give some hints on how I should proceed in order to debug this issue?
>
>        Vassilis
>



-- 
:: http://biotext.org.uk/ ::


Re: Soap Schema Validation & CXF?

2009-03-25 Thread Andrew Clegg
This is a VFAQ: http://cxf.apache.org/faq.html

2009/3/25 dave sinclair :
>
> Can it be done programatically on the server side? The problem is the client
> doesn't want Spring, they are an ATG shop. So I need to enable validation
> without using the spring config.
>
> thanks
>
>
> dkulp wrote:
>>
>>
>> On May 27, 2008, at 5:48 PM, Bharath Thippireddy wrote:
>>
>>> Can this be done programatically on the client side?
>>
>> This should do it:
>>          ((BindingProvider)proxy).getRequestContext().put("schema-
>> validation-enabled",
>>
>> Boolean.TRUE);
>>
>> Dan
>>
>>
>>>
>>>
>>> thanks,
>>> bharath
>>>
>>> Daniel Kulp  wrote on 05/16/2008 03:57:16 PM:
>>>

 On May 16, 2008, at 3:44 PM, Bharath Thippireddy wrote:
> Does CXF support the Soap Message - Schema Validation using the
> @SchemaValidation annotaion on the service provider?
>
> And can we use the SchemaValidationFeature  to do the same on the
> JAX-WS
> client?

 Those annotations are metro proprietary extensions.   So, no, we
 don't
 support them.

 However, you can configure CXF to do schema validation.   Our
 wsdl_first sample does that for both client and server.

 Dan




>
> thanks and regards,
> Bharath

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





>>
>> ---
>> Daniel Kulp
>> dk...@apache.org
>> http://www.dankulp.com/blog
>>
>>
>>
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Soap-Schema-Validation---CXF--tp17282802p22707541.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::


Re: wsdl2java -- Resolving imported schemas with relative paths

2009-03-24 Thread Andrew Clegg
I'm not sure I follow you -- the service-specific schema
ws_spindlep_2_0_ws0.xsd has this line as the first element in its
schema:

http://www.cbs.dtu.dk/ws/ws-common";
schemaLocation="../common/ws_common_1_0b.xsd"/>

... which is also imported into the WSDL.

I just noticed last night though that Eclipse complains about the WSDL
having two wsdl:types elements, I'll try merging them and see if that
makes JAXB happy...

Andrew.

2009/3/23 Daniel Kulp :
>
> JAXB is correct here.    The scheme in question (the second in the wsdl),
> doesn't have any imports.   Thus, it cannot reference anything outside of
> itself.   There should be an import in there.
>
> Dan
>
>
> On Mon March 23 2009 3:40:22 pm Andrew Clegg wrote:
>> Actually, I think my previous suspicion about the cause of the problem
>> may be a red herring.
>>
>> I've downloaded all three files:
>>
>> http://www.cbs.dtu.dk/ws/SpindleP/SpindleP_2_0_ws0.wsdl
>> http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd
>> http://www.cbs.dtu.dk/ws/common/ws_common_1_0b.xsd
>>
>> and saved them into one local directory, changed the schemaLocation
>> elements to just refer to the filenames without any path prefixes:
>>
>> > namespace="http://www.cbs.dtu.dk/ws/ws-common";
>> schemaLocation="ws_common_1_0b.xsd"
>> />
>>
>> and invoked wsdl2java like so:
>>
>> wsdl2java SpindleP_2_0_ws0.wsdl
>>
>> and I still get:
>>
>> WSDLToJava Error: Thrown by JAXB : undefined simple or complex type
>> 'spindlep:seqlookup'
>>
>> This service works fine in SoapUI, I've sent, received and validated
>> messages OK, so I'm a bit stuck... Is there some magic incantation
>> that gets wsdl2java to honour imported schemas?
>>
>> Any suggestions greatly appreciated!
>>
>> Andrew.
>>
>> 2009/3/23 Andrew Clegg :
>> > Hi,
>> >
>> > I'm trying to write a JAXB/JAXWS client for this service:
>> >
>> > http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd
>> >
>> > Just using wsdl2java on that URL with no extra parameters gives this
>> > error:
>> >
>> > WSDLToJava Error: Thrown by JAXB : undefined simple or complex type
>> > 'spindlep:seqlookup'
>> >
>> > ... presumably because all the types in use in that WSDL are defined
>> > in imported schemas with relative paths:
>> >
>> > > > namespace="http://www.cbs.dtu.dk/ws/ws-common";
>> > schemaLocation="../common/ws_common_1_0b.xsd"
>> > />
>> > > > namespace="http://www.cbs.dtu.dk/ws/ws-spindlep";
>> > schemaLocation="ws_spindlep_2_0_ws0.xsd"
>> > />
>> >
>> > ... so I tried supplying a JAXB catalog (SpindleP.cat) as described here:
>> >
>> > https://jaxb.dev.java.net/guide/Fixing_broken_references_in_schema.html
>> >
>> > This contains the following lines:
>> >
>> > PUBLIC "http://www.cbs.dtu.dk/ws/ws-common";
>> > "http://www.cbs.dtu.dk/ws/common/ws_common_1_0b.xsd";
>> > PUBLIC "http://www.cbs.dtu.dk/ws/ws-spindlep";
>> > "http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd";
>> >
>> > I know those XSD URLs work (you can check them yourself...). But when
>> > I re-ran wsdl2java like this:
>> >
>> > wsdl2java -catalog SpindleP.cat
>> > http://www.cbs.dtu.dk/ws/SpindleP/SpindleP_2_0_ws0.wsdl
>> >
>> > ... I got exactly the same error. Weirdly, even with -verbose, there's
>> > no indication that wsdl2java is trying and failing to read the
>> > imported schemas. It's as if it's completely ignoring the catalog
>> > file.
>> >
>> > Any idea what I'm doing wrong? I also tried using SYSTEM paths rather
>> > than PUBLIC in the catalog file, same result. Also tried both CXF 2.2
>> > and 2.1.4 with no difference.
>> >
>> > I could probably contact the maintainers of that service and get them
>> > to provide a URL instead of a relative path, and for now I'll just
>> > download and modify the appropriate files myself. But it's a bit of a
>> > shame if it doesn't work as designed, especially since SoapUI just
>> > resolves the locations for me automatically. If this is unexpected
>> > behaviour, let me know and I'll JIRA it.
>> >
>> > Thanks,
>> >
>> > Andrew.
>> >
>> > --
>> >
>> > :: http://biotext.org.uk/ ::
>
> --
> Daniel Kulp
> dk...@apache.org
> http://www.dankulp.com/blog
>



-- 
:: http://biotext.org.uk/ ::


Re: wsdl2java -- Resolving imported schemas with relative paths

2009-03-23 Thread Andrew Clegg
Actually, I think my previous suspicion about the cause of the problem
may be a red herring.

I've downloaded all three files:

http://www.cbs.dtu.dk/ws/SpindleP/SpindleP_2_0_ws0.wsdl
http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd
http://www.cbs.dtu.dk/ws/common/ws_common_1_0b.xsd

and saved them into one local directory, changed the schemaLocation
elements to just refer to the filenames without any path prefixes:

http://www.cbs.dtu.dk/ws/ws-common";
schemaLocation="ws_common_1_0b.xsd"
/>

and invoked wsdl2java like so:

wsdl2java SpindleP_2_0_ws0.wsdl

and I still get:

WSDLToJava Error: Thrown by JAXB : undefined simple or complex type
'spindlep:seqlookup'

This service works fine in SoapUI, I've sent, received and validated
messages OK, so I'm a bit stuck... Is there some magic incantation
that gets wsdl2java to honour imported schemas?

Any suggestions greatly appreciated!

Andrew.

2009/3/23 Andrew Clegg :
> Hi,
>
> I'm trying to write a JAXB/JAXWS client for this service:
>
> http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd
>
> Just using wsdl2java on that URL with no extra parameters gives this error:
>
> WSDLToJava Error: Thrown by JAXB : undefined simple or complex type
> 'spindlep:seqlookup'
>
> ... presumably because all the types in use in that WSDL are defined
> in imported schemas with relative paths:
>
>  namespace="http://www.cbs.dtu.dk/ws/ws-common";
> schemaLocation="../common/ws_common_1_0b.xsd"
> />
>  namespace="http://www.cbs.dtu.dk/ws/ws-spindlep";
> schemaLocation="ws_spindlep_2_0_ws0.xsd"
> />
>
> ... so I tried supplying a JAXB catalog (SpindleP.cat) as described here:
>
> https://jaxb.dev.java.net/guide/Fixing_broken_references_in_schema.html
>
> This contains the following lines:
>
> PUBLIC "http://www.cbs.dtu.dk/ws/ws-common";
> "http://www.cbs.dtu.dk/ws/common/ws_common_1_0b.xsd";
> PUBLIC "http://www.cbs.dtu.dk/ws/ws-spindlep";
> "http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd";
>
> I know those XSD URLs work (you can check them yourself...). But when
> I re-ran wsdl2java like this:
>
> wsdl2java -catalog SpindleP.cat
> http://www.cbs.dtu.dk/ws/SpindleP/SpindleP_2_0_ws0.wsdl
>
> ... I got exactly the same error. Weirdly, even with -verbose, there's
> no indication that wsdl2java is trying and failing to read the
> imported schemas. It's as if it's completely ignoring the catalog
> file.
>
> Any idea what I'm doing wrong? I also tried using SYSTEM paths rather
> than PUBLIC in the catalog file, same result. Also tried both CXF 2.2
> and 2.1.4 with no difference.
>
> I could probably contact the maintainers of that service and get them
> to provide a URL instead of a relative path, and for now I'll just
> download and modify the appropriate files myself. But it's a bit of a
> shame if it doesn't work as designed, especially since SoapUI just
> resolves the locations for me automatically. If this is unexpected
> behaviour, let me know and I'll JIRA it.
>
> Thanks,
>
> Andrew.
>
> --
> :: http://biotext.org.uk/ ::
>



-- 
:: http://biotext.org.uk/ ::


wsdl2java -- Resolving imported schemas with relative paths

2009-03-23 Thread Andrew Clegg
Hi,

I'm trying to write a JAXB/JAXWS client for this service:

http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd

Just using wsdl2java on that URL with no extra parameters gives this error:

WSDLToJava Error: Thrown by JAXB : undefined simple or complex type
'spindlep:seqlookup'

... presumably because all the types in use in that WSDL are defined
in imported schemas with relative paths:

http://www.cbs.dtu.dk/ws/ws-common";
schemaLocation="../common/ws_common_1_0b.xsd"
/>
http://www.cbs.dtu.dk/ws/ws-spindlep";
schemaLocation="ws_spindlep_2_0_ws0.xsd"
/>

... so I tried supplying a JAXB catalog (SpindleP.cat) as described here:

https://jaxb.dev.java.net/guide/Fixing_broken_references_in_schema.html

This contains the following lines:

PUBLIC "http://www.cbs.dtu.dk/ws/ws-common";
"http://www.cbs.dtu.dk/ws/common/ws_common_1_0b.xsd";
PUBLIC "http://www.cbs.dtu.dk/ws/ws-spindlep";
"http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd";

I know those XSD URLs work (you can check them yourself...). But when
I re-ran wsdl2java like this:

wsdl2java -catalog SpindleP.cat
http://www.cbs.dtu.dk/ws/SpindleP/SpindleP_2_0_ws0.wsdl

... I got exactly the same error. Weirdly, even with -verbose, there's
no indication that wsdl2java is trying and failing to read the
imported schemas. It's as if it's completely ignoring the catalog
file.

Any idea what I'm doing wrong? I also tried using SYSTEM paths rather
than PUBLIC in the catalog file, same result. Also tried both CXF 2.2
and 2.1.4 with no difference.

I could probably contact the maintainers of that service and get them
to provide a URL instead of a relative path, and for now I'll just
download and modify the appropriate files myself. But it's a bit of a
shame if it doesn't work as designed, especially since SoapUI just
resolves the locations for me automatically. If this is unexpected
behaviour, let me know and I'll JIRA it.

Thanks,

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Pointer to generate Perl client for CXF JAX-WS services?

2009-03-20 Thread Andrew Clegg
You can do this with the XML::Compile library from CPAN --
specifically the XML::Compile::WSDL11 module which can generate Perl
stubs from a WSDL.

http://perl.overmeer.net/xml-compile/

We have used this pretty effectively to consume document/literal
wrapped CXF services.

There's an example of using this module to send a request to one of
our services:

http://funcnet.eu/source-code/perl-examples/

Let me know if you have any questions, probably off-list I guess since
none of this is really CXF-specific.

Andrew.

2009/3/20 Emily Gu :
> Hi,
>
> I have converted a few AXIS1.4  Web Services to CXF JAX-WS. Original clients
> were in Perl which is done by someone else, I don't know Perl at all. I
> would like a simple way to generate Perl client code from the WSDL I have
> now. Any pointer is greatly appreciated!
>
> Thanks!
> Emily
>



-- 
:: http://biotext.org.uk/ ::


Re: Maven2 not including dependent jars

2009-03-19 Thread Andrew Clegg
2009/3/19 Daniel Kulp :
> On Thu March 19 2009 10:28:17 am john.ba...@barclayscapital.com wrote:
>> Hi,
>>
>> It's a jar. I guess I'm too used to the atlassian confluence plugin
>> architype (?) which generates a jar with all the dependencies.  Is there
>> some sample assembly plugin code to do this? I.e. "Take the jars from
>> the repository, unpack, and create one big jar"...  Thought it would be
>> quite a common requirement?
>
>
> That type of thing does NOT work well for larger, complex, Spring based
> applications and also possibly not for CXF.   In many cases, various resources
> required by spring need to be merged together.   For example, all the META-
> INF/spring.schemas need to be merged together.   All the META-
> INF/spring.handlers need to be merged, etc...

Very likely true in many cases, but the chunk of pom I posted was from
a CXF command-line client app that works fine via the assembly plugin
with no specific extra configuration required.

I think it's a case of 'YMMV'...

Andrew.


Re: Maven2 not including dependent jars

2009-03-19 Thread Andrew Clegg
Try something like this in your plugins section:


 
 maven-assembly-plugin
 
 
 jar-with-dependencies
 
 
 

info.cathdb.funcnet.monitor.ServiceMonitor
 
 
 
 
 
 make-assembly
 package
 
 single
 
 
 


Take out the archive section if it's just a library with no main. Run
"mvn package" and it'll appear in your target directory.

Be prepared for it to be surprisingly large :-)

Andrew.

2009/3/19  :
> Hi,
>
> It's a jar. I guess I'm too used to the atlassian confluence plugin
> architype (?) which generates a jar with all the dependencies.  Is there
> some sample assembly plugin code to do this? I.e. "Take the jars from
> the repository, unpack, and create one big jar"...  Thought it would be
> quite a common requirement?
>
>
> John
>
>> -Original Message-
>> From: Ulhas Bhole [mailto:ulhas.bh...@progress.com]
>> Sent: 19 March 2009 12:23
>> To: users@cxf.apache.org
>> Subject: Re: Maven2 not including dependent jars
>>
>> Hi John,
>>
>> What is the type of the final artifact package you are trying
>> to generate? If packaging is jar I don't think it will bundle
>> dependencies you will need to have your own assembly and use
>> maven-assembly-plugin with some configuration to specify what
>> you need to include. If your packaging type is war it should
>> bundle all the dependencies that are not scoped as provided or test.
>>
>> Regards,
>>
>> Ulhas Bhole
>>
>> john.ba...@barclayscapital.com wrote:
>> > Hi,
>> >
>> > Where's the first point of call in determinig why mvn
>> package is not
>> > including dependent jars in the target jar?
>> >
>> > My pom is very simple and the dependencies are listed as follows:
>> >
>> >   
>> >     
>> >       org.springframework
>> >       spring-core
>> >       2.5.6
>> >     
>> >     
>> >       org.springframework
>> >       spring-beans
>> >       2.5.6
>> >     
>> >
>> >
>> >
>> > John
>> > ___
>> >
>> > This e-mail may contain information that is confidential,
>> privileged or otherwise protected from disclosure. If you are
>> not an intended recipient of this e-mail, do not duplicate or
>> redistribute it by any means. Please delete it and any
>> attachments and notify the sender that you have received it
>> in error. Unless specifically indicated, this e-mail is not
>> an offer to buy or sell or a solicitation to buy or sell any
>> securities, investment products or other financial product or
>> service, an official confirmation of any transaction, or an
>> official statement of Barclays. Any views or opinions
>> presented are solely those of the author and do not
>> necessarily represent those of Barclays. This e-mail is
>> subject to terms available at the following link:
>> www.barcap.com/emaildisclaimer. By messaging with Barclays
>> you consent to the foregoing.  Barclays Capital is the
>> investment banking division of Barclays Bank PLC, a company
>> registered in England (number 1026167) with its registered
>> office at 1 Churchill Place, London, E14 5HP.  This email may
>> relate to or be sent from other members of the Barclays Group.
>> > ___
>> >
>>
>>
>>
> ___
>
> This e-mail may contain information that is confidential, privileged or 
> otherwise protected from disclosure. If you are not an intended recipient of 
> this e-mail, do not duplicate or redistribute it by any means. Please delete 
> it and any attachments and notify the sender that you have received it in 
> error. Unless specifically indicated, this e-mail is not an offer to buy or 
> sell or a solicitation to buy or sell any securities, investment products or 
> other financial product or service, an official confirmation of any 
> transaction, or an official statement of Barclays. Any views or opinions 
> presented are solely those of the author and do not necessarily represent 
> those of Barclays. This e-mail is subject to terms available at the following 
> link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent 
> to the foregoing.  Barclays Capital is the investment banking division of 
> Barclays Bank PLC, a company registered in England (number 1026167) with its 
> registered office at 1 Churchill Place, London, E14 5HP.  This email may 
> relate to or be sent from other members of the Barclays Group.
> ___
>



-- 
:: http://biotext.org.uk/ ::


Re: Tacking messages across several SOAP Request

2009-03-17 Thread Andrew Clegg
2009/3/17  :

> a.      Is this the right thing to do?
> 3.      Is there an easier way to track a SOAP request across multiple calls?

I've built a system with a very similar topology to this without using
WS-Addressing: http://funcnet.eu/

When the front-end server receives a request, it generates a unique ID
for it and returns that to the user immediately. It also creates a
database record for the session which contains the job ID, user's
email address and some metadata.

It then calls each of the prediction services synchronously but in
parallel, using a separate thread for each one. As each one returns,
the front-end stores the results in the database, and when the last
one returns, it sets a 'COMPLETE' flag in the database.

The user gets MonitorJob (get current status), CancelJob and
RetrieveScores operations -- obviously the latter results in an error
unless the job is COMPLETE.

Whether this is easier than using WS-A or not, I dunno :-)

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Sending XML payload without encoding it

2009-03-12 Thread Andrew Clegg
Thanks for the very swift turnaround on this, Dan!

Andrew.

2009/3/12 Daniel Kulp :
> On Thu March 12 2009 4:10:19 am Andrew Clegg wrote:
>>  From my own POV this is non-urgent now - I've wrappered Dispatch in
>> another class that forks a second thread to change the context AND do
>> the invoke. Code available if anyone wants it as a workaround, but I
>> don't think it's patch material.
>
> Found a simple fix anyway.   When we push the call onto the background thread,
> copy the context with it.   That should work till the big refactor can take
> place.
>
> Dan
>
>>
>> Cheers,
>>
>> Andrew.
>>
>> On 11 Mar 2009, at 20:41, Daniel Kulp  wrote:
>> > I'm going to dump this in with:
>> > https://issues.apache.org/jira/browse/CXF-1907
>> >
>> > Ideally, the Dispatch would be wrappering a ClientImpl and just use
>> > the
>> > context support in there instead of doing it's own version of it
>> > (and doing it
>> > wrongly).    CXF-1907 is on my current "todo" list for early April,
>> > but
>> > subject to change.
>> >
>> > Dan
>> >
>> > On Tue March 10 2009 1:31:35 pm Andrew Clegg wrote:
>> >> Branko, thanks for your help, I've got a theory about what might be
>> >> causing this.
>> >>
>> >> CXF gurus -- I've noticed that the request context in
>> >> BindingProviderImpl is stored in a ThreadLocal.
>> >>
>> >> I'm adding something to a DispatchImpl's request context, and then
>> >> calling its invokeAsync method, therefore it's being invoked in a
>> >> different thread.
>> >>
>> >> Correct me if I'm wrong, but doesn't this mean that an asynchronously
>> >> invoked Dispatch will *never* be able to see the same request context
>> >> that it was set up with?
>> >>
>> >> I tried this, extrapolating in reverse from the FAQ:
>> >>
>> >> _dispatch.getRequestContext().put( "thread.local.request.context",
>> >> "false"
>> >> );
>> >>
>> >> but it made no difference.
>> >>
>> >> Thanks,
>> >>
>> >> Andrew.
>> >>
>> >> 2009/3/10 Andrew Clegg :
>> >>> I don't get it... How does building the XML payload differently mean
>> >>> you get a SOAPAction header? Or do you mean, when you do it this
>> >>> way,
>> >>> you don't need a SOAPAction header?
>> >>>
>> >>> In my case, I absolutely need a SOAPAction header matching the WSDL,
>> >>> because it's some weird Perl service implementation, and this:
>> >>>
>> >>> _dispatch.getRequestContext().put(
>> >>>       BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE );
>> >>> _dispatch.getRequestContext().put(
>> >>>       BindingProvider.SOAPACTION_URI_PROPERTY, "the action URI" );
>> >>>
>> >>> isn't making *any* difference at all :-(
>> >>>
>> >>> No matter how I try to rephrase it, Wireshark just shows:
>> >>>
>> >>> SOAPAction: ""
>> >>>
>> >>> in the outbound request, and the remote service throws an error. I
>> >>> have debugged into the code to some extent and those put() calls are
>> >>> definitely taking place.
>> >>>
>> >>> Sorry, I know your problem was a little different from mine, but I
>> >>> was
>> >>> really hoping you'd figured out what the right magic words were :-)
>> >>>
>> >>> Andrew.
>> >>>
>> >>> 2009/3/10 xbranko :
>> >>>> Andrew Clegg-2 wrote:
>> >>>>> I just found this message from last month...
>> >>>>>
>> >>>>> How did you get the SOAPAction header thing to work in the end?
>> >>>>> I have
>> >>>>
>> >>>> I couldn't get the action to appear either, so finally this is
>> >>>> what I
>> >>>> ended up with:
>> >>>>
>> >>>>   try
>> >>>>   {
>> >>>>     String xmlPayload = "...";
>> >>>>
>> >>>>     Service service = Service.create(new URL(wsdl), SERVICE_NAME);
>>

Re: Sending XML payload without encoding it

2009-03-12 Thread Andrew Clegg
From my own POV this is non-urgent now - I've wrappered Dispatch in  
another class that forks a second thread to change the context AND do  
the invoke. Code available if anyone wants it as a workaround, but I  
don't think it's patch material.


Cheers,

Andrew.


On 11 Mar 2009, at 20:41, Daniel Kulp  wrote:




I'm going to dump this in with:
https://issues.apache.org/jira/browse/CXF-1907

Ideally, the Dispatch would be wrappering a ClientImpl and just use  
the
context support in there instead of doing it's own version of it  
(and doing it
wrongly).CXF-1907 is on my current "todo" list for early April,  
but

subject to change.

Dan


On Tue March 10 2009 1:31:35 pm Andrew Clegg wrote:

Branko, thanks for your help, I've got a theory about what might be
causing this.

CXF gurus -- I've noticed that the request context in
BindingProviderImpl is stored in a ThreadLocal.

I'm adding something to a DispatchImpl's request context, and then
calling its invokeAsync method, therefore it's being invoked in a
different thread.

Correct me if I'm wrong, but doesn't this mean that an asynchronously
invoked Dispatch will *never* be able to see the same request context
that it was set up with?

I tried this, extrapolating in reverse from the FAQ:

_dispatch.getRequestContext().put( "thread.local.request.context",  
"false"

);

but it made no difference.

Thanks,

Andrew.

2009/3/10 Andrew Clegg :

I don't get it... How does building the XML payload differently mean
you get a SOAPAction header? Or do you mean, when you do it this  
way,

you don't need a SOAPAction header?

In my case, I absolutely need a SOAPAction header matching the WSDL,
because it's some weird Perl service implementation, and this:

_dispatch.getRequestContext().put(
  BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE );
_dispatch.getRequestContext().put(
  BindingProvider.SOAPACTION_URI_PROPERTY, "the action URI" );

isn't making *any* difference at all :-(

No matter how I try to rephrase it, Wireshark just shows:

SOAPAction: ""

in the outbound request, and the remote service throws an error. I
have debugged into the code to some extent and those put() calls are
definitely taking place.

Sorry, I know your problem was a little different from mine, but I  
was

really hoping you'd figured out what the right magic words were :-)

Andrew.

2009/3/10 xbranko :

Andrew Clegg-2 wrote:

I just found this message from last month...

How did you get the SOAPAction header thing to work in the end?  
I have


I couldn't get the action to appear either, so finally this is  
what I

ended up with:

  try
  {
String xmlPayload = "...";

Service service = Service.create(new URL(wsdl), SERVICE_NAME);
InputStream is =  new  
ByteArrayInputStream(xmlPayload.getBytes());

SOAPMessage message =
MessageFactory.newInstance().createMessage(null, is);
DOMSource request = new
DOMSource(message.getSOAPBody().extractContentAsDocument());

Dispatch disp = service.createDispatch(PORT_NAME,
DOMSource.class, Service.Mode.PAYLOAD);
DOMSource result = disp.invoke(request);
DOMResult domResponse = new DOMResult();
Transformer trans =
TransformerFactory.newInstance().newTransformer();
trans.transform(result, domResponse);
  }
  catch(Exception e)
  {
  e.printStackTrace();
  }

Ideally, the CXF team would implement an annotation for parameter  
(say
@NoEncoding) that would just pass the content as is, i.e. without  
any

XML character encoding. Hey CXF team -- how about that?
--
View this message in context:
http://www.nabble.com/Sending-XML-payload-without-encoding-it-tp21925398
p22438203.html Sent from the cxf-user mailing list archive at  
Nabble.com.


--

:: http://biotext.org.uk/ ::


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


Re: Generating a service from an inbound message

2009-03-11 Thread Andrew Clegg
These look like RPC/encoded services, in which case you can, but I
think this means you'll have to parse and generate the XML messages
yourself. Forget about databinding. (Unless any of the non-JAXB
databinding methods can help here?)

Have a look at the docs for Provider services:
http://cwiki.apache.org/CXF20DOC/provider-services.html

Andrew.

2009/3/11 emilSverige :
>
> Hi,
> I am working on a project where I am supposed to replace a 10 year old web
> service with a cxf web service.
> The existing web service have no wsdl file. The only thing I have is the xml
> that is being posted from the client to the web service.
> Is it possible to create a web service using this info only?
>
> This is the inbound message for one of the methods of the service:
>
> 
>  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>        
>                                        
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
>                        
>                                1
>                        
>                
>        
> 
>
> And here is another:
>
> 
>  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>        
>                                        
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
>                        
>                                 xsi:type="xsd:string">{PERSON_ID}
>                        
>                
>        
> 
> --
> View this message in context: 
> http://www.nabble.com/Generating-a-service-from-an-inbound-message-tp22457225p22457225.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::


Re: Sending XML payload without encoding it

2009-03-10 Thread Andrew Clegg
Branko, thanks for your help, I've got a theory about what might be
causing this.

CXF gurus -- I've noticed that the request context in
BindingProviderImpl is stored in a ThreadLocal.

I'm adding something to a DispatchImpl's request context, and then
calling its invokeAsync method, therefore it's being invoked in a
different thread.

Correct me if I'm wrong, but doesn't this mean that an asynchronously
invoked Dispatch will *never* be able to see the same request context
that it was set up with?

I tried this, extrapolating in reverse from the FAQ:

_dispatch.getRequestContext().put( "thread.local.request.context", "false" );

but it made no difference.

Thanks,

Andrew.

2009/3/10 Andrew Clegg :
> I don't get it... How does building the XML payload differently mean
> you get a SOAPAction header? Or do you mean, when you do it this way,
> you don't need a SOAPAction header?
>
> In my case, I absolutely need a SOAPAction header matching the WSDL,
> because it's some weird Perl service implementation, and this:
>
> _dispatch.getRequestContext().put(
>        BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE );
> _dispatch.getRequestContext().put(
>        BindingProvider.SOAPACTION_URI_PROPERTY, "the action URI" );
>
> isn't making *any* difference at all :-(
>
> No matter how I try to rephrase it, Wireshark just shows:
>
> SOAPAction: ""
>
> in the outbound request, and the remote service throws an error. I
> have debugged into the code to some extent and those put() calls are
> definitely taking place.
>
> Sorry, I know your problem was a little different from mine, but I was
> really hoping you'd figured out what the right magic words were :-)
>
> Andrew.
>
> 2009/3/10 xbranko :
>>
>>
>> Andrew Clegg-2 wrote:
>>>
>>> I just found this message from last month...
>>>
>>> How did you get the SOAPAction header thing to work in the end? I have
>>>
>>>
>>
>> I couldn't get the action to appear either, so finally this is what I ended
>> up with:
>>
>>    try
>>    {
>>      String xmlPayload = "...";
>>
>>      Service service = Service.create(new URL(wsdl), SERVICE_NAME);
>>      InputStream is =  new ByteArrayInputStream(xmlPayload.getBytes());
>>      SOAPMessage message = MessageFactory.newInstance().createMessage(null,
>> is);
>>      DOMSource request = new
>> DOMSource(message.getSOAPBody().extractContentAsDocument());
>>
>>      Dispatch disp = service.createDispatch(PORT_NAME,
>> DOMSource.class, Service.Mode.PAYLOAD);
>>      DOMSource result = disp.invoke(request);
>>      DOMResult domResponse = new DOMResult();
>>      Transformer trans = TransformerFactory.newInstance().newTransformer();
>>      trans.transform(result, domResponse);
>>    }
>>    catch(Exception e)
>>    {
>>        e.printStackTrace();
>>    }
>>
>> Ideally, the CXF team would implement an annotation for parameter (say
>> @NoEncoding) that would just pass the content as is, i.e. without any XML
>> character encoding. Hey CXF team -- how about that?
>> --
>> View this message in context: 
>> http://www.nabble.com/Sending-XML-payload-without-encoding-it-tp21925398p22438203.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> :: http://biotext.org.uk/ ::
>



-- 
:: http://biotext.org.uk/ ::


Re: Sending XML payload without encoding it

2009-03-10 Thread Andrew Clegg
I don't get it... How does building the XML payload differently mean
you get a SOAPAction header? Or do you mean, when you do it this way,
you don't need a SOAPAction header?

In my case, I absolutely need a SOAPAction header matching the WSDL,
because it's some weird Perl service implementation, and this:

_dispatch.getRequestContext().put(
BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE );
_dispatch.getRequestContext().put(
BindingProvider.SOAPACTION_URI_PROPERTY, "the action URI" );

isn't making *any* difference at all :-(

No matter how I try to rephrase it, Wireshark just shows:

SOAPAction: ""

in the outbound request, and the remote service throws an error. I
have debugged into the code to some extent and those put() calls are
definitely taking place.

Sorry, I know your problem was a little different from mine, but I was
really hoping you'd figured out what the right magic words were :-)

Andrew.

2009/3/10 xbranko :
>
>
> Andrew Clegg-2 wrote:
>>
>> I just found this message from last month...
>>
>> How did you get the SOAPAction header thing to work in the end? I have
>>
>>
>
> I couldn't get the action to appear either, so finally this is what I ended
> up with:
>
>    try
>    {
>      String xmlPayload = "...";
>
>      Service service = Service.create(new URL(wsdl), SERVICE_NAME);
>      InputStream is =  new ByteArrayInputStream(xmlPayload.getBytes());
>      SOAPMessage message = MessageFactory.newInstance().createMessage(null,
> is);
>      DOMSource request = new
> DOMSource(message.getSOAPBody().extractContentAsDocument());
>
>      Dispatch disp = service.createDispatch(PORT_NAME,
> DOMSource.class, Service.Mode.PAYLOAD);
>      DOMSource result = disp.invoke(request);
>      DOMResult domResponse = new DOMResult();
>      Transformer trans = TransformerFactory.newInstance().newTransformer();
>      trans.transform(result, domResponse);
>    }
>    catch(Exception e)
>    {
>        e.printStackTrace();
>    }
>
> Ideally, the CXF team would implement an annotation for parameter (say
> @NoEncoding) that would just pass the content as is, i.e. without any XML
> character encoding. Hey CXF team -- how about that?
> --
> View this message in context: 
> http://www.nabble.com/Sending-XML-payload-without-encoding-it-tp21925398p22438203.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::


Re: Sending XML payload without encoding it

2009-03-10 Thread Andrew Clegg
I just found this message from last month...

How did you get the SOAPAction header thing to work in the end? I have
the same problem as you had -- I'm doing this in the code:

rc.put( BindingProvider.SOAPACTION_URI_PROPERTY, "string containing
soap action" );
rc.put( BindingProvider.SOAPACTION_USE_PROPERTY, true );

where rc is the RequestContext of my Dispatch object. But it isn't
appearing on the wire.

Thanks,

Andrew.

2009/2/10 xbranko :
>
> Tried with both CXF 2.0.9 and 2.1.3:
>
> I need to send payload that is XML. When I do, the content is encoded (i.e.
> all '<' are replaced with <, '>' with > etc.), and the server throws
> an exception because it doesn't expect payload to be encoded. I verified
> that using soapui which sends the pure XML and receives correct answer from
> the server.
>
> Searching through the forum, I've implemented the alternative approach:
>
>      Service service = Service.create(new URL(wsdl), SERVICE_NAME);
>
>      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
>      factory.setNamespaceAware(true);
>      DocumentBuilder builder = factory.newDocumentBuilder();
>      InputStream is = new StringBufferInputStream(xmlPayload);
>      Document newDoc = builder.parse(is);
>      DOMSource request = new DOMSource(newDoc);
>
>      Dispatch disp = service.createDispatch(PORT_NAME,
> Source.class, Service.Mode.PAYLOAD);
>
>      disp.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY,
> Boolean.TRUE);
>      disp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY,
> "ServiceX");
>
>      Source result = disp.invoke(request);
>
> With this approach, the server is returning:
> "Unable to handle request without a valid action parameter. Please supply a
> valid soap action."
>
> I followed the code in the debugger, and saw that action parameter is being
> set in the code, however, it does not get written out as part of the POST
> request -- verified via the Network Protocol Analyzer -- the action is not
> there.
>
> Is there a third way? Ideally, I'd like to use the standard way, and just
> indicate to CXF to do nothing with the payload, to just pass it through as
> is.
>
> Any help greatly appreciated!
> --
> View this message in context: 
> http://www.nabble.com/Sending-XML-payload-without-encoding-it-tp21925398p21925398.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::


Re: MalformedURLException when trying to initialize local transport, and some questions

2009-03-06 Thread Andrew Clegg
No suggestions anyone? Has anybody got this to work, and if so, could
they post a code example with a local:// URL?

Or should I just file a bug report?

Thanks,

Andrew.

2009/3/4 Andrew Clegg :
> Update...
>
> Tried adding
>
> bindingUri="http://cxf.apache.org/transports/local";
>
> as suggested in this thread:
>
> http://www.nabble.com/Can-local:---and-http:---addresses-coexist-on-the-same-server-td17916451.html
>
> to each of the local:// endpoints. Still get a MalformedURLException.
>
> Am I missing something really obvious here?
>
> The in_jvm_transport uses the coloc feature at the client end to set
> up local transport instead of server-side config. But in the thread I
> linked to above, Dan spotted that this feature has a serious bug. Was
> that ever addressed? I couldn't find anything in JIRA that looked
> relevant.
>
> Thanks,
>
> Andrew.
>
> 2009/3/2 Andrew Clegg :
>> Hi,
>>
>> I've started hacking around with the local transport mechanism as
>> described here:
>>
>> http://cwiki.apache.org/CXF20DOC/local-transport.html
>>
>> However, when I try to bring it up endpoints listening on a local://
>> URL I get a MalformedURLException.
>>
>> The code looks like this:
>>
>> __endpoints[ 0 ] = Endpoint.publish( "local://CodaCathService",
>>        new CodaCathProvider() );
>> __endpoints[ 1 ] = Endpoint.publish( "local://CodaPfamService",
>>        new CodaPfamProvider() );
>> __endpoints[ 2 ] = Endpoint.publish( "local://GecoService",
>>        new GecoProvider() );
>> __endpoints[ 3 ] = Endpoint.publish( "local://HippiService",
>>        new HippiProvider() );
>>
>> where __endpoints is an array of javax.xml.ws.Endpoint .And the
>> stacktrace looks like this:
>>
>> javax.xml.ws.WebServiceException:
>> org.apache.cxf.service.factory.ServiceConstructionException
>>        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:268)
>>        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:202)
>>        at 
>> org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:84)
>>        at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
>>        at 
>> info.cathdb.funcnet.impl.EmbeddedServiceIntegrationTest.setUpClass(EmbeddedServiceIntegrationTest.java:65)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>        at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at 
>> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>>        at 
>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>>        at 
>> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>>        at 
>> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>>        at 
>> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>>        at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
>>        at 
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
>>        at 
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>        at 
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>>        at 
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>        at 
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>        at 
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>> Caused by: org.apache.cxf.service.factory.ServiceConstructionException
>>        at 
>> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:139)
>>        at 
>> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:168)
>>        at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:339)
>>        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:252)
>>        ... 20 more
>> Caused by: java.net.MalformedURLException: unknown protocol: local
>>        at java.net.URL.(URL.java:574)
>>        at java.net.URL.(URL.java:464)
>>        at java.net.URL.(URL.java:413)

Re: MalformedURLException when trying to initialize local transport, and some questions

2009-03-04 Thread Andrew Clegg
Update...

Tried adding

bindingUri="http://cxf.apache.org/transports/local";

as suggested in this thread:

http://www.nabble.com/Can-local:---and-http:---addresses-coexist-on-the-same-server-td17916451.html

to each of the local:// endpoints. Still get a MalformedURLException.

Am I missing something really obvious here?

The in_jvm_transport uses the coloc feature at the client end to set
up local transport instead of server-side config. But in the thread I
linked to above, Dan spotted that this feature has a serious bug. Was
that ever addressed? I couldn't find anything in JIRA that looked
relevant.

Thanks,

Andrew.

2009/3/2 Andrew Clegg :
> Hi,
>
> I've started hacking around with the local transport mechanism as
> described here:
>
> http://cwiki.apache.org/CXF20DOC/local-transport.html
>
> However, when I try to bring it up endpoints listening on a local://
> URL I get a MalformedURLException.
>
> The code looks like this:
>
> __endpoints[ 0 ] = Endpoint.publish( "local://CodaCathService",
>        new CodaCathProvider() );
> __endpoints[ 1 ] = Endpoint.publish( "local://CodaPfamService",
>        new CodaPfamProvider() );
> __endpoints[ 2 ] = Endpoint.publish( "local://GecoService",
>        new GecoProvider() );
> __endpoints[ 3 ] = Endpoint.publish( "local://HippiService",
>        new HippiProvider() );
>
> where __endpoints is an array of javax.xml.ws.Endpoint .And the
> stacktrace looks like this:
>
> javax.xml.ws.WebServiceException:
> org.apache.cxf.service.factory.ServiceConstructionException
>        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:268)
>        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:202)
>        at 
> org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:84)
>        at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
>        at 
> info.cathdb.funcnet.impl.EmbeddedServiceIntegrationTest.setUpClass(EmbeddedServiceIntegrationTest.java:65)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>        at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>        at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>        at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>        at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>        at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
>        at 
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
>        at 
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>        at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>        at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>        at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>        at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException
>        at 
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:139)
>        at 
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:168)
>        at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:339)
>        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:252)
>        ... 20 more
> Caused by: java.net.MalformedURLException: unknown protocol: local
>        at java.net.URL.(URL.java:574)
>        at java.net.URL.(URL.java:464)
>        at java.net.URL.(URL.java:413)
>        at 
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.(JettyHTTPDestination.java:91)
>        at 
> org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTPTransportFactory.java:116)
>        at 
> org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTransportFactory.java:103)
>        at 
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:74)
>        at 
> org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90)
>        at org.apache.cx

Re: NTML proxy from Linux machine

2009-03-03 Thread Andrew Clegg
Have you tried ntlmaps?

http://ntlmaps.sourceforge.net/

I used to use this to allow a Linux laptop to get to the internet from
a corporate LAN with an NTLM proxy. Sounds like you have the same
problem.

Andrew.

2009/3/3 Fendy Zhong :
>
> Hi,
>
> I am developing a server process running on Linux that need to use the
> corporate NTLM web proxy to invoke a web service in internet.  It works on a
> Windows box, think because the HttpUrlConnection was able to use the native
> credential in the Windows workstation.  On the Linux server, I am getting
> 407 error.  Does anyone know how I can specify the Windows credential
> through the configuration correctly?
>
> Thank you,
>
> Fendy
> --
> View this message in context: 
> http://www.nabble.com/NTML-proxy-from-Linux-machine-tp22302243p22302243.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::


MalformedURLException when trying to initialize local transport, and some questions

2009-03-02 Thread Andrew Clegg
Hi,

I've started hacking around with the local transport mechanism as
described here:

http://cwiki.apache.org/CXF20DOC/local-transport.html

However, when I try to bring it up endpoints listening on a local://
URL I get a MalformedURLException.

The code looks like this:

__endpoints[ 0 ] = Endpoint.publish( "local://CodaCathService",
new CodaCathProvider() );
__endpoints[ 1 ] = Endpoint.publish( "local://CodaPfamService",
new CodaPfamProvider() );
__endpoints[ 2 ] = Endpoint.publish( "local://GecoService",
new GecoProvider() );
__endpoints[ 3 ] = Endpoint.publish( "local://HippiService",
new HippiProvider() );

where __endpoints is an array of javax.xml.ws.Endpoint .And the
stacktrace looks like this:

javax.xml.ws.WebServiceException:
org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:268)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:202)
at 
org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:84)
at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
at 
info.cathdb.funcnet.impl.EmbeddedServiceIntegrationTest.setUpClass(EmbeddedServiceIntegrationTest.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at 
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:139)
at 
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:168)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:339)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:252)
... 20 more
Caused by: java.net.MalformedURLException: unknown protocol: local
at java.net.URL.(URL.java:574)
at java.net.URL.(URL.java:464)
at java.net.URL.(URL.java:413)
at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.(JettyHTTPDestination.java:91)
at 
org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTPTransportFactory.java:116)
at 
org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTransportFactory.java:103)
at 
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:74)
at 
org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90)
at org.apache.cxf.endpoint.ServerImpl.(ServerImpl.java:69)
at 
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:118)
... 23 more

So it looks like this is still using the JettyHTTPTransportFactory
rather than the LocalTransportFactory. Is the example on that wiki
page complete? It seems to me that if you follow the 'in code'
example, rather than 'in XML', you don't get a chance to specify what
transport factory to use.

I should add that this is in a JUnit test where I'm trying to start
the services and call them in the same thread. For my real
configuration, once it's working in test, I've followed the 'in XML'
example and defined local:// mirrors of my http endpoints in
cxf-servlet.xml like this:




http://cxf.apache.org/transports/local
http://schemas.xmlsoap.org/soap/http
http://schemas.xmlsoap.org/wsdl/soap/http












I have three questions though, maybe a good idea to ask them now in
case these will be show-stoppers... Does 

Re: CXF client program related question

2009-03-02 Thread Andrew Clegg
http://cwiki.apache.org/CXF20DOC/ws-support.html

Not sure how up to date that is, perhaps others (who actually use any
of these features) can comment :-)

Andrew.

2009/3/2 Avi Grossbard :
>>Should be fine as long as everything is standards-compliant.
> Does CXF supports the WS-*  standards that Microsoft is supporting?
>   (for instance: WS-Addressing, WS-Security, WS-Transaction, *WS-*Reliability
> etc...)
>
> Avi
>
>
> On Mon, Mar 2, 2009 at 3:01 PM, Andrew Clegg wrote:
>
>> Should be fine as long as everything is standards-compliant.
>>
>> Document/literal wrapped is the usual format in the MS world, right?
>> CXF has no problem with services like this, in my experience.
>>
>> By the way, I found a blog post with some more detail on dynamic clients:
>>
>>
>> http://techpolesen.blogspot.com/2007/08/jax-ws-dynamic-dispatch-with-cxf.html
>>
>> Andrew.
>>
>> 2009/3/2 Avi Grossbard :
>> > Thanks Andrew this seems to be the answer to my question.
>> >
>> > Does anybody knows whether this kind of client (or CXF clients in
>> general)
>> > can inter-operate with Microsoft WCF based web services?
>> >
>> > Avi.
>> >
>> > On Mon, Mar 2, 2009 at 1:02 PM, Andrew Clegg > >wrote:
>> >
>> >> Do you mean like this?
>> >>
>> >> http://cwiki.apache.org/CXF20DOC/dynamic-clients.html
>> >>
>> >> Andrew.
>> >>
>> >> 2009/3/1 Avi Grossbard :
>> >> > Hi,
>> >> > I'm looking for an easy way to create a client program that can invoke
>> >> web
>> >> > service dynamically without compile time code generation.
>> >> > The expected web services to be invoked are of mostly from Microsoft
>> >> world
>> >> > (ASMX & WCF).
>> >> > Note: The only assumption that I'm allowed to make is that I have a
>> WSDL
>> >> at
>> >> > hand for each service to be invoked.
>> >> >
>> >> >
>> >> > 1. Is CXF equipped with the functionality:
>> >> > 1.1 To allow dynamically (no compile time generated file) invoke web
>> >> service
>> >> > call as mentioned above
>> >> > 1.2 To  interoperable successfully with WCF based web services
>> >> > 1.3 If the answer is, "use the JAX-WS Dispatch API", then why should I
>> >> use
>> >> > CXF anyway? or in other words, what are the merits of using CXF (again
>> >> for
>> >> > invoking web services only) relative to direct use of JAX-WS ?
>> >> >
>> >> > 2. An example (if available) that demonstrate it, will be very useful
>> >> >
>> >> > 3. If CXF client cannot inter-operate "out of the box" with WCF based
>> >> > services (I assume due to the WS-* protocols), can WSIT project come
>> to
>> >> > rescue ? if so how ?
>> >> >    (an example will be helpfull here too)
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> :: http://biotext.org.uk/ ::
>> >>
>> >
>>
>>
>>
>> --
>> :: http://biotext.org.uk/ ::
>>
>



-- 
:: http://biotext.org.uk/ ::


Re: OO <-> WS paradigm mismatch

2009-03-02 Thread Andrew Clegg
One other option (my preferred way), similar to your option C.

Think in terms of services and messages, rather than objects, classes
and methods. Get away from the "services as a way of doing remote Java
method invocation" mindset. Design your services WSDL-first (if
possible) for all the good reasons discussed here:

http://static.springframework.org/spring-ws/sites/1.5/reference/html/why-contract-first.html

As for your specific example, it depends on the requirements of your
application, but you could provide four operations:

GetAuthorByID

GetBookByID

GetAuthorWithBooksByID

GetBookWithAuthorsByID

The first two just return an author or book element respectively, but
the last two have the books for that author, or authors for that book,
nested within.

If it would make things smoother, you can also provide:

GetAuthorsByBookID

GetBooksByAuthorID

These can remove the redundancy when the client already has the book,
and wants the authors, or vice versa. But only write these if you
actually need them.

Design operations that reflect your actual business logic, don't worry
about things like cyclic dependencies, and maybe they won't be an
issue in practice. All it might mean is a little more 'glue' code to
mediate between your web services and your persistent JPA objects.

This also means you'll end up with portable and interoperable WSDLs,
it decouples your service contract from any one programming language
or toolkit, and allows the WSDL to will remain stable even if the
server-side data model has to change.

Andrew.

2009/3/2 geirgp :
>
> Now, this is more a Web Service design issue than a CXF issue, but I am
> wondering how CXF/Java users solve/work around it.
>
> The WS definition is limited compared to how you can model data in an OO
> language. A classic example is bidirectional relationships, widely used in
> JPA/Hibernate applications, which would lead to cyclic references and a hard
> crash if used with CXF. I've written my thoughts below, but have no clear
> idea about what is the best approach on how to work around this issue. What
> are your experiences/best practices?
>
> I will use the Author-Book model as an example to express my thoughts:
>
> public class Author{
>   private Long id;
>   private String name;
>   private Collection books;
> }
>
> public class Book{
>   private Long id;
>   private String title;
>   private Author author;
> }
>
> In its current form this model will cause a cyclic reference error when used
> with CXF because Author holds a collection of Books which refers back to the
> Author. I have come up with 3 strategies to work around this issue and
> "CXF-enable" my service:
>
> A)
> Modify domain model to have no cyclic dependencies by removing either
> Book.author OR Author.books. Example:
>
> public class Author{
>   private Long id;
>   private String name;
>   private Collection books;
> }
>
> public class Book{
>   private Long id;
>   private String title;
>
> }
> Pros:
> * Model can still be traversed (one direction) without making another call
> to the service.
> cons:
> * Model can only be traversed one way (Author->Books). When client has a
> Book, he must make another call to the service to get the Author. More
> complexity and more costly in terms of performance
> * I have to change my server-side business code which depends on traversing
> objects, they can no longer access book.getAuthor(). Instead I will have to
> introduce an extra dao-call, AuthorDao.findByBookId(..). This is not good in
> terms of both complexity and performance.
>
> B)
> Another possible solution is to introduce a layer between my DAO and
> WebService implementation which nulls out potentional cyclic references,
> example:
>
> @WebService
> public class LibraryService {
>  private AuthorDao authorDao;
>  private BookDao bookDao;
>
>  public Author findAuthorById(Long id) {
>  Author author = authorDao.find( id );
>  for( Book book : author.getBooks() ) {
>   book.setAuthor( null );
>  }
>  return author;
>  }
>
>  public Book findBookById( Long id ) {
>  Book book = bookDao.find( id );
>  book.getAuthor().setBooks( null );
>  return book ;
>  }
> }
>
> Pros:
> * I can keep my Domain model and traverse both ways (serverside)
> * Model can be traversed all ways, but only one way at a time (if that makes
> sense). See cons for details about this
>
>
> Cons:
> * Inconsitency in model which cannot be traversed both ways on client side.
> Books belong to an Author yet Book.author is null.
> ** When retrieveing a book, you can traverse the book and find its author,
> but not go back and find the author's books.
> ** When retrieving an author, you can traverse the author and find her
> books, but not go back and find the books' author.
> * SOAP is only ONE of the remoting protocols used for exposing my web
> services - Spring HTTP Invoker, which is capable of handling cyclic
> references, is another one. I will have to maintain two service
> implementations, one for CXF/SOAP where Book.

Re: CXF client program related question

2009-03-02 Thread Andrew Clegg
Should be fine as long as everything is standards-compliant.

Document/literal wrapped is the usual format in the MS world, right?
CXF has no problem with services like this, in my experience.

By the way, I found a blog post with some more detail on dynamic clients:

http://techpolesen.blogspot.com/2007/08/jax-ws-dynamic-dispatch-with-cxf.html

Andrew.

2009/3/2 Avi Grossbard :
> Thanks Andrew this seems to be the answer to my question.
>
> Does anybody knows whether this kind of client (or CXF clients in general)
> can inter-operate with Microsoft WCF based web services?
>
> Avi.
>
> On Mon, Mar 2, 2009 at 1:02 PM, Andrew Clegg wrote:
>
>> Do you mean like this?
>>
>> http://cwiki.apache.org/CXF20DOC/dynamic-clients.html
>>
>> Andrew.
>>
>> 2009/3/1 Avi Grossbard :
>> > Hi,
>> > I'm looking for an easy way to create a client program that can invoke
>> web
>> > service dynamically without compile time code generation.
>> > The expected web services to be invoked are of mostly from Microsoft
>> world
>> > (ASMX & WCF).
>> > Note: The only assumption that I'm allowed to make is that I have a WSDL
>> at
>> > hand for each service to be invoked.
>> >
>> >
>> > 1. Is CXF equipped with the functionality:
>> > 1.1 To allow dynamically (no compile time generated file) invoke web
>> service
>> > call as mentioned above
>> > 1.2 To  interoperable successfully with WCF based web services
>> > 1.3 If the answer is, "use the JAX-WS Dispatch API", then why should I
>> use
>> > CXF anyway? or in other words, what are the merits of using CXF (again
>> for
>> > invoking web services only) relative to direct use of JAX-WS ?
>> >
>> > 2. An example (if available) that demonstrate it, will be very useful
>> >
>> > 3. If CXF client cannot inter-operate "out of the box" with WCF based
>> > services (I assume due to the WS-* protocols), can WSIT project come to
>> > rescue ? if so how ?
>> >    (an example will be helpfull here too)
>> >
>>
>>
>>
>> --
>> :: http://biotext.org.uk/ ::
>>
>



-- 
:: http://biotext.org.uk/ ::


Re: CXF client program related question

2009-03-02 Thread Andrew Clegg
Do you mean like this?

http://cwiki.apache.org/CXF20DOC/dynamic-clients.html

Andrew.

2009/3/1 Avi Grossbard :
> Hi,
> I'm looking for an easy way to create a client program that can invoke web
> service dynamically without compile time code generation.
> The expected web services to be invoked are of mostly from Microsoft world
> (ASMX & WCF).
> Note: The only assumption that I'm allowed to make is that I have a WSDL at
> hand for each service to be invoked.
>
>
> 1. Is CXF equipped with the functionality:
> 1.1 To allow dynamically (no compile time generated file) invoke web service
> call as mentioned above
> 1.2 To  interoperable successfully with WCF based web services
> 1.3 If the answer is, "use the JAX-WS Dispatch API", then why should I use
> CXF anyway? or in other words, what are the merits of using CXF (again for
> invoking web services only) relative to direct use of JAX-WS ?
>
> 2. An example (if available) that demonstrate it, will be very useful
>
> 3. If CXF client cannot inter-operate "out of the box" with WCF based
> services (I assume due to the WS-* protocols), can WSIT project come to
> rescue ? if so how ?
>    (an example will be helpfull here too)
>



-- 
:: http://biotext.org.uk/ ::


Re: How do I setup up both a servlet engine and webservices that run on the same port?

2009-02-23 Thread Andrew Clegg
Err... Why not host your cxf services as a servlet in Tomcat, and run  
your other web site as the ROOT webapp?


Or insert favourite servlet container above.

Andrew.


On 23 Feb 2009, at 19:06, Garry Watkins  wrote:


I have an application that I need both a web server, and webservices
to run together on the same port.  How do I configure cxf to work?

Example

I need to run on http://192.168.10.100:9000/
   From this directory I will serve misc html and resources for a flex
application

Then I need to run two different web services

http://192.168.10.100:9000/ws/SomeWebService1
http://192.168.10.100:9000/ws/SomeWebService2

How do I set this up?

This is what I have so far.  Please help I have been beating myself up
all morning.  I would also prefer to do this without the spring
configuration.  I already have a zillion jars so I don't really want
that many more.

TIA

Garry

   private void setupHTTPServer(Properties props) throws Exception {
   SelectChannelConnector con = new SelectChannelConnector();
   String ipAddress = props.getProperty(HTTP_IP_ADDRESS);
   con.setHost(ipAddress);

   int port = 8080;
   try {
   port =
Integer.parseInt(props.getProperty("slx.http.port"));
   }
   catch(NumberFormatException nfe){
   // do nothing default to 8080
   }
   con.setPort(port);

   JettyHTTPServerEngineFactory sef = new
JettyHTTPServerEngineFactory();
   JettyHTTPServerEngine eng =
sef.createJettyHTTPServerEngine(port, "http");
   eng.setConnector(con);

   List handlers = new ArrayList();
   ResourceHandler resource_handler = new ResourceHandler();
   resource_handler.setResourceBase("../webServerRoot");
   handlers.add(resource_handler);

   ServletHandler servlet_handler = new ServletHandler();
   servlet_handler.addServletWithMapping(, "/MasterStatus");

servlet_handler.addServletWithMapping(SendEmployeesServlet.class, "/

SendEmployees");

   handlers.add(servlet_handler);

   eng.setHandlers(handlers);
   }

   private void setupServices(Properties props) throws Exception {
   String ipAddress = props.getProperty(HTTP_IP_ADDRESS);
   String port = props.getProperty(HTTP_PORT);
   Enumeration keys = props.keys();
   while(keys.hasMoreElements()){
   String key = (String)keys.nextElement();
   if (key.startsWith(WEB_SERVICE_URL)){
   String url =  
props.getProperty(key).replace("{http.ipAddress}",

ipAddress).replace("{http.port}", port);

   String subKey = key.replaceFirst(WEB_SERVICE_URL, "");
   String implKey = WEB_SERVICE_IMPL + subKey;
   String implClassName = props.getProperty(implKey);

   Class klass = Class.forName(implClassName);
   Constructor konstr = klass.getConstructor(new  
Class[]{});

   Object svcImpl = konstr.newInstance(new Object[]{});

   JaxWsServerFactoryBean svrFactory = new  
JaxWsServerFactoryBean();

   svrFactory.setServiceClass(klass);
   svrFactory.setAddress(url);
   svrFactory.setServiceBean(svcImpl);

   svrFactory.create();
   }
   }
   }


Re: What is a "large" SOAP message ?

2009-02-23 Thread Andrew Clegg
2009/2/23 nicolas de loof :

> Could you please tell me what is considered to be a "large" SOAP message ?
> I've found some benchmark comparison of stacks (I don't really care, I like
> CXF) and other best practices about XML message weight (
> http://www.redbooks.ibm.com/redpapers/pdfs/redp4344.pdf)
> but
> no size in bytes of a "really too big" SOAP message.

I've sent and received messages of up to about 12-13MB successfully
with CXF -- purely XML, no attachments.

I'm guessing that's at the upper end of the size spectrum (not
counting MTOM etc.). I used Provider services and Dispatch clients, so
no databinding -- the XSD for these services is actually pretty simple
(mainly  just long lists) which made parsing/generating them myself
seem like the better idea.

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Getting WSDL or schema of service from inside a JAX-WS Provider

2009-02-20 Thread Andrew Clegg
Sounds reasonable. I might try it Dan's pure-Java way first though as  
I don't tend to get on well with Spring though for some reason!


Cheers,

Andrew.


On 19 Feb 2009, at 17:30, Ian Roberts  wrote:


Andrew Clegg wrote:
At the moment that's done for me by CXF. So I have an endpoint  
defined

in cxf-servlet.xml:


implementor="info.cathdb.funcnet.impl.FrontEndServiceProviderFacade"

 endpointName="funcnet:FrontEndPort"
 serviceName="funcnet:FrontEndService"
 address="/FrontEndService"
 wsdlLocation="WEB-INF/wsdl/Services.wsdl">
  


OK, so the FrontEndService bean is your EndpointImpl.  You might be  
able

to add a setEndpoint(EndpointImpl ep) method to your
FrontEndServiceProviderFacade class and then do:




sometimes be a bit funny about circular references but I think it  
should

be OK in a simple case like this.

Ian

--
Ian Roberts   | Department of Computer Science
i.robe...@dcs.shef.ac.uk  | University of Sheffield, UK


Re: CXF vs Apache 1.4

2009-02-20 Thread Andrew Clegg

It's in the FAQ :-)

Unless you're using Provider services, in which case, see the other  
thread I just posted on.


Andrew.


On 20 Feb 2009, at 09:26,  wrote:


Hi,

I think a nice end to this thread would be a couple lines of code
telling me how to turn on schema validation?  Thanks.


John


-Original Message-
From: Daniel Kulp [mailto:dk...@apache.org]
Sent: 19 February 2009 15:19
To: users@cxf.apache.org
Cc: Baker, John: IT (LDN)
Subject: Re: CXF vs Apache 1.4

On Thu February 19 2009 10:08:23 am
john.ba...@barclayscapital.com wrote:

And if I set the missing object in CXF, HPSC doesn't reject

the message.


It's obviously interpreting the WSDL incorrectly (it uses

an ancient

version of gSoap).  So I guess my question comes down to, given the
WSDL extract, is it acceptable for the  element not

to be sent

in the message?


No.   But by default, CXF doesn't do schema validation on the
XML that JAXB
produces for performance reasons.We pretty much assume
you are filling in
the required data.

You can turn on schema validation which would have caught
this, but performance will obviously be a bit lower.

Dan






-Original Message-
From: Baker, John: IT (LDN)
Sent: 19 February 2009 14:52
To: users@cxf.apache.org
Subject: CXF vs Apache 1.4

Hi,

I recently attempted to write a client for HP Service

Center using

CXF 2.1.4, and HPSC would not accept the message (it

wouldn't tell

us why either, it just decided the message was invalid).  I then
generated stubs using Axis and went through the same

procedure, but

Axis wouldn't send the message because I was not setting an
attribute.  It threw an exception and forced me to set it, even
though the resulting XML (in the
message) just had the following placed into the message:



I've included the relevant part of the WSDL below:


 
   
   ..

Without setting the keys attribute on ChangeModelType,

Apache says:


java.io.IOException: Non nillable element 'keys' is null.
   at
org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSeri
alizer.jav
a:215)

Why doesn't CXF exhibit the same behaviour?

Thanks,


John
___

This e-mail may contain information that is confidential,

privileged

or otherwise protected from disclosure. If you are not an

intended

recipient of this e-mail, do not duplicate or

redistribute it by any

means. Please delete it and any attachments and notify the sender
that you have received it in error. Unless specifically

indicated,

this e-mail is not an offer to buy or sell or a

solicitation to buy

or sell any securities, investment products or other financial
product or service, an official confirmation of any

transaction, or

an official statement of Barclays. Any views or opinions

presented

are solely those of the author and do not necessarily represent
those of Barclays. This e-mail is subject to terms

available at the

following link:
www.barcap.com/emaildisclaimer. By messaging with Barclays you
consent to the foregoing.  Barclays Capital is the investment
banking division of Barclays Bank PLC, a company registered in
England (number 1026167) with its registered office at 1

Churchill

Place, London, E14 5HP.  This email may relate to or be sent from
other members of the Barclays Group.
___


___

This e-mail may contain information that is confidential,

privileged

or otherwise protected from disclosure. If you are not an intended
recipient of this e-mail, do not duplicate or redistribute

it by any

means. Please delete it and any attachments and notify the

sender that

you have received it in error. Unless specifically indicated, this
e-mail is not an offer to buy or sell or a solicitation to

buy or sell

any securities, investment products or other financial product or
service, an official confirmation of any transaction, or an

official

statement of Barclays. Any views or opinions presented are solely
those of the author and do not necessarily represent those of
Barclays. This e-mail is subject to terms available at the

following

link: www.barcap.com/emaildisclaimer. By messaging with

Barclays you

consent to the foregoing.  Barclays Capital is the

investment banking

division of Barclays Bank PLC, a company registered in

England (number

1026167) with its registered office at 1 Churchill Place, London,
E14 5HP.  This email may relate to or be sent from other members of
the Barclays Group. ___


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


___

This e-mail may contain information that is confidential, privileged  
or otherwise protected from disclosure. If you are not an intended  
recipient of this e-mail, do not duplicate or redistribute it by any  
means. Please delete it and any attachments and notify the sender  
that you have received it in 

Re: Getting WSDL or schema of service from inside a JAX-WS Provider

2009-02-20 Thread Andrew Clegg

Thanks Dan, I'll give that a go today.

Andrew.


On 19 Feb 2009, at 17:48, Daniel Kulp  wrote:



My suggestion would be to inject the Bus into the impl in any of the  
variety

of methods to do so.   Then do:

Definition def =
bus.getExtension(WSDLManager.class).getDefinition("/my.wsdl");

That will get the inmemory wsdl4j version of the wsdl that we use.

For the schema, you can do:
getSchemasForDefinition(def)
but as Benson mentioned, that MAY be changing.   It currently holds  
both an
Element form of the schema as well as the XmlSchema SchemaCollection  
form.
We'll probably be removing the Element form (so the DOMs can be  
garbage
collected and use less memory) so you would need to convert the  
Schemas in the
schema collection to DOM's.   That said, that's pretty easy with the  
newest

XmlSchema release.

Dan




On Mon February 16 2009 4:30:46 pm Andrew Clegg wrote:

Hi folks,

From inside a Provider implementation, how can I obtain the schema of
the service's request/response messages, short of reading the WSDL
myself and extracting the schema from it?

Thanks,

Andrew.


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


Re: Getting WSDL or schema of service from inside a JAX-WS Provider

2009-02-19 Thread Andrew Clegg
2009/2/19 Benson Margulies :
> Right. To get a running provider, someone had to call
> Endpoint.publish. I was suggesting that whomever that is would hang
> onto the returned Endpoint and pass it into the provider, or walk the
> trail to the schema and store that somewhere the provider could find
> it.

At the moment that's done for me by CXF. So I have an endpoint defined
in cxf-servlet.xml:

   
   

I want to be able to get at WEB-INF/wsdl/Services.wsdl to retrieve its
schema, from within FrontEndServiceProviderFacade, without having to
provide FrontEndServiceProviderFacade with the path to the WSDL
separately to load and parse it (because that's a violation of DRY).

Obviously I understand that CXF is calling Endpoint.publish somewhere
behind the curtain -- is there a simple way to hook into that process?
Perhaps this is easier for Spring experts but I've never done any
apart from in configuring CXF.

Thanks again,

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Getting WSDL or schema of service from inside a JAX-WS Provider

2009-02-19 Thread Andrew Clegg
2009/2/19 Benson Margulies :
> Who called Endpoint.publish()?

The first bit of your breadcrumb trail said "Endpoint.publish returns Endpoint."

> In case you haven't figured it out, I'm
> over my head at this point?

Fair enough :-)

Thanks for the pointers though. Anyone else done this?

Andrew.

>
> On Thu, Feb 19, 2009 at 8:50 AM, Andrew Clegg  wrote:
>> Okay... But I'm trying to do this from *inside* a Provider endpoint which
>> had already been published. Would I need to get cxf to inject the endpoint
>> in or something?
>>
>> Andrew.
>>
>>
>> On 19 Feb 2009, at 13:41, Benson Margulies  wrote:
>>
>>> No example that I know of, but here's the path to the candy house in
>>> the woods. Beware of witches with ovens.
>>>
>>> Endpoint.publish returns Endpoint. Endpoint can be cast to
>>> EndpointImpl. EndpointImpl returns Service. Service returns list of
>>> ServiceInfo. I don't understand exactly why it's a list, I keep
>>> meaning to ask Dan. I believe it will always return a singleton list,
>>> but if not find your particular service on the list, and then you have
>>> the item to pass to the function you found, which is extremely
>>> unlikely to melt.
>>>
>>> On Thu, Feb 19, 2009 at 8:30 AM, Andrew Clegg 
>>> wrote:
>>>>
>>>> Yeah, as long as you wouldn't say the API is likely to change in
>>>> future releases, I'm happy hooking into that. (And even if it does, I
>>>> can fall back to reading the WSDL myself). Is there an example that
>>>> demonstrates the necessary breadcrumbs?
>>>>
>>>> Cheers,
>>>>
>>>> Andrew.
>>>>
>>>> 2009/2/19 Benson Margulies :
>>>>>
>>>>> Superfically, looks like you could call that API, yes. It's used
>>>>> internally to set up validation. Of course, you'd need to follow a
>>>>> trail of breadcrumbs to the CXF-specific Service object to get there.
>>>>> Is that the issue?
>>>>>
>>>>> On Thu, Feb 19, 2009 at 7:55 AM, Andrew Clegg 
>>>>> wrote:
>>>>>>
>>>>>> So the EndpointReferenceUtils.getSchema( serviceInfo ) approach is
>>>>>> only for @WebService classes and not @WebServiceProvider classes?
>>>>>>
>>>>>> Andrew.
>>>>>>
>>>>>> 2009/2/19 Benson Margulies :
>>>>>>>
>>>>>>> CXF does not precisely have a 'copy' of the WSDL. It has a wsdl4j
>>>>>>> representation.
>>>>>>>
>>>>>>> On the 2.2 branch, there is an XmlSchemaCollection of the schemas. In
>>>>>>> earlier branches, it has a DOM copy of them.
>>>>>>>
>>>>>>> We could, I suppose, expose. I'm hoping that Dan will wade in at this
>>>>>>> point.
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Feb 19, 2009 at 5:42 AM, Andrew Clegg
>>>>>>>  wrote:
>>>>>>>>
>>>>>>>> Followup...
>>>>>>>>
>>>>>>>> So I've got this working by reading the WSDL myself in the provider
>>>>>>>> class's constructor:
>>>>>>>>
>>>>>>>>
>>>>>>>> // First read WSDL
>>>>>>>> ClassLoader loader = this.getClass().getClassLoader();
>>>>>>>> InputStream wsdlFile = loader.getResourceAsStream( WSDL_NAME );
>>>>>>>> Document wsdl = org.apache.cxf.helpers.DOMUtils.readXml( wsdlFile );
>>>>>>>>
>>>>>>>> // Then get schema body from WSDL -- TODO tighten up query using
>>>>>>>> namespaces
>>>>>>>> String schemaQuery =
>>>>>>>>
>>>>>>>> "//*[local-name()='definitions']/*[local-name()='types']/*[local-name()='schema']";
>>>>>>>> XPathExpression schemaPath = xp.compile( schemaQuery );
>>>>>>>> Node schemaNode = ( Node ) schemaPath.evaluate( wsdl,
>>>>>>>> XPathConstants.NODE );
>>>>>>>>
>>>>>>>> // Then compile it and store it
>>>>>>>> String language = XMLConstants.W3C_XML_SCHEMA_NS_

Re: Getting WSDL or schema of service from inside a JAX-WS Provider

2009-02-19 Thread Andrew Clegg
Okay... But I'm trying to do this from *inside* a Provider endpoint  
which had already been published. Would I need to get cxf to inject  
the endpoint in or something?


Andrew.


On 19 Feb 2009, at 13:41, Benson Margulies   
wrote:



No example that I know of, but here's the path to the candy house in
the woods. Beware of witches with ovens.

Endpoint.publish returns Endpoint. Endpoint can be cast to
EndpointImpl. EndpointImpl returns Service. Service returns list of
ServiceInfo. I don't understand exactly why it's a list, I keep
meaning to ask Dan. I believe it will always return a singleton list,
but if not find your particular service on the list, and then you have
the item to pass to the function you found, which is extremely
unlikely to melt.

On Thu, Feb 19, 2009 at 8:30 AM, Andrew Clegg  
 wrote:

Yeah, as long as you wouldn't say the API is likely to change in
future releases, I'm happy hooking into that. (And even if it does, I
can fall back to reading the WSDL myself). Is there an example that
demonstrates the necessary breadcrumbs?

Cheers,

Andrew.

2009/2/19 Benson Margulies :

Superfically, looks like you could call that API, yes. It's used
internally to set up validation. Of course, you'd need to follow a
trail of breadcrumbs to the CXF-specific Service object to get  
there.

Is that the issue?

On Thu, Feb 19, 2009 at 7:55 AM, Andrew Clegg > wrote:

So the EndpointReferenceUtils.getSchema( serviceInfo ) approach is
only for @WebService classes and not @WebServiceProvider classes?

Andrew.

2009/2/19 Benson Margulies :

CXF does not precisely have a 'copy' of the WSDL. It has a wsdl4j
representation.

On the 2.2 branch, there is an XmlSchemaCollection of the  
schemas. In

earlier branches, it has a DOM copy of them.

We could, I suppose, expose. I'm hoping that Dan will wade in at  
this point.



On Thu, Feb 19, 2009 at 5:42 AM, Andrew Clegg > wrote:

Followup...

So I've got this working by reading the WSDL myself in the  
provider

class's constructor:


// First read WSDL
ClassLoader loader = this.getClass().getClassLoader();
InputStream wsdlFile = loader.getResourceAsStream( WSDL_NAME );
Document wsdl =  
org.apache.cxf.helpers.DOMUtils.readXml( wsdlFile );


// Then get schema body from WSDL -- TODO tighten up query  
using namespaces

String schemaQuery =
"//*[local-name()='definitions']/*[local-name()='types']/ 
*[local-name()='schema']";

XPathExpression schemaPath = xp.compile( schemaQuery );
Node schemaNode = ( Node ) schemaPath.evaluate( wsdl,  
XPathConstants.NODE );


// Then compile it and store it
String language = XMLConstants.W3C_XML_SCHEMA_NS_URI;
SchemaFactory sf = SchemaFactory.newInstance( language );
DOMSource ds = new DOMSource( schemaNode );
this.schema = sf.newSchema( ds );


This lets me easily validate messages in the invoke() method,  
for example:



schema.newValidator().validate( domRequest );


where domRequest is the DOMSource of the message payload.

However it still seems a little inelegant to read the WSDL  
myself when

CXF must have a copy.

I've found the getSchema() method of the EndpointReferenceUtils  
class
via an old thread on here, but that requires a ServiceInfo  
object --

is there any way to acquire one of these for a Provider service?

Thanks,

Andrew.

2009/2/16 Andrew Clegg :

Hi folks,

From inside a Provider implementation, how can I obtain the  
schema of
the service's request/response messages, short of reading the  
WSDL

myself and extracting the schema from it?

Thanks,

Andrew.

--
:: http://biotext.org.uk/ ::





--
:: http://biotext.org.uk/ ::







--
:: http://biotext.org.uk/ ::







--
:: http://biotext.org.uk/ ::



Re: Getting WSDL or schema of service from inside a JAX-WS Provider

2009-02-19 Thread Andrew Clegg
Yeah, as long as you wouldn't say the API is likely to change in
future releases, I'm happy hooking into that. (And even if it does, I
can fall back to reading the WSDL myself). Is there an example that
demonstrates the necessary breadcrumbs?

Cheers,

Andrew.

2009/2/19 Benson Margulies :
> Superfically, looks like you could call that API, yes. It's used
> internally to set up validation. Of course, you'd need to follow a
> trail of breadcrumbs to the CXF-specific Service object to get there.
> Is that the issue?
>
> On Thu, Feb 19, 2009 at 7:55 AM, Andrew Clegg  wrote:
>> So the EndpointReferenceUtils.getSchema( serviceInfo ) approach is
>> only for @WebService classes and not @WebServiceProvider classes?
>>
>> Andrew.
>>
>> 2009/2/19 Benson Margulies :
>>> CXF does not precisely have a 'copy' of the WSDL. It has a wsdl4j
>>> representation.
>>>
>>> On the 2.2 branch, there is an XmlSchemaCollection of the schemas. In
>>> earlier branches, it has a DOM copy of them.
>>>
>>> We could, I suppose, expose. I'm hoping that Dan will wade in at this point.
>>>
>>>
>>> On Thu, Feb 19, 2009 at 5:42 AM, Andrew Clegg  
>>> wrote:
>>>> Followup...
>>>>
>>>> So I've got this working by reading the WSDL myself in the provider
>>>> class's constructor:
>>>>
>>>>
>>>> // First read WSDL
>>>> ClassLoader loader = this.getClass().getClassLoader();
>>>> InputStream wsdlFile = loader.getResourceAsStream( WSDL_NAME );
>>>> Document wsdl = org.apache.cxf.helpers.DOMUtils.readXml( wsdlFile );
>>>>
>>>> // Then get schema body from WSDL -- TODO tighten up query using namespaces
>>>> String schemaQuery =
>>>> "//*[local-name()='definitions']/*[local-name()='types']/*[local-name()='schema']";
>>>> XPathExpression schemaPath = xp.compile( schemaQuery );
>>>> Node schemaNode = ( Node ) schemaPath.evaluate( wsdl, XPathConstants.NODE 
>>>> );
>>>>
>>>> // Then compile it and store it
>>>> String language = XMLConstants.W3C_XML_SCHEMA_NS_URI;
>>>> SchemaFactory sf = SchemaFactory.newInstance( language );
>>>> DOMSource ds = new DOMSource( schemaNode );
>>>> this.schema = sf.newSchema( ds );
>>>>
>>>>
>>>> This lets me easily validate messages in the invoke() method, for example:
>>>>
>>>>
>>>> schema.newValidator().validate( domRequest );
>>>>
>>>>
>>>> where domRequest is the DOMSource of the message payload.
>>>>
>>>> However it still seems a little inelegant to read the WSDL myself when
>>>> CXF must have a copy.
>>>>
>>>> I've found the getSchema() method of the EndpointReferenceUtils class
>>>> via an old thread on here, but that requires a ServiceInfo object --
>>>> is there any way to acquire one of these for a Provider service?
>>>>
>>>> Thanks,
>>>>
>>>> Andrew.
>>>>
>>>> 2009/2/16 Andrew Clegg :
>>>>> Hi folks,
>>>>>
>>>>> From inside a Provider implementation, how can I obtain the schema of
>>>>> the service's request/response messages, short of reading the WSDL
>>>>> myself and extracting the schema from it?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Andrew.
>>>>>
>>>>> --
>>>>> :: http://biotext.org.uk/ ::
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> :: http://biotext.org.uk/ ::
>>>>
>>>
>>
>>
>>
>> --
>> :: http://biotext.org.uk/ ::
>>
>



-- 
:: http://biotext.org.uk/ ::


Re: Getting WSDL or schema of service from inside a JAX-WS Provider

2009-02-19 Thread Andrew Clegg
So the EndpointReferenceUtils.getSchema( serviceInfo ) approach is
only for @WebService classes and not @WebServiceProvider classes?

Andrew.

2009/2/19 Benson Margulies :
> CXF does not precisely have a 'copy' of the WSDL. It has a wsdl4j
> representation.
>
> On the 2.2 branch, there is an XmlSchemaCollection of the schemas. In
> earlier branches, it has a DOM copy of them.
>
> We could, I suppose, expose. I'm hoping that Dan will wade in at this point.
>
>
> On Thu, Feb 19, 2009 at 5:42 AM, Andrew Clegg  wrote:
>> Followup...
>>
>> So I've got this working by reading the WSDL myself in the provider
>> class's constructor:
>>
>>
>> // First read WSDL
>> ClassLoader loader = this.getClass().getClassLoader();
>> InputStream wsdlFile = loader.getResourceAsStream( WSDL_NAME );
>> Document wsdl = org.apache.cxf.helpers.DOMUtils.readXml( wsdlFile );
>>
>> // Then get schema body from WSDL -- TODO tighten up query using namespaces
>> String schemaQuery =
>> "//*[local-name()='definitions']/*[local-name()='types']/*[local-name()='schema']";
>> XPathExpression schemaPath = xp.compile( schemaQuery );
>> Node schemaNode = ( Node ) schemaPath.evaluate( wsdl, XPathConstants.NODE );
>>
>> // Then compile it and store it
>> String language = XMLConstants.W3C_XML_SCHEMA_NS_URI;
>> SchemaFactory sf = SchemaFactory.newInstance( language );
>> DOMSource ds = new DOMSource( schemaNode );
>> this.schema = sf.newSchema( ds );
>>
>>
>> This lets me easily validate messages in the invoke() method, for example:
>>
>>
>> schema.newValidator().validate( domRequest );
>>
>>
>> where domRequest is the DOMSource of the message payload.
>>
>> However it still seems a little inelegant to read the WSDL myself when
>> CXF must have a copy.
>>
>> I've found the getSchema() method of the EndpointReferenceUtils class
>> via an old thread on here, but that requires a ServiceInfo object --
>> is there any way to acquire one of these for a Provider service?
>>
>> Thanks,
>>
>> Andrew.
>>
>> 2009/2/16 Andrew Clegg :
>>> Hi folks,
>>>
>>> From inside a Provider implementation, how can I obtain the schema of
>>> the service's request/response messages, short of reading the WSDL
>>> myself and extracting the schema from it?
>>>
>>> Thanks,
>>>
>>> Andrew.
>>>
>>> --
>>> :: http://biotext.org.uk/ ::
>>>
>>
>>
>>
>> --
>> :: http://biotext.org.uk/ ::
>>
>



-- 
:: http://biotext.org.uk/ ::


Re: Getting WSDL or schema of service from inside a JAX-WS Provider

2009-02-19 Thread Andrew Clegg
Followup...

So I've got this working by reading the WSDL myself in the provider
class's constructor:


// First read WSDL
ClassLoader loader = this.getClass().getClassLoader();
InputStream wsdlFile = loader.getResourceAsStream( WSDL_NAME );
Document wsdl = org.apache.cxf.helpers.DOMUtils.readXml( wsdlFile );

// Then get schema body from WSDL -- TODO tighten up query using namespaces
String schemaQuery =
"//*[local-name()='definitions']/*[local-name()='types']/*[local-name()='schema']";
XPathExpression schemaPath = xp.compile( schemaQuery );
Node schemaNode = ( Node ) schemaPath.evaluate( wsdl, XPathConstants.NODE );

// Then compile it and store it
String language = XMLConstants.W3C_XML_SCHEMA_NS_URI;
SchemaFactory sf = SchemaFactory.newInstance( language );
DOMSource ds = new DOMSource( schemaNode );
this.schema = sf.newSchema( ds );


This lets me easily validate messages in the invoke() method, for example:


schema.newValidator().validate( domRequest );


where domRequest is the DOMSource of the message payload.

However it still seems a little inelegant to read the WSDL myself when
CXF must have a copy.

I've found the getSchema() method of the EndpointReferenceUtils class
via an old thread on here, but that requires a ServiceInfo object --
is there any way to acquire one of these for a Provider service?

Thanks,

Andrew.

2009/2/16 Andrew Clegg :
> Hi folks,
>
> From inside a Provider implementation, how can I obtain the schema of
> the service's request/response messages, short of reading the WSDL
> myself and extracting the schema from it?
>
> Thanks,
>
> Andrew.
>
> --
> :: http://biotext.org.uk/ ::
>



-- 
:: http://biotext.org.uk/ ::


Re: [JAX-WS] Setting timeout for Service.create()

2009-02-19 Thread Andrew Clegg
Thanks for the hints guys. I'll look into the system properties for
URLConnection as Dan suggests -- I'd rather load them from the web as
we're doing a dynamically configurable service manager thing. I guess
one other option if that doesn't work is to try to create each service
in a separate thread which we can abandon after a given interval.

Andrew.


On 18/02/2009, Dale Ogilvie  wrote:
>
> We have moved to loading local wsdl from file in WEB-INF/classes to
> avoid a hung ajp process in tomcat where the wsdl is unavailable.
>
> URL wsdlURL =
> getClass().getClassLoader().getResource("/ourservice.wsdl");
>
> Service s = new Service(wsdlURL);
>
> Once we have a service, we use the conduit timeouts, which seems to work
> for us.
>
> com.acme.ourservice.ServiceSoap port = s.getServiceSoap12();
>
> Client cl = ClientProxy.getClient(port);
>
> HTTPConduit http = (HTTPConduit) cl.getConduit();
>
> HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
> httpClientPolicy.setConnectionTimeout(1);
> httpClientPolicy.setReceiveTimeout(45000);
>
> http.setClient(httpClientPolicy);
>
> A question, will the above code fail if CXF ends up using URLConnection
> instead?
>
>
> -Original Message-
> From: Daniel Kulp [mailto:dk...@apache.org]
> Sent: Thursday, 19 February 2009 7:19 a.m.
> To: users@cxf.apache.org
> Cc: Andrew Clegg
> Subject: Re: [JAX-WS] Setting timeout for Service.create()
>
>
>
> Right now, the wsdl/schema retrieval just uses the normal
> java.net.URLConnection stuff.   Thus, I THINK there are system
> properties that
> can control that.
>
> There IS code in place to use our conduits (HTTPConduit) to get the
> wsdl, but it still tries the URLConnection thing first for right now and
> only does the conduit thing if that fails, except for https where it
> does the conduit thing
> first.   (I was too scared to make it do conduit thing first all the
> time,
> probably should re-look at that)
>
>
> Dan
>
>
> On Wed February 18 2009 12:09:31 pm Andrew Clegg wrote:
>> Anybody have any pointers for this one? Thanks :-)
>>
>> 2009/2/14 Andrew Clegg :
>> > Hi,
>> >
>> > Not sure if this is a CXF question or a JAX-WS API question...
>> >
>> > Is there any way to set a timeout for javax.xml.ws.Service.create()
> ?
>> > What happens if the operation to retrieve the WSDL from a remote URL
>
>> > takes forever?
>> >
>> > Cheers,
>> >
>> > Andrew.
>> >
>> > --
>> >
>> > :: http://biotext.org.uk/ ::
>
> --
> Daniel Kulp
> dk...@apache.org
> http://www.dankulp.com/blog
>


-- 
:: http://biotext.org.uk/ ::


Re: [JAX-WS] Setting timeout for Service.create()

2009-02-18 Thread Andrew Clegg
Anybody have any pointers for this one? Thanks :-)

2009/2/14 Andrew Clegg :
> Hi,
>
> Not sure if this is a CXF question or a JAX-WS API question...
>
> Is there any way to set a timeout for javax.xml.ws.Service.create() ?
> What happens if the operation to retrieve the WSDL from a remote URL
> takes forever?
>
> Cheers,
>
> Andrew.
>
> --
> :: http://biotext.org.uk/ ::
>



-- 
:: http://biotext.org.uk/ ::


Getting WSDL or schema of service from inside a JAX-WS Provider

2009-02-16 Thread Andrew Clegg
Hi folks,

>From inside a Provider implementation, how can I obtain the schema of
the service's request/response messages, short of reading the WSDL
myself and extracting the schema from it?

Thanks,

Andrew.

-- 
:: http://biotext.org.uk/ ::


[JAX-WS] Setting timeout for Service.create()

2009-02-14 Thread Andrew Clegg
Hi,

Not sure if this is a CXF question or a JAX-WS API question...

Is there any way to set a timeout for javax.xml.ws.Service.create() ?
What happens if the operation to retrieve the WSDL from a remote URL
takes forever?

Cheers,

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: XML Validation Nt working in CXF

2009-02-13 Thread Andrew Clegg
Have you switched on schema validation as specified in the FAQ?

http://cxf.apache.org/faq.html

It's off by default for performance reasons.

Andrew.

2009/2/13 arun_rocky :
>
> hi,
>
>  i have created an sample webservice and my interface is
>
> @webservice(name="sample")
> public interface Sample{
>  public String validateMethod(SampleJavaBean s);
> }
>
> i have implemented the interface
>
> public class SampleClass implements Sample{
>   public String validateMethod(SampleJavaBean s){
>return s.getFirstName();
>  }
> }
>
> now i am adding validations annotations to my bean :
>
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "SampleJavaBean", propOrder = {
>"firstName"
>  })
> @XmlRootElement(name="SampleJavaBean")
> class SampleJavaBean {
>  @XmlElememt(required = true, nillable =false)
>  private String firstName();
> }
>
> now the problem is , even if i give null values and if i send the request
> without the required field, the service is wrking fine, y the validation is
> not happening? :confused:
>
> can any one solve this problem.. thanks in advance mates
> --
> View this message in context: 
> http://www.nabble.com/XML-Validation-Nt-working-in-CXF-tp21995950p21995950.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::


Re: Suddenly, a problem with my cxf-servlet.xml

2009-02-12 Thread Andrew Clegg
I take it back! Sorry :-)

Eclipse didn't automatically revalidate on startup, so one of either
clearing the org.eclipse.wst.internet.cache or updating all my plugins
fixed it, as Dan suggested. Many thanks.

No more from me on this subject, back to work time.

Andrew.

2009/2/12 Andrew Clegg :
> No luck, I've updated all of my plugins and restarted, same two errors:
>
> cvc-complex-type.2.4.c: The matching wildcard is strict, but no
> declaration can be found for element 'jaxws:endpoint'.
>
> on every jax:ws endpoint, and
>
> - schema_reference.4: Failed to read schema document
> 'http://cxf.apache.org/schemas/jaxws.xsd', because 1) could not find
> the document; 2) the document could not be read; 3) the root element
> of the document is not .
>
> on the first jaxws:endpoint in each cxf-servlet.xml. Bizarre!
>
> If I come across a solution I'll post it...
>
> Andrew.
>
> 2009/2/12 Andrew Clegg :
>> 2009/2/12 Daniel Kulp :
>>>
>>> Honestly, I have no idea what to suggest.
>>>
>>> The schema DID change on monday when 2.1.4 was released as the new version 
>>> was
>>> put in place.   The only change was adding 
>>> 
>>> things all over it to document it better.
>>>
>>> However, the new version seems to work fine for me.I completely wiped 
>>> out
>>> my:
>>> workspace/.metadata/.plugins/org.eclipse.wst.internet.cache
>>> dir to wipe out all the cache and when I opened some config files, it
>>> downloaded the schema fine and it validates fine.I also tried a 
>>> different
>>> editor (slickedit) and it was also able to validate some config files with 
>>> the
>>> new xsd.
>>
>> Hmm, I've cleared out that directory, didn't seem to help, thanks though.
>>
>>> Thus, I have NO idea what to suggest.   Maybe check for eclipse plugin
>>> updates?   Don't really know.  :-(
>>
>> Checking now -- taking its time as usual. Will follow up when that's done.
>>
>> Cheers,
>>
>> Andrew.
>>
>> --
>> :: http://biotext.org.uk/ ::
>>
>
>
>
> --
> :: http://biotext.org.uk/ ::
>



-- 
:: http://biotext.org.uk/ ::


Re: Suddenly, a problem with my cxf-servlet.xml

2009-02-12 Thread Andrew Clegg
No luck, I've updated all of my plugins and restarted, same two errors:

cvc-complex-type.2.4.c: The matching wildcard is strict, but no
declaration can be found for element 'jaxws:endpoint'.

on every jax:ws endpoint, and

- schema_reference.4: Failed to read schema document
'http://cxf.apache.org/schemas/jaxws.xsd', because 1) could not find
the document; 2) the document could not be read; 3) the root element
of the document is not .

on the first jaxws:endpoint in each cxf-servlet.xml. Bizarre!

If I come across a solution I'll post it...

Andrew.

2009/2/12 Andrew Clegg :
> 2009/2/12 Daniel Kulp :
>>
>> Honestly, I have no idea what to suggest.
>>
>> The schema DID change on monday when 2.1.4 was released as the new version 
>> was
>> put in place.   The only change was adding 
>> 
>> things all over it to document it better.
>>
>> However, the new version seems to work fine for me.I completely wiped out
>> my:
>> workspace/.metadata/.plugins/org.eclipse.wst.internet.cache
>> dir to wipe out all the cache and when I opened some config files, it
>> downloaded the schema fine and it validates fine.I also tried a different
>> editor (slickedit) and it was also able to validate some config files with 
>> the
>> new xsd.
>
> Hmm, I've cleared out that directory, didn't seem to help, thanks though.
>
>> Thus, I have NO idea what to suggest.   Maybe check for eclipse plugin
>> updates?   Don't really know.  :-(
>
> Checking now -- taking its time as usual. Will follow up when that's done.
>
> Cheers,
>
> Andrew.
>
> --
> :: http://biotext.org.uk/ ::
>



-- 
:: http://biotext.org.uk/ ::


Re: Suddenly, a problem with my cxf-servlet.xml

2009-02-12 Thread Andrew Clegg
2009/2/12 Daniel Kulp :
>
> Honestly, I have no idea what to suggest.
>
> The schema DID change on monday when 2.1.4 was released as the new version was
> put in place.   The only change was adding 
> things all over it to document it better.
>
> However, the new version seems to work fine for me.I completely wiped out
> my:
> workspace/.metadata/.plugins/org.eclipse.wst.internet.cache
> dir to wipe out all the cache and when I opened some config files, it
> downloaded the schema fine and it validates fine.I also tried a different
> editor (slickedit) and it was also able to validate some config files with the
> new xsd.

Hmm, I've cleared out that directory, didn't seem to help, thanks though.

> Thus, I have NO idea what to suggest.   Maybe check for eclipse plugin
> updates?   Don't really know.  :-(

Checking now -- taking its time as usual. Will follow up when that's done.

Cheers,

Andrew.

-- 
:: http://biotext.org.uk/ ::


Re: Suddenly, a problem with my cxf-servlet.xml

2009-02-12 Thread Andrew Clegg
2009/2/12 Ian Roberts :
> Andrew Clegg wrote:
>> I have even tried reverting my cxf-servlet.xml from SVN as it was
>> error free right through yesterday, but no change. Has any change been
>> made to the web server or the schema at cxf.apache.org which would
>> cause this?
>
> My browser can't access http://cxf.apache.org at the moment, I guess
> there's a problem with the web server.

That's the odd thing, I can retrieve that page reliably via Firefox,
or telnet, and now it's started to work again in Eclipse's internal
browser, but Eclipse still complains that it can't read the document
(or that its root isn't xsd:schema which is blatantly untrue).

Anyone else having this problem?

It's not urgent as all my services still work okay, but it's a little
annoying that perfectly good config file have started to show
errors...

Andrew.


-- 
:: http://biotext.org.uk/ ::


Re: Suddenly, a problem with my cxf-servlet.xml

2009-02-12 Thread Andrew Clegg
2009/2/12 Andrew Clegg :

> Now, I can go to http://cxf.apache.org/schemas/jaxws.xsd in my browser
> and it's fine.
>
> But when I highlight this URL in the xsi:schemaLocation in Eclipse,
> and hit F3 for go-to-definition, I see:
>
>
> Not Found
>
> The requested URL /schemas/jaxws.xsd" was not found on this server.
> Apache/2.2.9 (Unix) Server at cxf.apache.org Port 80
>
>
> Note the spurious double-quote mark at the end of the URL.

I've solved (?) this problem with Eclipse's internal browser not
loading the page properly, by putting a space between the URL in the
schemaLocation and the final double-quote.

However the Eclipse error still remains, with the same content:

Multiple annotations found at this line:
   - schema_reference.4: Failed to read schema document
'http://cxf.apache.org/schemas/jaxws.xsd', because 1) could not find
the document; 2) the document could not be read; 3) the root element
of the document is not .
   - cvc-complex-type.2.4.c: The matching wildcard is strict, but
no declaration can be found for element 'jaxws:endpoint'.

I have even tried reverting my cxf-servlet.xml from SVN as it was
error free right through yesterday, but no change. Has any change been
made to the web server or the schema at cxf.apache.org which would
cause this?

Thanks again,

Andrew.


-- 
:: http://biotext.org.uk/ ::


Suddenly, a problem with my cxf-servlet.xml

2009-02-12 Thread Andrew Clegg
Morning all,

Between last night and today, my cxf-servlet.xml has developed a
problem, without me changing anything. Bear with me, I know it sounds
weird :-)

It looks like this:



http://www.springframework.org/schema/beans";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xmlns:jaxws="http://cxf.apache.org/jaxws";
   xmlns:soap="http://cxf.apache.org/bindings/soap";
   xmlns:funcnet="http://cathdb.info/FuncNet_1_0/";
   xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd";>

   
   




Today, Eclipse has slapped a big red cross on the jaxws:endpoint entry
(at the wsdlLocation line but I think this is arbitrary) which says:


Multiple annotations found at this line:
- schema_reference.4: Failed to read schema document 
'http://cxf.apache.org/
 schemas/jaxws.xsd', because 1) could not find the document; 2) the
document could not
 be read; 3) the root element of the document is not .
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no
declaration can be
 found for element 'jaxws:endpoint'.


Now, I can go to http://cxf.apache.org/schemas/jaxws.xsd in my browser
and it's fine.

But when I highlight this URL in the xsi:schemaLocation in Eclipse,
and hit F3 for go-to-definition, I see:


Not Found

The requested URL /schemas/jaxws.xsd" was not found on this server.
Apache/2.2.9 (Unix) Server at cxf.apache.org Port 80


Note the spurious double-quote mark at the end of the URL. The same
thing has happened in another project as well, exactly the same error
in cxf-servlet.xml, but all the other XML files in my project are
unaffected.

I've upgraded to CXF 2.1.4 but this has made no difference.

I've tried all the usual Eclipse tricks like cleaning and rebuilding
all my projects, closing and re-opening them, cutting the endpoint
definition out and pasting it back in again, and quitting and
restarting Eclipse, but to no avail. Any ideas?

Thanks in advance,

Andrew.

-- 
:: http://biotext.org.uk/ ::


  1   2   >