Creating a custom bindings

2008-02-13 Thread Shaw, Richard A
Does anybody have any tips (where to start) on how to create a custom binding ?

I created a custom binding for the old Celtix to handle simple arrays of data 
in CSV format, this was used to load data from CSV files as if I had requested 
the data from a web service. It was very useful because I could change my data 
source to a web service instead of a CSV file without having to change my 
consumer code (just the WSDL File). 

The thing that I find most confusing is the different ways in which the 
bindings can be configured, wsdl, beans, etc.

I'll try to create a step by step record of what I do when I start. 

I also want to create an FTP transport which I created for the old Celtix 
before. I am assuming that most of the concepts for the binding will be similar 
for the transport.

If anybody is interested I have a requirement document which details how I use 
the WSDL file to define the mapping between a simple XML array of records and 
the rows of a CSV file (complete with header row).

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems 

Atkins Highways and Transportation 
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: [EMAIL PROTECTED]

www.atkinsglobal.com/its



This email and any attached files are confidential and copyright protected. If 
you are not the addressee, any dissemination of this communication is strictly 
prohibited. Unless otherwise expressly agreed in writing, nothing stated in 
this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered 
in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, 
Surrey KT18 5BW. A list of wholly owned Atkins Group companies registered in 
the United Kingdom can be found at 
http://www.atkinsglobal.com/terms_and_conditions/index.aspx

Consider the environment. Please don't print this e-mail unless you really need 
to.


Re: Lazy instantiation of Web Service Client

2008-02-13 Thread Daniel Kulp
On Tuesday 12 February 2008, rsheldon wrote:
 Thanks to everyone for their help on this. It turns out that despite
 some logging that made me think it was connecting to the web service,
 CXF actually doesn't talk to the remote server until it's first used.
 I double checked this with wireshark/ethereal.

 Thanks again,
 Richard

Actually, that will depend on how you setup the client contract.   If you 
use a wsdl, it MAY contact the server to get the wsdl and schemas at 
startup time.   You can mitigate that by keeping a copy locally and 
pointing the client creation at that instead.  If it's not wsdl based, 
yea, it has no need to contact the server till used.

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


Client side plain SOAP invocation

2008-02-13 Thread silithus

Hello,

I was wondering if Cxf provides client side plain XML/SOAP invocation
capabilities.

Ideal case would be to pass SOAP messages (in form of java IO stream for
example) directly to some client-side Cxf facility which will send it to the
server, and to receive response in same form.

This is of course with no binding used, just exchanging XML over WS.

I am trying to avoid usage of java.net.URLConnection, perhaps Cxf has some
nice abstraction for this, javadoc didnt show any however.

Thanks
-- 
View this message in context: 
http://www.nabble.com/Client-side-plain-SOAP-invocation-tp15457618p15457618.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: Client side plain SOAP invocation

2008-02-13 Thread Freeman Fang
Hi,

Yeah, what you need is dispatch/provider, you can find the example from the
cxf kit.

Freeman

On Feb 13, 2008 9:04 PM, silithus [EMAIL PROTECTED] wrote:


 Hello,

 I was wondering if Cxf provides client side plain XML/SOAP invocation
 capabilities.

 Ideal case would be to pass SOAP messages (in form of java IO stream for
 example) directly to some client-side Cxf facility which will send it to
 the
 server, and to receive response in same form.

 This is of course with no binding used, just exchanging XML over WS.

 I am trying to avoid usage of java.net.URLConnection, perhaps Cxf has some
 nice abstraction for this, javadoc didnt show any however.

 Thanks
 --
 View this message in context:
 http://www.nabble.com/Client-side-plain-SOAP-invocation-tp15457618p15457618.html
 Sent from the cxf-user mailing list archive at Nabble.com.




Re: Client side plain SOAP invocation

2008-02-13 Thread Daniel Kulp

