Hi Dan,

   it worked like a charm - many thanks! Now I understand how it is
connected together!!!

Regards,
palos01



dkulp wrote:
> 
> On Mon June 1 2009 11:49:04 am palos01 wrote:
>> Hi Dan,
>>
>>    I do not generate client code (via wsdl2java tool) - I use approach
>> described at http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html
>> chapter "Configuring a Spring Client (Option 1)". Please note that on the
>> server side I am not allowed to use CXF framework (there is default
>> WebLogic 10 WS stack). The client code is very simple
> 
> OK.  I see.   You probably should have at least use wsdl2java or xjc (from 
> java6) or something to generate the the types for the schema types.   In 
> particular, the ClientDOM type.     That's definitely not correct right
> now as 
> it would need a bunch of JAXB annotations added onto it to get it to match
> the 
> schema:   
> 
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "ClientDOM", propOrder = {
>     "born",
>     "name",
>     "surname"
> }, namespace = "java:cz.palos.test.dom")
> public class ClientDOM {
> 
>     @XmlElement(name = "Born", required = true, nillable = true,
>                            namespace = "java:cz.palos.test.dom")
>     @XmlSchemaType(name = "dateTime")
>     protected XMLGregorianCalendar born;
>     @XmlElement(name = "Name", required = true, nillable = true,
>                            namespace = "java:cz.palos.test.dom")
>     protected String name;
>     @XmlElement(name = "Surname", required = true, nillable = true,
>                            namespace = "java:cz.palos.test.dom")
>     protected String surname;
> ............
> }
> 
> 
> Dan
> 
> 
> 
> 
> 
>> ApplicationContext ctx = new
>> ClassPathXmlApplicationContext("appCtx.xml");
>> Client cs = (Client) ctx.getBean("client");
>>
>> ClientDOM cdm = new ClientDOM();
>> cdm.setName("Lenka");
>> cdm.setSurname("Leb");
>> String result = cs.addClient(cdm);
>>
>> The server side is following
>>
>> interface:
>>
>> package cz.palos.test;
>> import javax.jws.*;
>> import java.util.*;
>> import cz.palos.test.dom.*;
>>
>>
>> @WebService(name="Client", targetNamespace="http://test.palos.cz/";)
>> public interface Client {
>>
>>      public String sayHello(String message);
>>
>>      public ClientDOM createClient(String name, String surname, Date born);
>>
>>      public String addClient(ClientDOM cDom);
>> }
>>
>> implementation:
>>
>> package cz.palos.test.impl;
>> import java.util.Date;
>> import javax.jws.*;
>> import weblogic.jws.WLHttpTransport;
>> import cz.palos.test.Client;
>> import cz.palos.test.dom.*;
>>
>> @WebService(serviceName="ClientService", portName="ClientPort",
>> endpointInterface = "cz.palos.test.Client")
>> @WLHttpTransport(serviceUri="ClientService")
>> public class ClientImpl implements Client {
>>
>>      public String sayHello(String message) {
>>              System.out.println("Got " + message);
>>              return "Returned echo ::: " + message;
>>      }
>>
>>      public ClientDOM createClient(String name, String surname, Date born) {
>>              ClientDOM c = new ClientDOM();
>>              System.out.println("Got name ::: " + name + " " + surname + " " 
>> +
>> born);
>>              c.setName(name);
>>              c.setSurname(surname);
>>              c.setBorn(born);
>>              return c;
>>      }
>>
>>      public String addClient(ClientDOM cDom) {
>>              System.out.println("Got add client ::: " + cDom.getName());
>>              return "done";
>>      }
>> }
>>
>> ClientDOM object
>>
>> package cz.palos.test.dom;
>>
>> import java.io.Serializable;
>> import java.util.Date;
>>
>> public class ClientDOM implements Serializable {
>>
>>      /**
>>       *
>>       */
>>      private static final long serialVersionUID = 1L;
>>
>>      private String name;
>>
>>      private String surname;
>>
>>      private Date born;
>>
>>      public Date getBorn() {
>>              return born;
>>      }
>>
>>      public void setBorn(Date born) {
>>              this.born = born;
>>      }
>>
>>      public String getName() {
>>              return name;
>>      }
>>
>>      public void setName(String name) {
>>              this.name = name;
>>      }
>>
>>      public String getSurname() {
>>              return surname;
>>      }
>>
>>      public void setSurname(String surname) {
>>              this.surname = surname;
>>      }
>> }
>>
>>
>> Many thanks for your help & regards,
>>
>> palos
>>
>> dkulp wrote:
>> > How did you generate the code for the client?    It really looks
>> > "strange" as
>> > the "cDom" doesn't even have "name" or "surname" elements.   They are
>> > "Name"
>> > and "Surname".    Thus, I'm not sure how it's possible that CXF is
>> > generating
>> > that when using the normal JAXB databinding.    Note: it's also missing
>> a
>> > "Born" element which is minOccurs=1.   Thus, it SHOULD be there, even
>> if
>> > it's
>> > null.
>> >
>> > In anycase, could you include the code for the call to addClient from
>> > your Client java code?   I'd like to see how you are setting up the
>> > object model
>> > for the parameters.
>> >
>> > Dan
>> >
>> > On Sat May 30 2009 5:46:13 am palos01 wrote:
>> >> Hi all,
>> >>
>> >>   I am new to CXF and I am facing following problem - I would like to
>> >> create CXF client for the WS running in the deafalt WS stack in
>> WebLogic
>> >> 10
>> >> server. But I have a proble to transfer complex Java object - I
>> suppose
>> >> this is problem with DataBinding. (Primitive data types are transfered
>> >> without problems.) Technically there is not needed namespace for the
>> >> Java complex types.
>> >>
>> >> The WSDL is following
>> >> http://www.nabble.com/file/p23791869/clientService.wsdl
>> >> clientService.wsdl
>> >>
>> >> My configuration of CXF is following (via Spring)
>> >> http://www.nabble.com/file/p23791869/appCtx.xml appCtx.xml
>> >>
>> >> Current request generated via CXF (method addClient in WSDL) is
>> >> following (please note missing namespace java:cz.palos.test.dom for
>> the
>> >> XML tags name
>> >> and surname)
>> >> http://www.nabble.com/file/p23791869/addClientCall.xml
>> addClientCall.xml
>> >>
>> >> Have you an idea how should I change the configuration to get the
>> >> namespace
>> >> on the right place.
>> >>
>> >> Many thanks in advance.
>> >>
>> >> Regars,
>> >> P.
>> >
>> > --
>> > Daniel Kulp
>> > [email protected]
>> > http://www.dankulp.com/blog
> 
> -- 
> Daniel Kulp
> [email protected]
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: 
http://www.nabble.com/CXF-Data-Binding-tp23791869p23817770.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to