« Return to Thread: Transport my own data types form wsn-producer to wsn-consumer

Transport my own data types form wsn-producer to wsn-consumer

by ciel :: Rate this Message:

Reply to Author | View in Thread

Hello,sir,
I want to Transport my own data types  form wsn-producer to wsn-consumer, such as follows:

package org.apache.ws.muse.test.wsrf;

class WsnTestDateType {
        WsnTestDateType (){};
        WsnTestDateType (int ID, String name){
                this.ID = ID;
                this.name = name;
        }
        public int getID() {
                return ID;
        }
        public void setID(int id) {
                ID = id;
        }
        public String getName() {
                return name;
        }
        public void setName(String name) {
                WsnTestDateType.name = name;
        }
        private static int ID;
        private static String name;
}
If I have done this

WsnTestDateType studentMessage = new WsnTestDateType (int ID, String name)(int ID, String name);

How could I use wsn.publish(_TOPIC_NAME, payload) to set studentMessage to wsn-consumer and receive it? Any examples?

Besides, if I replace WsnTestDateType  with a xml document as follows, how should I do?

//stuService.xml
<?xml version="1.0" encoding="UTF-8"?>
<ns:stuInfo xmlns:ns="http://localhost:8080/stuService.xsd"><ns:shipmentID>1</ns:shipmentID>
   <ns:stuID>25</ns:stuID>
   <ns:stuName>Joe</ns:stuName>
</ns:stuInfo>

//stuService.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://localhost:8080/stuService.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://localhost:8080/stuService.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified">
        <xsd:element name="stuInfo">
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element name="stuID" type="xsd:int"/>
                                <xsd:element name="stuName" type="xsd:string"/>
                        </xsd:sequence>
                </xsd:complexType>
        </xsd:element>
</xsd:schema>

Thanks very much. I am looking forward to your reply.

 « Return to Thread: Transport my own data types form wsn-producer to wsn-consumer