No, not really.The dispatch stuff allows raw soap sending, but it's 
through the SAAJ API's, not raw streams.  Possibly a Dispatch(Source) 
and pass it a StreamSource, but I honestly think we'll parse it into DOM 
and then send it.  (also, that won't support attachments).

If you really need to operate that low level and find the URLConnection 
object annoying, you might want to look at the commons HttpClient thing:
http://hc.apache.org/httpclient-3.x/
It might be a little nicer to work with.

Dan

On Wednesday 13 February 2008, silithus wrote:
 Hello,

 I was wondering if Cxf provides client side plain XML/SOAP invocation
 capabilities.

 Ideal case would be to pass SOAP messages (in form of java IO stream
 for example) directly to some client-side Cxf facility which will send
 it to the server, and to receive response in same form.

 This is of course with no binding used, just exchanging XML over WS.

 I am trying to avoid usage of java.net.URLConnection, perhaps Cxf has
 some nice abstraction for this, javadoc didnt show any however.

 Thanks



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


Replica aware client

2008-02-13 Thread blacksheep

Hi,

Is there a way to configure CXF generated clients to access WS server stack
with a timeout value ?

Thanks,

Mustafa
-- 
View this message in context: 
http://www.nabble.com/Replica-aware-client-tp15459476p15459476.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: Replica aware client

2008-02-13 Thread Daniel Kulp

There are several timeout things available for configuring the http stuff 
on the client side.  See:
http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html

Dan


On Wednesday 13 February 2008, blacksheep wrote:
 Hi,

 Is there a way to configure CXF generated clients to access WS server
 stack with a timeout value ?

 Thanks,

 Mustafa



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


how to configure HTTPConduit for client using java code

2008-02-13 Thread yulinxp

User's guide shows how to configure HTTPConduit for client using java code

http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html

  import org.apache.cxf.endpoint.Client;
  import org.apache.cxf.frontend.ClientProxy;
  import org.apache.cxf.transport.http.HTTPConduit;
  import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
  ...

  Client client = ClientProxy.getClient(poltim);
  HTTPConduit http = (HTTPConduit) client.getConduit();

Here the example uses org.apache.cxf.frontend.ClientProxy. 

1) Do JAX-WS FrontEnd  Simple FrontEnd have anything to do with client?
2) how to configure HTTPConduit for client if client needs to set
AegisDatabinding using ClientProxyFactoryBean?
(Or how to set HTTPConduit  AegisDatabinding for client at the same time?)

  ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
  factory.setServiceClass(HelloWorld.class);
  factory.setAddress(http://localhost:9090/spring_http/ServerEndPoint;);
  factory.getServiceFactory().setDataBinding(new AegisDatabinding()); 
  HelloWorld hw = (HelloWorld)factory.create();

. how to set
HTTPConduit ???

  String response = hw.sayHi(hello);
  System.out.println(Response:  + response);
 
-- 
View this message in context: 
http://www.nabble.com/how-to-configure-HTTPConduit-for-client-using-java-code-tp15460135p15460135.html
Sent from the cxf-user mailing list archive at Nabble.com.



doesn client need to use AegisDatabinding if server does

2008-02-13 Thread yulinxp

If CXF server uses SimpleFront end/AegisBinding, does the cxf client need to
use ClientProxyFactoryBean to set AegisDatabinding? I am very confused. 


-- 
View this message in context: 
http://www.nabble.com/doesn-client-need-to-use-AegisDatabinding-if-server-does-tp15459869p15459869.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: doesn client need to use AegisDatabinding if server does

2008-02-13 Thread Benson Margulies
No. If you get the WSDL from the server and feed it to whatever kit you
want, including CXF with JAXB, it works. Unless you find a bug. The Java you
get may be quite different from the Java on the server side, however.

On Feb 13, 2008 11:41 AM, yulinxp [EMAIL PROTECTED] wrote:


 If CXF server uses SimpleFront end/AegisBinding, does the cxf client need
 to
 use ClientProxyFactoryBean to set AegisDatabinding? I am very confused.


 --
 View this message in context:
 http://www.nabble.com/doesn-client-need-to-use-AegisDatabinding-if-server-does-tp15459869p15459869.html
 Sent from the cxf-user mailing list archive at Nabble.com.




Re: Replica aware client

2008-02-13 Thread Mustafa Egilmezbilek
Thanks for the answer, Dan.

What I meant with replica-aware is the alternative URL(s) that is used by
client when server is down or the connection or recieve times out.

Thanks.

On Feb 13, 2008 5:11 PM, Daniel Kulp [EMAIL PROTECTED] wrote:


 There are several timeout things available for configuring the http stuff
 on the client side.  See:

 http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html

 Dan


 On Wednesday 13 February 2008, blacksheep wrote:
  Hi,
 
  Is there a way to configure CXF generated clients to access WS server
  stack with a timeout value ?
 
  Thanks,
 
  Mustafa



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




-- 
Mustafa Egilmezbilek


JAX-RS No service found using Spring and JBoss

2008-02-13 Thread rm-ramos

Hi guys,

I'm trying to move from HTTP-Binding RESTful services to the new Java
standard JAX-RS using CXF+Spring, deployed on JBoss.
However I can't seem to make it work due to a No service found problem.
I've been trying to get help from multiple sources, including CXF's IRC
channel, but unfortunately there's not so much written about this. I've
tried to base my config in the CXF docs as much as I could, but still no
luck.


So, moving on to the interesting part:

My web.xml contains the CXFServlet declaration, mapped on
servlet-mapping
servlet-nameCXFServlet/servlet-name
url-pattern/services/*/url-pattern
/servlet-mapping

On beans.xml: (not actually how we call it but..)
!-- RESTful web services --
  jaxrs:server id=workOrderOperations address=/rest/
jaxrs:serviceBeans
  bean class=com.messaging.webservices.WorkOrderOperations /
/jaxrs:serviceBeans
  /jaxrs:server

And on to the implementing class:
@UriTemplate(/rest/)
public class WorkOrderOperations {
(..)
@HttpMethod(GET)
@UriTemplate(/wo/{id}/)
public String getWorkOrder(@UriParam(id) String id){return it works!
#+id;}



So, and if I got it right, http://localhost/app-name/services/rest/wo/123
should output a string, but instead a not-so-nice No service found message
shows up. And i've tried almost every possible URI, can never find a
service. Is there anything else I'm missing?
I think the CXFServlet is mapped correctly, but I'm not so sure if the
service is being registered somewhere (or where..), so I would really thank
you if you could help me out on this one. 
It's been 3 days on this now :\

Thanks,
Rui Ramos

PS. I've already though on sticking with HTTP-Bindings ftm, since I'm
starting to lose hope on this one. What are your thoughts about implementing
a REST service using bindings vs. jaxrs, both present and future
implications?
-- 
View this message in context: 
http://www.nabble.com/JAX-RS-%22No-service-found%22-using-Spring-and-JBoss-tp15461660p15461660.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: JAX-RS No service found using Spring and JBoss

2008-02-13 Thread Sergey Beryozkin

Hi

I think someone was able to run a JAX-RS HTTPS demo in a tomcat container.
I myself has always been confused about the way CXFServlet matches requests.
Can you please try /rest in both the spring config and URLTemplate ?

If you could run your Tomcat in a debugger then it would be ideal in 
identifying what is
exactly happening. I use http://www.eclipsetotale.com/tomcatPlugin.html in 
Eclipse,
copy it into eclipse plugins, then launch it from your workspace by pointing it 
to your
Tomcat installation and have a breakpoint set in a CXF ServletController.

As far as JAX-RS vs HTTP Binding is concerned, JAX-RS is the future so to say 
:-) because it's going to
be a standard way to do RESTful services inthe Java world...

Cheers, Sergey


- Original Message - 
From: rm-ramos [EMAIL PROTECTED]

To: cxf-user@incubator.apache.org
Sent: Wednesday, February 13, 2008 6:00 PM
Subject: JAX-RS No service found using Spring and JBoss




Hi guys,

I'm trying to move from HTTP-Binding RESTful services to the new Java
standard JAX-RS using CXF+Spring, deployed on JBoss.
However I can't seem to make it work due to a No service found problem.
I've been trying to get help from multiple sources, including CXF's IRC
channel, but unfortunately there's not so much written about this. I've
tried to base my config in the CXF docs as much as I could, but still no
luck.


So, moving on to the interesting part:

My web.xml contains the CXFServlet declaration, mapped on
servlet-mapping
servlet-nameCXFServlet/servlet-name
url-pattern/services/*/url-pattern
/servlet-mapping

On beans.xml: (not actually how we call it but..)
!-- RESTful web services --
  jaxrs:server id=workOrderOperations address=/rest/
jaxrs:serviceBeans
  bean class=com.messaging.webservices.WorkOrderOperations /
/jaxrs:serviceBeans
  /jaxrs:server

And on to the implementing class:
   @UriTemplate(/rest/)
   public class WorkOrderOperations {
   (..)
   @HttpMethod(GET)
   @UriTemplate(/wo/{id}/)
   public String getWorkOrder(@UriParam(id) String id){return it works!
#+id;}



So, and if I got it right, http://localhost/app-name/services/rest/wo/123
should output a string, but instead a not-so-nice No service found message
shows up. And i've tried almost every possible URI, can never find a
service. Is there anything else I'm missing?
I think the CXFServlet is mapped correctly, but I'm not so sure if the
service is being registered somewhere (or where..), so I would really thank
you if you could help me out on this one. 
It's been 3 days on this now :\


Thanks,
Rui Ramos

PS. I've already though on sticking with HTTP-Bindings ftm, since I'm
starting to lose hope on this one. What are your thoughts about implementing
a REST service using bindings vs. jaxrs, both present and future
implications?
--
View this message in context: 
http://www.nabble.com/JAX-RS-%22No-service-found%22-using-Spring-and-JBoss-tp15461660p15461660.html
Sent from the cxf-user mailing list archive at Nabble.com.



IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland


Re: CXF client SSL configure question

2008-02-13 Thread yulinxp

To answer my own question, I still need to set HTTPConduit for Client running
in Tomcat.
The SSL configuration for tomcat is for server application only??



yulinxp wrote:
 
 CXF server is running in JBoss. JBoss has enable SSL on it. 
 CXF client is another web application running in Tomcat in a different
 machine. Tomcat also has enable SSL on it. 
 
 So when client connecting to Server via HTTPS, how do I setup SSL for CXF
 client?
 My understanding is that, if JBoss and Tomcat's keystoreFile and
 truststoreFile are setup correctly(they include each other to
 truststoreFile), 
 then I don't need to configure SSL for CXF client. 
 Am I right?
 

-- 
View this message in context: 
http://www.nabble.com/CXF-client-SSL-configure-question-tp15146286p15467922.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: Deploy my service implementation separately from my security configuration?

2008-02-13 Thread jason . laskowski
Dan,

I actually got your suggestion working under JBoss 4.0.4GA but am having 
issues with running under Websphere.

I am using the SAAJ api's to send the request to the real server and then 
the generic service takes care of wrapping the security onto the response.

The service interface keeps it really generic by changing the SOAPMessage 
to a string/base64 as needed.
This way any service method can be passed without need to change the 
generic service.

@WebService(name=SAAJGatewayService, 
targetNamespace=http://services.my.namespace;)
public interface SAAJGatewayService {

String sendMessage (
@WebParam(name = message)
String message);

}

The real service works under Websphere since its not using any of the 
security.
The problem I'm having with the generic service seems to have something to 
do with the SAAJ api's conflicting with the servers j2ee.jar (SOAPMessage, 
SOAPBody, and SOAPPart classes).
I tried having the jars for the SAAJ put on the Websphere server, but now 
it looks like I am having problems mixing com.sun with com.ibm xerces 
parsers.

Without the saaj api on the server, I actually had the response coming 
back to the generic server, but the SoapOutInterceptor is blowing up on:

ExtendedMessage: Interceptor has thrown exception, unwinding 
noworg.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to 
insert a node where it is not permitted.
.at org.apache.xerces.dom.CoreDocumentImpl.insertBefore(Unknown Source)
.at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source)
.at com.ibm
.ws.webservices.engine.xmlsoap.SOAPPart.appendChild(SOAPPart.java:244)
.at 
org.apache.cxf.staxutils.W3CDOMStreamWriter.newChild(W3CDOMStreamWriter.java:82)
.at 
org.apache.cxf.staxutils.W3CDOMStreamWriter.writeStartElement(W3CDOMStreamWriter.java:99)
.at 
org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.writeSoapEnvelopeStart(SoapOutInterceptor.java:95)
.at 
org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:76)
.at 
org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:57)
.at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
.at 
org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:74)
.at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
.at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:77)
.at 
org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:79)
.at 
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:264)
.at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
.at 
org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:170)
.at 
org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:148)
etc

