Re: Using cxf with external web-services

2008-04-16 Thread Valerio Schiavoni
Hello Glen,

On Sat, Apr 12, 2008 at 4:50 AM, Glen Mazza [EMAIL PROTECTED] wrote:

 Perhaps my client example may help you:
 http://www.jroller.com/gmazza/date/20070929


this helps, explaining the process step-by-step gives an insight that I was
somehow missing.

-- 
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni


Using cxf with external web-services

2008-04-11 Thread Valerio Schiavoni
Hello everyone,
suppose I want to write a client application to use the  meteo webservice at
this address:

http://www.webservicex.net/globalweather.asmx?WSDL

What are the steps to do so using CXF ?
I've been using wsdl2java to geneate java classes and interfaces, but it's
not quite clear how to combine such classes with cxf. In particular, up to
now I've been using cxf to generate clients using the
ClientProxyFactoryBean...or the DynamicClientfactory to generate the client.

So, help is very appreciated.

Cheers,
Valerio

-- 
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni


Re: Possible to use CXF without Spring ?

2008-04-04 Thread Valerio Schiavoni
You were right.

I excluded a bunch of dependencies, and everything still works just fine.

Thanks for the prompt support !

As a side node, you might be interested to know that CXF is currently being
used as support to build the web-service based bindings in the
www.scorware.org project, which aims at building a SCA runtime the same way
Tuscany does.

Cheers,
Valerio


