camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jipchix <m_...@yahoo.com>
Subject Re: Read web service msg and encrypt some data
Date Thu, 03 Jan 2013 18:27:18 GMT
I have a POJO that was generated using wsdl2java - let's call this Person
class. This class was generated 

Then in my Manipulator class, I have an input parameter - (String xml).  I
write this 'xml' to the log and see that it contains some header and the
message body.  In the Manipulator class then I attempt to instantiate
"Person" thinking somehow it would magically contains fields parsed out from
my XML.  There is no link between them I can see.  Here are the snippets
from the 2 classes:
// MyManipulator.java file
public class MyManipulator {

   @Converter
   public Person Manipulator (String xml) {
   
   Person p = new Person();
 ...      encryptme(p.ssn);
 }
}

//Person.java file
...

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "emplID",
    "firstName",
    "lastName",
    "empType",
    "empClass",
    "ssn",
    "location"
})
@XmlRootElement(name = "Person")
public class Person {

    @XmlElement(required = true)
    protected String emplID;
    @XmlElement(required = true)
    protected String firstName;
    @XmlElement(required = true)
    protected String lastName;
    @XmlElement(required = true)
    protected String empType;
    @XmlElement(required = true)
    protected String empClass;
    @XmlElement(required = true)
    protected String ssn;
   ...
    public String getEmplID() {
        return emplID;
    }
 // Other getters & setters
..

--------------------
As mentioned: I could see the message and header in 'xml' var.  However, if
I try to output p.ssn, p.empID, etc., they all showed null.  So I have
message in the 'xml' but I can't get it mapped to "Person" object to
manipulate ssn.

Thanks

 




--
View this message in context: http://camel.465427.n5.nabble.com/Read-web-service-msg-and-encrypt-some-data-tp5724807p5724857.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message