I am stuck at this point wondering what is happening to the SOAP object 
that could be causing this HIERARCHY_REQUEST_ERR.




Daniel Kulp [EMAIL PROTECTED] 
02/05/2008 02:50 PM

To
cxf-user@incubator.apache.org
cc
[EMAIL PROTECTED]
Subject
Re: Deploy my service implementation separately from my security 
configuration?








You MAY be able to do this by writing a completely generic 
ProviderSOAPMessage based service that just forwards onto another 
service.   The security information would be set on that and the spring 
could configure in a URL to the service it then sends the SOAP messages 
onto.   It would then use the dispatch APIs (or even the straight SAAJ 
apis I think would work if you are talking straight HTTP) to forward the 
SAAJ message onto the real server, get the SAAJ back, and return it 
where the security would do it's thing. 

Dan



On Monday 04 February 2008, [EMAIL PROTECTED] wrote:
 Hello,

 I am working with CXF 2.0.4 with javaFirst/Spring/CXF Servlet.
 I have the jaxws setup using Timestamp, Signature, and Encypt.
 I have some customized interceptors and  a handler.

 This is all included in one war file (just like the demos) that I
 deploy to JBoss (and eventually Websphere).

 I was wondering if its possible to:
 - separate out my service implementation as one war file and my
 security configuration as another war file
   or
 - have my service endpoint be external from the same JVM that CXF is
 under (the internal endpoint is different from the published external
 endpoint).


 The goal is to keep the security settings untouchable when further
 maintenance/enhancements of the service methods goes forward.
 We don't want to have to worry about the security getting broken once
 we know that its working correctly.

 I believe that this is called hardening the security.

 Any suggestions/readings would really be appreciated.



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