On Fri, Apr 4, 2008 at 3:57 AM, Daniel Kulp [EMAIL PROTECTED] wrote:

 On Thursday 03 April 2008, Valerio Schiavoni wrote:
  Interesting.
  My needs are indeed quite simple: i export java interfaces (without
  annotations), using hte ServerFactoryBean (configured manually with
  AegisDatabinding), and the same operations on the client side. Do you
  think such operations are enough simple to be done without Spring?

 They should be.   Nothing special there.  :-)


  Where can I see some example of such configuration ?

 Seriously, just remove the spring jars.  In theory, it should detect that
 spring isn't there and flip over to the other way of setting things up.

 Dan



 
  Thanks,
  Valerio
 
  On Thu, Apr 3, 2008 at 11:42 PM, Daniel Kulp [EMAIL PROTECTED] wrote:
   CXF can be used without spring for some very basic use cases.
   Basically, simple JAXWS+JAXB client/server with no configuration (or
   use API's for configuration) and none of the complex things like
   ws-security/ws-rm that requires said configuration.
  
   Once you need to start configuring things, though, you may need the
   spring configs or you would need to write your own things to call on
   the API's to configure stuff.
  
   That said, I haven't tests the non-spring support lately.  :-(
  
   Dan
  
   On Thursday 03 April 2008, Valerio Schiavoni wrote:
this might sound weird but: how could I use cxf without its Spring
support ?
   
   
Within our framework we already use another component-model
(Fractal, see http://fractal.objectweb.org), and having both at
the same time is a bit too much. Everything works fine, let me be
clear, but I'd like to explore a solution without having cxf
import (transitively) all its Spring depedencies.
   
Thanks,
Valerio
  
   --
   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




-- 
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni


Possible to use CXF without Spring ?

2008-04-03 Thread Valerio Schiavoni
Hello everyone,

this might sound weird but: how could I use cxf without its Spring support ?


Within our framework we already use another component-model (Fractal, see
http://fractal.objectweb.org), and having both at the same time is a bit too
much. Everything works fine, let me be clear, but I'd like to explore a
solution without having cxf import (transitively) all its Spring
depedencies.

Thanks,
Valerio

-- 
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni


Re: Possible to use CXF without Spring ?

2008-04-03 Thread Valerio Schiavoni
Interesting.
My needs are indeed quite simple: i export java interfaces (without
annotations), using hte ServerFactoryBean (configured manually with
AegisDatabinding), and the same operations on the client side. Do you think
such operations are enough simple to be done without Spring?

Where can I see some example of such configuration ?

Thanks,
Valerio

On Thu, Apr 3, 2008 at 11:42 PM, Daniel Kulp [EMAIL PROTECTED] wrote:


 CXF can be used without spring for some very basic use cases.
 Basically, simple JAXWS+JAXB client/server with no configuration (or use
 API's for configuration) and none of the complex things like
 ws-security/ws-rm that requires said configuration.

 Once you need to start configuring things, though, you may need the
 spring configs or you would need to write your own things to call on the
 API's to configure stuff.

 That said, I haven't tests the non-spring support lately.  :-(

 Dan

 On Thursday 03 April 2008, Valerio Schiavoni wrote:
  this might sound weird but: how could I use cxf without its Spring
  support ?
 
 
  Within our framework we already use another component-model (Fractal,
  see http://fractal.objectweb.org), and having both at the same time is
  a bit too much. Everything works fine, let me be clear, but I'd like
  to explore a solution without having cxf import (transitively) all its
  Spring depedencies.
 
  Thanks,
  Valerio



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




-- 
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni


Re: Problem deserializing pojos (fields not initialized)

2008-04-02 Thread Valerio Schiavoni
Hello ,

your code works fine, and infact my tests are now green-like-grass.

The only minor issue is that:

AegisDatabinding.WRITE_XSI_TYPE_KEY

is deprecated in the 2.1-SNAPSHOT release I've been using.

What should I use instead ?

On Tue, Apr 1, 2008 at 2:38 PM, Alpin, Luba [EMAIL PROTECTED] wrote:

 Following works good:

 Server:
 ---
 ServerFactoryBean  svrFactory = new ServerFactoryBean();
HashMapString, Object props = new HashMapString, Object();
props.put(AegisDatabinding.WRITE_XSI_TYPE_KEY, true);
ArrayListString l = new ArrayListString();
l.add(YourCustomClassName.class.getName());
props.put(AegisDatabinding.OVERRIDE_TYPES_KEY, l);

svrFactory.setServiceClass(InterfaceClassName.class);
svrFactory.setAddress(address);
svrFactory.setServiceBean(InterfaceImpl);
svrFactory.getServiceFactory().setDataBinding(new
 AegisDatabinding());
svrFactory.setProperties(props);
svrFactory.getServiceFactory().setProperties(props);
svrFactory.create();

 Client (not dynamic):
 -
 MapString, Object props = new HashMapString, Object();
 props.put(AegisDatabinding.WRITE_XSI_TYPE_KEY,
 Boolean.TRUE);
 //props.put(AegisDatabinding.READ_XSI_TYPE_KEY,
 false);
 ListString l = new ArrayListString();
 l.add(YourCustomClassName.class.getName());
 props.put(AegisDatabinding.OVERRIDE_TYPES_KEY, l);
ClientProxyFactoryBean factory = new
 ClientProxyFactoryBean();
factory.setProperties(props);
factory.getServiceFactory().setProperties(props);
factory.setServiceClass(InterfaceClassName.class);
factory.setAddress(address);
factory.getServiceFactory().setDataBinding(new
 AegisDatabinding());

 InterfaceClassName client = factory.create();

Object o = client.yourMethod();




 -Original Message-
 From: Valerio Schiavoni [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 01, 2008 2:43 PM
 To: cxf-user@incubator.apache.org
 Subject: Re: Problem deserializing pojos (fields not initialized)

 ehm..i forgot to had copy/paste this line to the example code showcasing
 the
 problem:

 wsServerFactoryBean.getServiceFactory().setDataBinding(new
 AegisDatabinding());


 so: same error as before..


 --
 http://www.linkedin.com/in/vschiavoni
 http://jroller.com/vschiavoni




-- 
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni


Re: Problem deserializing pojos (fields not initialized)

2008-04-02 Thread Valerio Schiavoni
It works fine

On Wed, Apr 2, 2008 at 3:06 PM, Benson Margulies [EMAIL PROTECTED]
wrote:

 Create an AegisContext, set the flag in there, push it into the
 AegisDatabinding.


For the curious ones, here's the code for the client (server is the same):

clientProxyfactoryBean = new ClientProxyFactoryBean();
clientProxyfactoryBean.setServiceClass(clazz);
clientProxyfactoryBean.setAddress(address);
final AegisDatabinding aegisDatabinding = new AegisDatabinding();
AegisContext aegisCtx = new AegisContext();
aegisCtx.setReadXsiTypes(true);
aegisDatabinding.setAegisContext(aegisCtx);
clientProxyfactoryBean.getServiceFactory().setDataBinding(
aegisDatabinding);

-- 
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni


Re: Problem deserializing pojos (fields not initialized)

2008-04-01 Thread Valerio Schiavoni
ehm..i forgot to had copy/paste this line to the example code showcasing the
problem:

wsServerFactoryBean.getServiceFactory().setDataBinding(new
AegisDatabinding());


so: same error as before..


-- 
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni


Problem deserializing pojos (fields not initialized)

2008-04-01 Thread Valerio Schiavoni
Hello,

short version:

before sending a pojo object over the network as a service invocation
result:
  Pojo[id:2,name:pojo-2,date:2008-04-01T13:24:34.655+02:00]
after receiving the object and having it deserialized:
  Pojo[id:0,name:null,date:null]

longer version:

i'm using the ServerFactoryBean to expose a java interface, by doing
something like:

wsServerFactoryBean = new ServerFactoryBean();
wsServerFactoryBean.setAddress(address);
wsServerFactoryBean.setServiceClass(serviceClass);
wsServerFactoryBean.setServiceBean(myDelegate);

Now, consider the case where the interface to be exposed is the following:
package org.objectweb.fractal.bf.connectors;
public interface Service {
void print();

String printAndAnswer();

javax.xml.datatype.XMLGregorianCalendar getCurrentDate();

Pojo getPojo();
}

and Pojo is:
public class Pojo {
int id;

String name;

Pojo parent;

XMLGregorianCalendar date;

   //all getter/setter heres have been commented
}

So, no rocket science. The interface is correctly exported, as the logs
confirm [1].

Then, this service is invoked: to do so, i build the client using the
DynamicClientFactory:
 DynamicClientFactory dcf = DynamicClientFactory.newInstance();
Client client = dcf.createClient(this.address);

I do see the following in the logs:
1-apr-2008 13.24.30
org.apache.cxf.endpoint.dynamic.DynamicClientFactoryoutputDebug
INFO: Created classes: org.objectweb.fractal.bf.connectors.GetCurrentDate,
org.objectweb.fractal.bf.connectors.GetCurrentDateResponse,
org.objectweb.fractal.bf.connectors.GetPojo,
org.objectweb.fractal.bf.connectors.GetPojoResponse,
org.objectweb.fractal.bf.connectors.ObjectFactory,
org.objectweb.fractal.bf.connectors.Pojo,
org.objectweb.fractal.bf.connectors.Print,
org.objectweb.fractal.bf.connectors.PrintAndAnswer,
org.objectweb.fractal.bf.connectors.PrintAndAnswerResponse,
org.objectweb.fractal.bf.connectors.PrintResponse

Finally, the service is invoked by the client: here I'm interested in the
getPojo() method on the Service interface. For convenience, i print the
object before marshalling the response and after the client has received it.
Here's the result:
//this is on the server-side
Before serializing the response:
Pojo[id:2,name:pojo-2,date:2008-04-01T13:24:34.655+02:00]

//this is on the client side
After object deserialization: Pojo[id:0,name:null,date:null]


I'm using the latest 2.1-incubator-SNAPSHOT versions of the CXF artifacts.

Let me know how I can be more helpful to help solving this bug.


[1]:
1-apr-2008 13.24.27
org.springframework.context.support.AbstractApplicationContextprepareRefresh
INFO: Refreshing [EMAIL PROTECTED]:
display name [EMAIL PROTECTED];
startup date [Tue Apr 01 13:24:27 CEST 2008]; root of context hierarchy
1-apr-2008 13.24.27
org.apache.cxf.bus.spring.BusApplicationContextgetConfigResources
INFO: No cxf.xml configuration file detected, relying on defaults.
1-apr-2008 13.24.27
org.springframework.beans.factory.support.DefaultListableBeanFactoryregisterBeanDefinition
INFO: Overriding bean definition for bean '
org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder': replacing
[Root bean: class [
org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder];
scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true;
autowireMode=0; dependencyCheck=0; factoryBeanName=null;
factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined
in URL
[jar:file:/Users/veleno/.m2/repository/org/apache/cxf/cxf-rt-transports-http/2.1-incubator-SNAPSHOT/cxf-
rt-transports-http-2.1-incubator-SNAPSHOT.jar!/META-INF/cxf/cxf-extension-http.fixml]]
with [Root bean: class [
org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder];
scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true;
autowireMode=0; dependencyCheck=0; factoryBeanName=null;
factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined
in URL
[jar:file:/Users/veleno/.m2/repository/org/apache/cxf/cxf-rt-transports-http/2.1-incubator-SNAPSHOT/cxf-
rt-transports-http-2.1-incubator-SNAPSHOT.jar!/META-INF/cxf/cxf-extension-http.fixml
]]
1-apr-2008 13.24.27
org.springframework.beans.factory.support.DefaultListableBeanFactoryregisterBeanDefinition
INFO: Overriding bean definition for bean '
org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder': replacing
[Root bean: class [
org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder];
scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true;
autowireMode=0; dependencyCheck=0; factoryBeanName=null;
factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined
in URL
[jar:file:/Users/veleno/.m2/repository/org/apache/cxf/cxf-rt-transports-http/2.1-incubator-SNAPSHOT/cxf-
rt-transports-http-2.1-incubator-SNAPSHOT.jar!/META-INF/cxf/cxf-extension-http.fixml]]
with [Root bean: class [
org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder];
scope=singleton; abstract=false; 

org.apache.cxf.binding.soap.SoapFault: http://schemas.xmlsoap.org/wsdl/, the namespace on the definitions element, is not a valid SOAP version.

2008-02-01 Thread Valerio Schiavoni
Hello everyone,'m using cxf 2.0.4-incubator (is this the latest one?)

I expose a java class as a web-service, doing something like:

wsServerFactoryBean = new ServerFactoryBean();

wsServerFactoryBean.setAddress(address);

wsServerFactoryBean.setServiceClass(serviceClass);

wsServerFactoryBean.setServiceBean(delegate.getFcInterface(itfName));

wsServerFactoryBean.create();


So, if I look at the appropriate URL, I can infact see the generated WSDL:


?xml version=1.0 encoding=utf-8?wsdl:definitions xmlns:ns1=
http://schemas.xmlsoap.org/soap/http; xmlns:soap=
http://schemas.xmlsoap.org/wsdl/soap/; xmlns:tns=
http://bf.fractal.objectweb.org/; xmlns:wsdl=
http://schemas.xmlsoap.org/wsdl/; xmlns:xsd=
http://www.w3.org/2001/XMLSchema; name=ComplexService targetNamespace=
http://bf.fractal.objectweb.org/;
  wsdl:types
xs:schema xmlns=http://bf.fractal.objectweb.org/; xmlns:xs=
http://www.w3.org/2001/XMLSchema; attributeFormDefault=unqualified
elementFormDefault=unqualified targetNamespace=
http://bf.fractal.objectweb.org/;
xs:complexType name=product
xs:sequence
xs:element name=id type=xs:int/
xs:element minOccurs=0 name=name type=xs:string/
/xs:sequence
/xs:complexType
xs:element name=print type=print/

xs:complexType name=print
xs:sequence/
/xs:complexType
xs:element name=printResponse type=printResponse/
xs:complexType name=printResponse
xs:sequence/
/xs:complexType
xs:element name=getProduct type=getProduct/
xs:complexType name=getProduct

xs:sequence/
/xs:complexType
xs:element name=getProductResponse type=getProductResponse/
xs:complexType name=getProductResponse
xs:sequence
xs:element minOccurs=0 name=return type=product/
/xs:sequence
/xs:complexType
xs:element name=printAndAnswer type=printAndAnswer/

xs:complexType name=printAndAnswer
xs:sequence/
/xs:complexType
xs:element name=printAndAnswerResponse
type=printAndAnswerResponse/
xs:complexType name=printAndAnswerResponse
xs:sequence
xs:element minOccurs=0 name=return type=xs:string/
/xs:sequence
/xs:complexType

/xs:schema
  /wsdl:types
  wsdl:message name=printAndAnswer
wsdl:part element=tns:printAndAnswer name=parameters
/wsdl:part
  /wsdl:message
  wsdl:message name=getProductResponse
wsdl:part element=tns:getProductResponse name=parameters
/wsdl:part

  /wsdl:message
  wsdl:message name=printAndAnswerResponse
wsdl:part element=tns:printAndAnswerResponse name=parameters
/wsdl:part
  /wsdl:message
  wsdl:message name=getProduct
wsdl:part element=tns:getProduct name=parameters
/wsdl:part
  /wsdl:message

  wsdl:message name=printResponse
wsdl:part element=tns:printResponse name=parameters
/wsdl:part
  /wsdl:message
  wsdl:message name=print
wsdl:part element=tns:print name=parameters
/wsdl:part
  /wsdl:message
  wsdl:portType name=ComplexServicePortType

wsdl:operation name=print
  wsdl:input message=tns:print name=print
/wsdl:input
  wsdl:output message=tns:printResponse name=printResponse
/wsdl:output
/wsdl:operation
wsdl:operation name=getProduct
  wsdl:input message=tns:getProduct name=getProduct
/wsdl:input

  wsdl:output message=tns:getProductResponse
name=getProductResponse
/wsdl:output
/wsdl:operation
wsdl:operation name=printAndAnswer
  wsdl:input message=tns:printAndAnswer name=printAndAnswer
/wsdl:input
  wsdl:output message=tns:printAndAnswerResponse
name=printAndAnswerResponse
/wsdl:output
/wsdl:operation

  /wsdl:portType
  wsdl:binding name=ComplexServiceSoapBinding
type=tns:ComplexServicePortType
soap:binding style=document transport=
http://schemas.xmlsoap.org/soap/http/
wsdl:operation name=print
  soap:operation soapAction= style=document/
  wsdl:input name=print
soap:body use=literal/
  /wsdl:input
  wsdl:output name=printResponse

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

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

soap:body use=literal/
  /wsdl:output
/wsdl:operation
  /wsdl:binding
  wsdl:service name=ComplexService
wsdl:port binding=tns:ComplexServiceSoapBinding
name=ComplexServicePort
  soap:address location=http://localhost:8080/ComplexService?wsdl/
/wsdl:port
  /wsdl:service

/wsdl:definitions


On the client-side, i create the client:

dcf = 

Re: org.apache.cxf.binding.soap.SoapFault: http://schemas.xmlsoap.org/wsdl/, the namespace on the definitions element, is not a valid SOAP version.

2008-02-01 Thread Valerio Schiavoni
So far, this jira issue:
https://issues.apache.org/jira/browse/CXF-1117

is the only one that might be somehow related with my problem..but still
i've no idea on how to solve this issue.

On Feb 1, 2008 4:30 PM, Valerio Schiavoni [EMAIL PROTECTED]
wrote:

 Hello everyone,'m using cxf 2.0.4-incubator (is this the latest one?)

 I expose a java class as a web-service, doing something like:

 wsServerFactoryBean = new ServerFactoryBean();

 wsServerFactoryBean.setAddress(address);

 wsServerFactoryBean.setServiceClass(serviceClass);

 wsServerFactoryBean.setServiceBean(delegate.getFcInterface(itfName));

 wsServerFactoryBean.create();


 So, if I look at the appropriate URL, I can infact see the generated WSDL:


 ?xml version=1.0 encoding=utf-8?wsdl:definitions xmlns:ns1=
 http://schemas.xmlsoap.org/soap/http; xmlns:soap=
 http://schemas.xmlsoap.org/wsdl/soap/; xmlns:tns=
 http://bf.fractal.objectweb.org/; xmlns:wsdl=
 http://schemas.xmlsoap.org/wsdl/; xmlns:xsd=
 http://www.w3.org/2001/XMLSchema; name=ComplexService targetNamespace=
 http://bf.fractal.objectweb.org/;
   wsdl:types
 xs:schema xmlns=http://bf.fractal.objectweb.org/; xmlns:xs=
 http://www.w3.org/2001/XMLSchema; attributeFormDefault=unqualified
 elementFormDefault=unqualified targetNamespace=
 http://bf.fractal.objectweb.org/;
 xs:complexType name=product
 xs:sequence
 xs:element name=id type=xs:int/
 xs:element minOccurs=0 name=name type=xs:string/
 /xs:sequence
 /xs:complexType
 xs:element name=print type=print/

 xs:complexType name=print
 xs:sequence/
 /xs:complexType
 xs:element name=printResponse type=printResponse/
 xs:complexType name=printResponse
 xs:sequence/
 /xs:complexType
 xs:element name=getProduct type=getProduct/
 xs:complexType name=getProduct

 xs:sequence/
 /xs:complexType
 xs:element name=getProductResponse type=getProductResponse/
 xs:complexType name=getProductResponse
 xs:sequence
 xs:element minOccurs=0 name=return type=product/
 /xs:sequence
 /xs:complexType
 xs:element name=printAndAnswer type=printAndAnswer/

 xs:complexType name=printAndAnswer
 xs:sequence/
 /xs:complexType
 xs:element name=printAndAnswerResponse
 type=printAndAnswerResponse/
 xs:complexType name=printAndAnswerResponse
 xs:sequence
 xs:element minOccurs=0 name=return type=xs:string/
 /xs:sequence
 /xs:complexType

 /xs:schema
   /wsdl:types
   wsdl:message name=printAndAnswer
 wsdl:part element=tns:printAndAnswer name=parameters
 /wsdl:part
   /wsdl:message
   wsdl:message name=getProductResponse
 wsdl:part element=tns:getProductResponse name=parameters
 /wsdl:part

   /wsdl:message
   wsdl:message name=printAndAnswerResponse
 wsdl:part element=tns:printAndAnswerResponse name=parameters
 /wsdl:part
   /wsdl:message
   wsdl:message name=getProduct
 wsdl:part element=tns:getProduct name=parameters
 /wsdl:part
   /wsdl:message

   wsdl:message name=printResponse
 wsdl:part element=tns:printResponse name=parameters
 /wsdl:part
   /wsdl:message
   wsdl:message name=print
 wsdl:part element=tns:print name=parameters
 /wsdl:part
   /wsdl:message
   wsdl:portType name=ComplexServicePortType

 wsdl:operation name=print
   wsdl:input message=tns:print name=print
 /wsdl:input
   wsdl:output message=tns:printResponse name=printResponse
 /wsdl:output
 /wsdl:operation
 wsdl:operation name=getProduct
   wsdl:input message=tns:getProduct name=getProduct
 /wsdl:input

   wsdl:output message=tns:getProductResponse
 name=getProductResponse
 /wsdl:output
 /wsdl:operation
 wsdl:operation name=printAndAnswer
   wsdl:input message=tns:printAndAnswer name=printAndAnswer
 /wsdl:input
   wsdl:output message=tns:printAndAnswerResponse
 name=printAndAnswerResponse
 /wsdl:output
 /wsdl:operation

   /wsdl:portType
   wsdl:binding name=ComplexServiceSoapBinding
 type=tns:ComplexServicePortType
 soap:binding style=document transport=
 http://schemas.xmlsoap.org/soap/http/
 wsdl:operation name=print
   soap:operation soapAction= style=document/
   wsdl:input name=print
 soap:body use=literal/
   /wsdl:input
   wsdl:output name=printResponse

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

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

Re: cannot reach webservice (SimplefrontEnd related ?)

2007-09-22 Thread Valerio Schiavoni
Hello Ning, thanks for your reply

On 9/22/07, Jiang, Ning (Willem) [EMAIL PROTECTED] wrote:
 You need to set the factory with the address that you got from the wsdl 
 (http://localhost:8080/Service?wsdl).
 It must be something like this http://localhost:8080/Service/***;

the solution you proposed actually works (with 2 * instead of 3).

 But I dont understand why. The WSDL reports:

 soap:address location=http://localhost:8080/Service/

Is this a WSDL specific issue, which I might solve simply by reading a
bit more about WS ?

Follows the full WSDL, in case

?xml version=1.0 encoding=utf-8?wsdl:definitions
xmlns:ns1=http://connectors.bf.fractal.objectweb.org/;
xmlns:ns2=http://schemas.xmlsoap.org/soap/http;
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=Service
targetNamespace=http://connectors.bf.fractal.objectweb.org/;
  wsdl:types
xsd:schema xmlns=http://connectors.bf.fractal.objectweb.org/;
attributeFormDefault=unqualified elementFormDefault=qualified
targetNamespace=http://connectors.bf.fractal.objectweb.org/;
xsd:element name=printAndAnswer type=printAndAnswer/
xsd:complexType name=printAndAnswer
xsd:sequence/
/xsd:complexType
xsd:element name=printAndAnswerResponse type=printAndAnswerResponse/
xsd:complexType name=printAndAnswerResponse
xsd:sequence
xsd:element minOccurs=0 name=return type=xsd:string/
/xsd:sequence
/xsd:complexType
xsd:element name=print type=print/
xsd:complexType name=print
xsd:sequence/
/xsd:complexType
xsd:element name=printResponse type=printResponse/
xsd:complexType name=printResponse
xsd:sequence/
/xsd:complexType
/xsd:schema
  /wsdl:types
  wsdl:message name=printAndAnswerResponse
wsdl:part element=ns1:printAndAnswerResponse name=parameters
/wsdl:part
  /wsdl:message
  wsdl:message name=print
wsdl:part element=ns1:print name=parameters
/wsdl:part
  /wsdl:message
  wsdl:message name=printResponse
wsdl:part element=ns1:printResponse name=parameters
/wsdl:part
  /wsdl:message
  wsdl:message name=printAndAnswer
wsdl:part element=ns1:printAndAnswer name=parameters
/wsdl:part
  /wsdl:message
  wsdl:portType name=ServicePortType
wsdl:operation name=printAndAnswer
  wsdl:input message=ns1:printAndAnswer name=printAndAnswer
/wsdl:input
  wsdl:output message=ns1:printAndAnswerResponse
name=printAndAnswerResponse
/wsdl:output
/wsdl:operation
wsdl:operation name=print
  wsdl:input message=ns1:print name=print
/wsdl:input
  wsdl:output message=ns1:printResponse name=printResponse
/wsdl:output
/wsdl:operation
  /wsdl:portType
  wsdl:binding name=ServiceSoapBinding type=ns1:ServicePortType
soap:binding style=document
transport=http://schemas.xmlsoap.org/soap/http/
wsdl:operation name=printAndAnswer
  soap:operation soapAction= style=document/
  wsdl:input name=printAndAnswer
soap:body use=literal/
  /wsdl:input
  wsdl:output name=printAndAnswerResponse
soap:body use=literal/
  /wsdl:output
/wsdl:operation
wsdl:operation name=print
  soap:operation soapAction= style=document/
  wsdl:input name=print
soap:body use=literal/
  /wsdl:input
  wsdl:output name=printResponse
soap:body use=literal/
  /wsdl:output
/wsdl:operation
  /wsdl:binding
  wsdl:service name=Service
wsdl:port binding=ns1:ServiceSoapBinding name=ServicePort
  soap:address location=http://localhost:8080/Service/
/wsdl:port
  /wsdl:service
/wsdl:definitions

-- 
http://valerioschiavoni.blogspot.com
http://jroller.com/vschiavoni


cannot reach webservice (SimplefrontEnd related ?)

2007-09-21 Thread Valerio Schiavoni
Hello everyone,
i'm a newbie of CXF and webservices in general, so sorry if my
question is somehow dumb.

I create a webservice using the SimpleFrontEnd. Once
wsServerFactoryBean.create() method is invoked, the corresponding wsdl
is made available at the expected address.

Also, i see this output :

21-set-2007 13.42.55
org.springframework.context.support.AbstractApplicationContext refresh
INFO: Refreshing
[EMAIL PROTECTED]: display name
[EMAIL PROTECTED]; startup date
[Fri Sep 21 13:42:55 CEST 2007]; root of context hierarchy
21-set-2007 13.42.55 org.apache.cxf.bus.spring.BusApplicationContext
getConfigResources
INFO: Could not find the configuration file cxf.xml on the classpath.
21-set-2007 13.42.55
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf.xml]
21-set-2007 13.42.55
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-extension-soap.xml]
21-set-2007 13.42.55
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-extension-xml.xml]
21-set-2007 13.42.56
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-extension-http-jetty.xml]
21-set-2007 13.42.56
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-extension-http.xml]
21-set-2007 13.42.56
org.springframework.context.support.AbstractApplicationContext refresh
INFO: Bean factory for application context
[EMAIL PROTECTED]:
[EMAIL PROTECTED]
21-set-2007 13.42.56
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not
eligible for getting processed by all BeanPostProcessors (for example:
not eligible for auto-proxying)
21-set-2007 13.42.56
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean 'cxf' is not eligible for getting processed by all
BeanPostProcessors (for example: not eligible for auto-proxying)
21-set-2007 13.42.56
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is
not eligible for getting processed by all BeanPostProcessors (for
example: not eligible for auto-proxying)
21-set-2007 13.42.56
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in
[EMAIL PROTECTED]:
defining beans 
[cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder];
root of factory hierarchy
21-set-2007 13.42.57
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
INFO: Creating Service
{http://connectors.bf.fractal.objectweb.org/}Service from class
org.objectweb.fractal.bf.connectors.Service
21-set-2007 13.42.58 sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log)
via org.mortbay.log.Slf4jLog
21-set-2007 13.42.58 sun.reflect.NativeMethodAccessorImpl invoke0
INFO: jetty-6.1.3
21-set-2007 13.42.58 sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Started SelectChannelConnector @ 0.0.0.0:8080

Opening a browser at http://localhost:8080/Service?wsdl permits to see
the WSDL as expected.

Then, with the followin code for the client:
code
 ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
 factory.setServiceClass( Service.class);