Re: soap fault question

2008-02-13 Thread David Castañeda
In a previous thread some ask for other samples projects ideas...

what are the possibilities of adding a sample of fault handling (Soap Fault
Handling, @WebFault).

I have been trying for long to implement correct fault handling, but :(, or
maybe some more explicit documentation.. so I can create that sample
project. If any body want me to do it... I could create a first template so
any body with the knowledge would provide the exception handling missing
parts.


regards,

-- 
David Castañeda R.


Issue with WSDL or CXF

2008-02-13 Thread Kyle.Bober

I have a Simple WSDL from which I generate the client and server code using
the applicable Maven2 plugins. My WSDL is as follows:

?xml version=1.0 encoding=UTF-8 standalone=no?
wsdl:definitions name=UserService 
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;   
xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; 
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xmlns:user-service=http://ws.user.service.websend.agfa.com;
xmlns:user-model=http://model.ws.user.service.websend.agfa.com;
targetNamespace=http://ws.user.service.websend.agfa.com;
  
  wsdl:types
xsd:schema 
targetNamespace=http://model.ws.user.service.websend.agfa.com;
xmlns:user-model=http://model.ws.user.service.websend.agfa.com;

  xsd:element name=logonRequest
type=user-model:UserSO/xsd:element
  xsd:element name=logonResponse
type=user-model:UserSO/xsd:element

  xsd:complexType name=UserSO
xsd:sequence
xsd:element name=username type=xsd:string/
xsd:element name=password type=xsd:string/
xsd:element name=validated type=xsd:boolean/
/xsd:sequence
  /xsd:complexType
  
/xsd:schema
  /wsdl:types

  wsdl:message name=logonRequest
wsdl:part element=user-model:logonRequest name=in/
  /wsdl:message
  wsdl:message name=logonResponse
wsdl:part element=user-model:logonResponse name=out/
  /wsdl:message
  
  wsdl:portType name=UserServicePortType
wsdl:operation name=logon
wsdl:input name=logonRequest message=user-service:logonRequest/
wsdl:output name=logonRespons message=user-service:logonResponse/
/wsdl:operation
  /wsdl:portType
  
  wsdl:binding name=UserServiceBinding
type=user-service:UserServicePortType
soap:binding style=document
transport=http://schemas.xmlsoap.org/soap/http/

wsdl:operation name=logon
  soap:operation soapAction= style=document/
  wsdl:input
soap:body use=literal/
  /wsdl:input
  wsdl:output
soap:body use=literal/
  /wsdl:output
/wsdl:operation

  /wsdl:binding
  
  wsdl:service name=UserService
wsdl:port name=UserService binding=user-service:UserServiceBinding
  soap:address location=http://localhost:8080/UserService/
/wsdl:port
  /wsdl:service
/wsdl:definitions

Whenever I run the generated Client code I receive the following error:

Feb 13, 2008 5:00:29 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service {http://ws.user.service.websend.agfa.com}UserService
from WSDL:
http://localhost:8080/com.agfa.websend.server.ws.user/services/UserService?wsdl
Invoking logon...
Exception in thread main javax.xml.ws.soap.SOAPFaultException: Fault
occurred while processing.
at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
at $Proxy25.logon(Unknown Source)
at
com.agfa.websend.service.user.ws.UserServicePortType_UserService_Client.main(UserServicePortType_UserService_Client.java:44)
Caused by: org.apache.cxf.binding.soap.SoapFault: Fault occurred while
processing.
at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:70)
at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
at
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96)
at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:56)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1955)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)
at 
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at 

Re: Issue with WSDL or CXF

2008-02-13 Thread Daniel Kulp

Kyle,

From the stack trace, it's getting a fault back from the server.   Thus, 
the question is: why is the server sending back a fault?

Two things that would help figure that out:

1) If you can use wireshark or tcpdump or something to get the wirelevel 
messages, that can sometimes help.   Alternatively, look at:
http://cwiki.apache.org/CXF20DOC/debugging.html
to turn on various logging things.

2) Check the server side logs to see if there is anything like a stack 
trace or similar there.   That could potentially be the biggest help.

Dan



On Wednesday 13 February 2008, Kyle.Bober wrote:
 I have a Simple WSDL from which I generate the client and server code
 using the applicable Maven2 plugins. My WSDL is as follows:

 ?xml version=1.0 encoding=UTF-8 standalone=no?
 wsdl:definitions name=UserService
   xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
   xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
   xmlns:xsd=http://www.w3.org/2001/XMLSchema;
   xmlns:user-service=http://ws.user.service.websend.agfa.com;
   xmlns:user-model=http://model.ws.user.service.websend.agfa.com;
   targetNamespace=http://ws.user.service.websend.agfa.com;

   wsdl:types
 xsd:schema
   targetNamespace=http://model.ws.user.service.websend.agfa.com;
   xmlns:user-model=http://model.ws.user.service.websend.agfa.com;

   xsd:element name=logonRequest
 type=user-model:UserSO/xsd:element
   xsd:element name=logonResponse
 type=user-model:UserSO/xsd:element

   xsd:complexType name=UserSO
   xsd:sequence
   xsd:element name=username type=xsd:string/
   xsd:element name=password type=xsd:string/
   xsd:element name=validated type=xsd:boolean/
   /xsd:sequence
   /xsd:complexType

 /xsd:schema
   /wsdl:types

   wsdl:message name=logonRequest
   wsdl:part element=user-model:logonRequest name=in/
   /wsdl:message
   wsdl:message name=logonResponse
   wsdl:part element=user-model:logonResponse name=out/
   /wsdl:message

   wsdl:portType name=UserServicePortType
 wsdl:operation name=logon
   wsdl:input name=logonRequest
 message=user-service:logonRequest/ wsdl:output name=logonRespons
 message=user-service:logonResponse/ /wsdl:operation
   /wsdl:portType

   wsdl:binding name=UserServiceBinding
 type=user-service:UserServicePortType
 soap:binding style=document
 transport=http://schemas.xmlsoap.org/soap/http/

 wsdl:operation name=logon
   soap:operation soapAction= style=document/
   wsdl:input
 soap:body use=literal/
   /wsdl:input
   wsdl:output
 soap:body use=literal/
   /wsdl:output
 /wsdl:operation

   /wsdl:binding

   wsdl:service name=UserService
 wsdl:port name=UserService
 binding=user-service:UserServiceBinding soap:address
 location=http://localhost:8080/UserService/ /wsdl:port
   /wsdl:service
 /wsdl:definitions

 Whenever I run the generated Client code I receive the following
 error:

 Feb 13, 2008 5:00:29 PM
 org.apache.cxf.service.factory.ReflectionServiceFactoryBean
 buildServiceFromWSDL
 INFO: Creating Service
 {http://ws.user.service.websend.agfa.com}UserService from WSDL:
 http://localhost:8080/com.agfa.websend.server.ws.user/services/UserSer
vice?wsdl Invoking logon...
 Exception in thread main javax.xml.ws.soap.SOAPFaultException: Fault
 occurred while processing.
   at
 org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175
) at $Proxy25.logon(Unknown Source)
   at
 com.agfa.websend.service.user.ws.UserServicePortType_UserService_Clien
t.main(UserServicePortType_UserService_Client.java:44) Caused by:
 org.apache.cxf.binding.soap.SoapFault: Fault occurred while
 processing.
   at
 org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handl
eMessage(Soap11FaultInInterceptor.java:70) at
 org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handl
eMessage(Soap11FaultInInterceptor.java:35) at
 org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
rChain.java:208) at
 org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessa
ge(AbstractFaultChainInitiatorObserver.java:96) at
 org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM
essage(ReadHeadersInterceptor.java:183) at
 org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM
essage(ReadHeadersInterceptor.java:56) at
 org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
rChain.java:208) at
 org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429) at
 org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRe
sponse(HTTPConduit.java:1955) at
 org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HT
TPConduit.java:1791) at
 org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66
) at
 org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
 at
 

Re: Replica aware client

2008-02-13 Thread Daniel Kulp

Mustafa,

There is support for some FailoverStrategy things in CXF, but I'm 
struggling to find any documentation for it on our wiki or even in the 
code.   The best I can do right now is to point you at IONA's commercial 
product docs at:
http://www.iona.com/support/docs/artix/5.0/deploy/java/wwhelp/wwhimpl/js/html/wwhelp.htm
and look in the Enabling High Availability section.   Some of it 
doesn't apply to CXF as the strategies are only available with the 
commercial stuff. The static failover stuff should work, I think.   
The dynamic stuff won't.

You can also write your own FailoverStrategy class that does your own 
thing.   I'm not really sure how complex that is though. 

That all said, if you dig through all of the above and come up with a 
good demo or something, we'd love to have it in CXF.   :-)

Dan


On Wednesday 13 February 2008, Mustafa Egilmezbilek wrote:
 Thanks for the answer, Dan.

 What I meant with replica-aware is the alternative URL(s) that is used
 by client when server is down or the connection or recieve times out.

 Thanks.

 On Feb 13, 2008 5:11 PM, Daniel Kulp [EMAIL PROTECTED] wrote:
  There are several timeout things available for configuring the http
  stuff on the client side.  See:
 
  http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl
 -support.html
 
  Dan
 
  On Wednesday 13 February 2008, blacksheep wrote:
   Hi,
  
   Is there a way to configure CXF generated clients to access WS
   server stack with a timeout value ?
  
   Thanks,
  
   Mustafa
 
  --
  J. Daniel Kulp
  Principal Engineer, IONA
  [EMAIL PROTECTED]
  http://www.dankulp.com/blog



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


Re: soap fault question

2008-02-13 Thread Daniel Kulp
On Wednesday 13 February 2008, David Castañeda wrote:
 In a previous thread some ask for other samples projects ideas...

 what are the possibilities of adding a sample of fault handling (Soap
 Fault Handling, @WebFault).

 I have been trying for long to implement correct fault handling, but
 :(, or maybe some more explicit documentation.. so I can create that
 sample project. If any body want me to do it... I could create a first
 template so any body with the knowledge would provide the exception
 handling missing parts.

That's a great idea!  Feel free to create a Better Fault handling demo 
JIRA item and start attaching things to it.   

This is good for a couple reasons:
1) It will help get you the information that you need to get your project 
working.

2) It will show us how users are expecting it to work, and not succeeding 
so hopefully we can make it work. 


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