You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by Lenni Madsen <l....@mil.dk> on 2009/05/20 13:43:42 UTC

Re: Transport my own data types from wsn-producer to wsn-consumer

here's a bit of code that I introduced in my test case.

public Element runtimeEventOperation() throws Exception{
     	WefFactory factory = new SimpleWefFactory();
     	ManagementEvent event = factory.createEvent();
     	
     	Component reporter = factory.createComponent();
     	ComponentAddress reporterAddress =  
factory 
.createComponentAddress(getResource().getEndpointReference().toXML());
     	reporter.setAddress(reporterAddress);
     	reporter.setName(WefConstants.REPORTER_COMP_QNAME);
     	
     	Component source = factory.createComponent();
     	ComponentAddress sourceAddress =  
factory 
.createComponentAddress(getResource().getEndpointReference().toXML());
     	source.setAddress(sourceAddress);
     	source.setName(WefConstants.SOURCE_COMP_QNAME);
     	
     	Situation situation = factory.createSituation();
     	 
situation.setCategoryType(WefConstants.AVAILABILITY_SITUATION_QNAME);
     	situation.setPriority(Situation.HIGH_PRIORITY);
     	situation.setMessage("Something important has happened in the  
"+getServerName()+"!"); // this is your string only message
     	event.setReporter(reporter);
     	event.setSource(source);
     	event.setSituation(situation);
     	
     	event.addExtendedElement(MessageExtension()); // this is where  
you can put your XML, the standard allows for a xml extension
     	
     	try{
			runtimeNotification.publish(_TOPIC_NAME, event); // the actual  
request to send the notification
		}catch (Throwable error){
			error.printStackTrace();
		}
     	return event.toXML();
     }

/////// an example that should give the rough idea of how to build a  
wsn-producer

//
// MyCapability.java
// Thu Apr 05 11:59:12 BST 2007
// Generated by the Apache Muse Code Generation Tool
//
import javax.xml.namespace.QName;

import org.apache.muse.core.Resource;
import org.apache.muse.core.ResourceManager;
import org.apache.muse.util.xml.XmlUtils;
import org.apache.muse.ws.addressing.EndpointReference;
import org.apache.muse.ws.addressing.soap.SoapFault;
import org.apache.muse.ws.dm.muws.events.Component;
import org.apache.muse.ws.dm.muws.events.ComponentAddress;
import org.apache.muse.ws.dm.muws.events.ManagementEvent;
import org.apache.muse.ws.dm.muws.events.Situation;
import org.apache.muse.ws.dm.muws.events.WefConstants;
import org.apache.muse.ws.dm.muws.events.WefFactory;
import org.apache.muse.ws.dm.muws.events.impl.SimpleWefFactory;
import org.apache.muse.ws.notification.NotificationProducer;
import org.apache.muse.ws.notification.WsnConstants;
import org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;
import org.w3c.dom.Element;

public class MyCapability extends AbstractWsResourceCapability  
implements IMyCapability
{
	private NotificationProducer runtimeNotification;
	
	private static final QName _TOPIC_NAME = new QName(NAMESPACE_URI,  
"RuntimeEvent", PREFIX);
	/**
	 * Only internal objects are guarentied to be instantiated, do not  
depend on objects/Capabilities outside this Capability
	 */
     public void initialize() throws SoapFault
     {
         super.initialize();
     }
     /**
	 * External capabilities are instantiated and can be used
	 */
     public void initializeCompleted()throws SoapFault{
     	super.initializeCompleted();
     	runtimeNotification =  
(NotificationProducer 
)getResource().getCapability(WsnConstants.PRODUCER_URI);
		// add list of Topics if needed
		runtimeNotification.addTopic(_TOPIC_NAME);
     }

     /**
	 * External capabilities are instantiated and can be used (last chance)
	 */
	public void prepareShutdown() throws SoapFault{
		super.prepareShutdown();
	}
	/**
	 * Only internal objects are guaranteed to be instantiated, do not  
depend on objects/Capabilities outside this Capability
	 */
	public void shutdown() throws SoapFault{
		super.shutdown();
	}
	
     private static final QName[] _PROPERTIES = new QName[]
     {
     	new QName(NAMESPACE_URI, "ServerName", PREFIX),
         new QName(NAMESPACE_URI, "TestProperty", PREFIX),
         new QName(NAMESPACE_URI, "MessageInterval", PREFIX)
     };

     public QName[] getPropertyNames()
     {
         return _PROPERTIES;
     }

     private String _ServerName = "WsSomething";

     private String[] _TestProperty;

     private int _MessageInterval = 0;

     public String getServerName()
     {
         return _ServerName;
     }

     public void setServerName(String param0)
     {
         _ServerName = param0;
     }

     public String[] getTestProperty()
     {
         return _TestProperty;
     }

     public void setTestProperty(String[] param0)
     {
         _TestProperty = param0;
     }

     public int getMessageInterval()
     {
         return _MessageInterval;
     }

     public void setMessageInterval(int param0)
     {
         _MessageInterval = param0;
     }

     public Element runtimeEventOperation() throws Exception{
     	WefFactory factory = new SimpleWefFactory();
     	ManagementEvent event = factory.createEvent();
     	
     	Component reporter = factory.createComponent();
     	ComponentAddress reporterAddress =  
factory 
.createComponentAddress(getResource().getEndpointReference().toXML());
     	reporter.setAddress(reporterAddress);
     	reporter.setName(WefConstants.REPORTER_COMP_QNAME);
     	
     	Component source = factory.createComponent();
     	ComponentAddress sourceAddress =  
factory 
.createComponentAddress(getResource().getEndpointReference().toXML());
     	source.setAddress(sourceAddress);
     	source.setName(WefConstants.SOURCE_COMP_QNAME);
     	
     	Situation situation = factory.createSituation();
     	 
situation.setCategoryType(WefConstants.AVAILABILITY_SITUATION_QNAME);
     	situation.setPriority(Situation.HIGH_PRIORITY);
     	situation.setMessage("Something important has happened in the  
"+getServerName()+"!");
     	event.setReporter(reporter);
     	event.setSource(source);
     	event.setSituation(situation);
     	
     	event.addExtendedElement(MessageExtension());
     	
     	try{
			getLog().info("Sending message to consumers...");
			runtimeNotification.publish(_TOPIC_NAME, event);
		}catch (Throwable error){
			error.printStackTrace();
		}
     	return event.toXML();
     }

     private Element MessageExtension(){
     	// create your XML message
     }
}

/Lenni

On May 20, 2009, at 10:47 GMT+02:00, ciel wrote:

>
> 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.
> -- 
> View this message in context: http://www.nabble.com/Transport-my-own-data-types--form-wsn-producer-to-wsn-consumer-tp23631392p23631392.html
> Sent from the Muse User mailing list archive at Nabble.com.
>






Re: Transport my own data types from wsn-producer to wsn-consumer

Posted by Lenni Madsen <l....@mil.dk>.
sounds like one or more of your EndPointReferences are broken, I would  
suggest that you double check all your EPRs.

For references a broken HR fault means you're trying to invoke an  
endpoint, that does not exist.

On 21/05/2009, at 09.59, ciel <37...@qq.com> wrote:

>
> ok,thanks very much.
> when I indroduced your code in wsn-producer, it produced:
>
> *******************************************************
> 2009-5-21 15:27:50 org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1 run
> 信息: Sending message to consumers...
> [CLIENT TRACE] SOAP envelope contents (outgoing):
>
> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
>    <soap:Header>
>        <wsa:To
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://192.168.
> 6.251:8080/wsn-consumer/services/consumer</wsa:To>
>        <wsa:Action
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs
> .oasis-open.org/wsn/bw-2/NotificationConsumer/NotifyRequest</ 
> wsa:Action>
>        <wsa:MessageID
> xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:a6a
> c392c-e6b8-2cbc-895d-c04201eba23a</wsa:MessageID>
>        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
>            <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/08/addres
> sing"/>
>
> <wsa:Address>http://localhost:8080/wsn-producer/services/WsResource<
> /wsa:Address>
>        </wsa:From>
>    </soap:Header>
>    <soap:Body>
>        <wsnt:Notify xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>            <wsnt:NotificationMessage xmlns:=""
>                xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
>                xmlns:muws1="http://docs.oasis-open.org/wsdm/muws1-2.xsd 
> "
>                xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd 
> "
>                xmlns:wsa="http://www.w3.org/2005/08/addressing"
> xmlns:wsnt="htt
> p://docs.oasis-open.org/wsn/b-2">
>                <wsnt:SubscriptionReference>
>                    <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">http://localhost:8080/wsn-producer/services/SubscriptionManager</ 
> wsa:Address>
>                    <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/0
> 8/addressing">
>                        <muse-wsa:ResourceId
> xmlns:muse-wsa="http://ws.apache.or
> g/muse/addressing">MuseResource-1</muse-wsa:ResourceId>
>                    </wsa:ReferenceParameters>
>                </wsnt:SubscriptionReference>
>                <wsnt:Topic
>
> Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/
> Concrete"
> xmlns:tns="http://ws.apache.org/muse/test/wsrf">tns:MyTopic</wsnt:Topi
> c>
>                <wsnt:ProducerReference>
>                    <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/0
> 8/addressing"/>
>                    <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">http://localhost:8080/wsn-producer/services/WsResource</wsa:Address>
>                </wsnt:ProducerReference>
>                <wsnt:Message>
>                    <muws1:ManagementEvent
>
> xmlns:muws1="http://docs.oasis-open.org/wsdm/muws1-2.xsd
> " ReportTime="2009-05-21T15:27:04+08:00">
>
> <muws1:EventId>uuid:ddeac1a5-5dcf-67fc-e17f-d71afce0fa5b
> </muws1:EventId>
>                        <muws1:SourceComponent>
>                            <muws1:ComponentAddress>
>                                <wsa:EndpointReference
> xmlns:wsa="http://www.w3.
> org/2005/08/addressing">
>                                    <wsa:ReferenceParameters
> xmlns:wsa="http://w
> ww.w3.org/2005/08/addressing"/>
>
> <wsa:Address>http://localhost:8080/wsn-produ
> cer/services/WsResource</wsa:Address>
>                                </wsa:EndpointReference>
>                            </muws1:ComponentAddress>
>                        </muws1:SourceComponent>
>                        <muws1:ReporterComponent>
>                            <muws1:ComponentAddress>
>                                <wsa:EndpointReference
> xmlns:wsa="http://www.w3.
> org/2005/08/addressing">
>                                    <wsa:ReferenceParameters
> xmlns:wsa="http://w
> ww.w3.org/2005/08/addressing"/>
>
> <wsa:Address>http://localhost:8080/wsn-produ
> cer/services/WsResource</wsa:Address>
>                                </wsa:EndpointReference>
>                            </muws1:ComponentAddress>
>                        </muws1:ReporterComponent>
>                        <muws2:Situation
> xmlns:muws2="http://docs.oasis-open.org
> /wsdm/muws2-2.xsd">
>                            <muws2:SituationCategory>
>                                <muws2:AvailabilitySituation/>
>                            </muws2:SituationCategory>
>
> <muws2:SituationTime>2009-05-21T15:27:04+08:00</muws
> 2:SituationTime>
>                            <muws2:Priority>70</muws2:Priority>
>                            <muws2:Message>Something important has  
> happened
> in t
> he muse-test.apache.org!</muws2:Message>
>                        </muws2:Situation>
>                        <shipmentCheckResultInfo
>
> xmlns="http://localhost:8080/ShipmentTrackService.xs
> d"
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> " xsi:schemaLocation="http://localhost:8080/ShipmentTrackService.xsd
> ShipmentTra
>                        <muws1:ReporterComponent>
>                            <muws1:ComponentAddress>
>                                <wsa:EndpointReference
> xmlns:wsa="http://www.w3.
> org/2005/08/addressing">
>
> <wsa:Address>http://localhost:8080/wsn-produ
> cer/services/WsResource</wsa:Address>
>                                </wsa:EndpointReference>
>                            </muws1:ComponentAddress>
>                        </muws1:ReporterComponent>
>                        <muws2:Situation
> xmlns:muws2="http://docs.oasis-open.org
> /wsdm/muws2-2.xsd">
>                            <muws2:SituationCategory>
>                                <muws2:AvailabilitySituation/>
>                            </muws2:SituationCategory>
>
> <muws2:SituationTime>2009-05-21T15:27:04+08:00</muws
> 2:SituationTime>
>                            <muws2:Priority>70</muws2:Priority>
>                            <muws2:Message>Something important has  
> happened
> in t
> he muse-test.apache.org!</muws2:Message>
>                        </muws2:Situation>
>                        <shipmentCheckResultInfo
>
> xmlns="http://localhost:8080/ShipmentTrackService.xs
> d"
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> " xsi:schemaLocation="http://localhost:8080/ShipmentTrackService.xsd
> ShipmentTra
> ckService.xsd">
>                            <shipmentID>123</shipmentID>
>                            <shipmentOwner>bincan</shipmentOwner>
>                            <shipmentCheckResult>true</ 
> shipmentCheckResult>
>                        </shipmentCheckResultInfo>
>                    </muws1:ManagementEvent>
>                </wsnt:Message>
>            </wsnt:NotificationMessage>
>        </wsnt:Notify>
>    </soap:Body>
> </soap:Envelope>
>
> [Fatal Error] :5:184: The element type "HR" must be terminated by the
> matching e
> nd-tag "</HR>".
> 2009-5-21 15:31:06 org.apache.muse.util.LoggingUtils logError
> 信息: There was an error while processing a request:
>
> The element type "HR" must be terminated by the matching end-tag "</ 
> HR>".
>
>
> org. 
> apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> t.java:298)
>
> org. 
> apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> t.java:254)
>
> org. 
> apache.muse.ws.notification.remote.NotificationConsumerClient.notify
> (NotificationConsumerClient.java:99)
>
> org. 
> apache.muse.ws.notification.impl.SimpleSubscriptionManager.publish(S
> impleSubscriptionManager.java:267)
>
> org. 
> apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
> SimpleNotificationProducer.java:445)
>
> org. 
> apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
> SimpleNotificationProducer.java:473)
>
> org. 
> apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
> SimpleNotificationProducer.java:462)
>        org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1.run(Unknown  
> Source)
>
> ------------------------------------------
>
> 2009-5-21 15:31:21
> org.apache.muse.ws.notification.impl.SimpleSubscriptionManage
> r publish
> 信息: [ID = 'LastPublishFailed'] The last notification published via
> wsnt:Notify
> failed to reach its destination. The consumer may be unavailable. The
> original
> error was: The element type "HR" must be terminated by the matching  
> end-tag
> "</H
> R>".
> 2009-5-21 15:31:21 org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1 run
> 信息: Waiting 10 seconds before sending message...
> ******************************************************************
>
> and at wsn-consumer, it produced
>
> *******************************************************************
> [Fatal Error] :14:45: Element or attribute do not match QName  
> production:
> QName:
> :=(NCName':')?NCName.
> *******************************************************************
>
> What should I do? Modify wsn-consumer's code? And if,
> -- 
> View this message in context: http://www.nabble.com/Transport-my-own-data-types--form-wsn-producer-to-wsn-consumer-tp23631392p23649285.html
> Sent from the Muse User mailing list archive at Nabble.com.
>

Re: Transport my own data types from wsn-producer to wsn-consumer

Posted by Lenni Madsen <l....@mil.dk>.
just for references sake did you remember to subscribe the consumer to  
the producer?

On 21/05/2009, at 09.59, ciel <37...@qq.com> wrote:

>
> ok,thanks very much.
> when I indroduced your code in wsn-producer, it produced:
>
> *******************************************************
> 2009-5-21 15:27:50 org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1 run
> 信息: Sending message to consumers...
> [CLIENT TRACE] SOAP envelope contents (outgoing):
>
> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
>    <soap:Header>
>        <wsa:To
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://192.168.
> 6.251:8080/wsn-consumer/services/consumer</wsa:To>
>        <wsa:Action
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs
> .oasis-open.org/wsn/bw-2/NotificationConsumer/NotifyRequest</ 
> wsa:Action>
>        <wsa:MessageID
> xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:a6a
> c392c-e6b8-2cbc-895d-c04201eba23a</wsa:MessageID>
>        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
>            <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/08/addres
> sing"/>
>
> <wsa:Address>http://localhost:8080/wsn-producer/services/WsResource<
> /wsa:Address>
>        </wsa:From>
>    </soap:Header>
>    <soap:Body>
>        <wsnt:Notify xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>            <wsnt:NotificationMessage xmlns:=""
>                xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
>                xmlns:muws1="http://docs.oasis-open.org/wsdm/muws1-2.xsd 
> "
>                xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd 
> "
>                xmlns:wsa="http://www.w3.org/2005/08/addressing"
> xmlns:wsnt="htt
> p://docs.oasis-open.org/wsn/b-2">
>                <wsnt:SubscriptionReference>
>                    <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">http://localhost:8080/wsn-producer/services/SubscriptionManager</ 
> wsa:Address>
>                    <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/0
> 8/addressing">
>                        <muse-wsa:ResourceId
> xmlns:muse-wsa="http://ws.apache.or
> g/muse/addressing">MuseResource-1</muse-wsa:ResourceId>
>                    </wsa:ReferenceParameters>
>                </wsnt:SubscriptionReference>
>                <wsnt:Topic
>
> Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/
> Concrete"
> xmlns:tns="http://ws.apache.org/muse/test/wsrf">tns:MyTopic</wsnt:Topi
> c>
>                <wsnt:ProducerReference>
>                    <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/0
> 8/addressing"/>
>                    <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">http://localhost:8080/wsn-producer/services/WsResource</wsa:Address>
>                </wsnt:ProducerReference>
>                <wsnt:Message>
>                    <muws1:ManagementEvent
>
> xmlns:muws1="http://docs.oasis-open.org/wsdm/muws1-2.xsd
> " ReportTime="2009-05-21T15:27:04+08:00">
>
> <muws1:EventId>uuid:ddeac1a5-5dcf-67fc-e17f-d71afce0fa5b
> </muws1:EventId>
>                        <muws1:SourceComponent>
>                            <muws1:ComponentAddress>
>                                <wsa:EndpointReference
> xmlns:wsa="http://www.w3.
> org/2005/08/addressing">
>                                    <wsa:ReferenceParameters
> xmlns:wsa="http://w
> ww.w3.org/2005/08/addressing"/>
>
> <wsa:Address>http://localhost:8080/wsn-produ
> cer/services/WsResource</wsa:Address>
>                                </wsa:EndpointReference>
>                            </muws1:ComponentAddress>
>                        </muws1:SourceComponent>
>                        <muws1:ReporterComponent>
>                            <muws1:ComponentAddress>
>                                <wsa:EndpointReference
> xmlns:wsa="http://www.w3.
> org/2005/08/addressing">
>                                    <wsa:ReferenceParameters
> xmlns:wsa="http://w
> ww.w3.org/2005/08/addressing"/>
>
> <wsa:Address>http://localhost:8080/wsn-produ
> cer/services/WsResource</wsa:Address>
>                                </wsa:EndpointReference>
>                            </muws1:ComponentAddress>
>                        </muws1:ReporterComponent>
>                        <muws2:Situation
> xmlns:muws2="http://docs.oasis-open.org
> /wsdm/muws2-2.xsd">
>                            <muws2:SituationCategory>
>                                <muws2:AvailabilitySituation/>
>                            </muws2:SituationCategory>
>
> <muws2:SituationTime>2009-05-21T15:27:04+08:00</muws
> 2:SituationTime>
>                            <muws2:Priority>70</muws2:Priority>
>                            <muws2:Message>Something important has  
> happened
> in t
> he muse-test.apache.org!</muws2:Message>
>                        </muws2:Situation>
>                        <shipmentCheckResultInfo
>
> xmlns="http://localhost:8080/ShipmentTrackService.xs
> d"
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> " xsi:schemaLocation="http://localhost:8080/ShipmentTrackService.xsd
> ShipmentTra
>                        <muws1:ReporterComponent>
>                            <muws1:ComponentAddress>
>                                <wsa:EndpointReference
> xmlns:wsa="http://www.w3.
> org/2005/08/addressing">
>
> <wsa:Address>http://localhost:8080/wsn-produ
> cer/services/WsResource</wsa:Address>
>                                </wsa:EndpointReference>
>                            </muws1:ComponentAddress>
>                        </muws1:ReporterComponent>
>                        <muws2:Situation
> xmlns:muws2="http://docs.oasis-open.org
> /wsdm/muws2-2.xsd">
>                            <muws2:SituationCategory>
>                                <muws2:AvailabilitySituation/>
>                            </muws2:SituationCategory>
>
> <muws2:SituationTime>2009-05-21T15:27:04+08:00</muws
> 2:SituationTime>
>                            <muws2:Priority>70</muws2:Priority>
>                            <muws2:Message>Something important has  
> happened
> in t
> he muse-test.apache.org!</muws2:Message>
>                        </muws2:Situation>
>                        <shipmentCheckResultInfo
>
> xmlns="http://localhost:8080/ShipmentTrackService.xs
> d"
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> " xsi:schemaLocation="http://localhost:8080/ShipmentTrackService.xsd
> ShipmentTra
> ckService.xsd">
>                            <shipmentID>123</shipmentID>
>                            <shipmentOwner>bincan</shipmentOwner>
>                            <shipmentCheckResult>true</ 
> shipmentCheckResult>
>                        </shipmentCheckResultInfo>
>                    </muws1:ManagementEvent>
>                </wsnt:Message>
>            </wsnt:NotificationMessage>
>        </wsnt:Notify>
>    </soap:Body>
> </soap:Envelope>
>
> [Fatal Error] :5:184: The element type "HR" must be terminated by the
> matching e
> nd-tag "</HR>".
> 2009-5-21 15:31:06 org.apache.muse.util.LoggingUtils logError
> 信息: There was an error while processing a request:
>
> The element type "HR" must be terminated by the matching end-tag "</ 
> HR>".
>
>
> org. 
> apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> t.java:298)
>
> org. 
> apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> t.java:254)
>
> org. 
> apache.muse.ws.notification.remote.NotificationConsumerClient.notify
> (NotificationConsumerClient.java:99)
>
> org. 
> apache.muse.ws.notification.impl.SimpleSubscriptionManager.publish(S
> impleSubscriptionManager.java:267)
>
> org. 
> apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
> SimpleNotificationProducer.java:445)
>
> org. 
> apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
> SimpleNotificationProducer.java:473)
>
> org. 
> apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
> SimpleNotificationProducer.java:462)
>        org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1.run(Unknown  
> Source)
>
> ------------------------------------------
>
> 2009-5-21 15:31:21
> org.apache.muse.ws.notification.impl.SimpleSubscriptionManage
> r publish
> 信息: [ID = 'LastPublishFailed'] The last notification published via
> wsnt:Notify
> failed to reach its destination. The consumer may be unavailable. The
> original
> error was: The element type "HR" must be terminated by the matching  
> end-tag
> "</H
> R>".
> 2009-5-21 15:31:21 org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1 run
> 信息: Waiting 10 seconds before sending message...
> ******************************************************************
>
> and at wsn-consumer, it produced
>
> *******************************************************************
> [Fatal Error] :14:45: Element or attribute do not match QName  
> production:
> QName:
> :=(NCName':')?NCName.
> *******************************************************************
>
> What should I do? Modify wsn-consumer's code? And if,
> -- 
> View this message in context: http://www.nabble.com/Transport-my-own-data-types--form-wsn-producer-to-wsn-consumer-tp23631392p23649285.html
> Sent from the Muse User mailing list archive at Nabble.com.
>

Re: Transport my own data types from wsn-producer to wsn-consumer

Posted by ciel <37...@qq.com>.
ok,thanks very much.
when I indroduced your code in wsn-producer, it produced:

*******************************************************
2009-5-21 15:27:50 org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1 run
信息: Sending message to consumers...
[CLIENT TRACE] SOAP envelope contents (outgoing):

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsa:To
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://192.168.
6.251:8080/wsn-consumer/services/consumer</wsa:To>
        <wsa:Action
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs
.oasis-open.org/wsn/bw-2/NotificationConsumer/NotifyRequest</wsa:Action>
        <wsa:MessageID
xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:a6a
c392c-e6b8-2cbc-895d-c04201eba23a</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
            <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addres
sing"/>
           
<wsa:Address>http://localhost:8080/wsn-producer/services/WsResource<
/wsa:Address>
        </wsa:From>
    </soap:Header>
    <soap:Body>
        <wsnt:Notify xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
            <wsnt:NotificationMessage xmlns:=""
                xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
                xmlns:muws1="http://docs.oasis-open.org/wsdm/muws1-2.xsd"
                xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd"
                xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsnt="htt
p://docs.oasis-open.org/wsn/b-2">
                <wsnt:SubscriptionReference>
                    <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing
">http://localhost:8080/wsn-producer/services/SubscriptionManager</wsa:Address>
                    <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/0
8/addressing">
                        <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.or
g/muse/addressing">MuseResource-1</muse-wsa:ResourceId>
                    </wsa:ReferenceParameters>
                </wsnt:SubscriptionReference>
                <wsnt:Topic
                   
Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/
Concrete"
xmlns:tns="http://ws.apache.org/muse/test/wsrf">tns:MyTopic</wsnt:Topi
c>
                <wsnt:ProducerReference>
                    <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/0
8/addressing"/>
                    <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing
">http://localhost:8080/wsn-producer/services/WsResource</wsa:Address>
                </wsnt:ProducerReference>
                <wsnt:Message>
                    <muws1:ManagementEvent
                       
xmlns:muws1="http://docs.oasis-open.org/wsdm/muws1-2.xsd
" ReportTime="2009-05-21T15:27:04+08:00">
                       
<muws1:EventId>uuid:ddeac1a5-5dcf-67fc-e17f-d71afce0fa5b
</muws1:EventId>
                        <muws1:SourceComponent>
                            <muws1:ComponentAddress>
                                <wsa:EndpointReference
xmlns:wsa="http://www.w3.
org/2005/08/addressing">
                                    <wsa:ReferenceParameters
xmlns:wsa="http://w
ww.w3.org/2005/08/addressing"/>
                                   
<wsa:Address>http://localhost:8080/wsn-produ
cer/services/WsResource</wsa:Address>
                                </wsa:EndpointReference>
                            </muws1:ComponentAddress>
                        </muws1:SourceComponent>
                        <muws1:ReporterComponent>
                            <muws1:ComponentAddress>
                                <wsa:EndpointReference
xmlns:wsa="http://www.w3.
org/2005/08/addressing">
                                    <wsa:ReferenceParameters
xmlns:wsa="http://w
ww.w3.org/2005/08/addressing"/>
                                   
<wsa:Address>http://localhost:8080/wsn-produ
cer/services/WsResource</wsa:Address>
                                </wsa:EndpointReference>
                            </muws1:ComponentAddress>
                        </muws1:ReporterComponent>
                        <muws2:Situation
xmlns:muws2="http://docs.oasis-open.org
/wsdm/muws2-2.xsd">
                            <muws2:SituationCategory>
                                <muws2:AvailabilitySituation/>
                            </muws2:SituationCategory>
                           
<muws2:SituationTime>2009-05-21T15:27:04+08:00</muws
2:SituationTime>
                            <muws2:Priority>70</muws2:Priority>
                            <muws2:Message>Something important has happened
in t
he muse-test.apache.org!</muws2:Message>
                        </muws2:Situation>
                        <shipmentCheckResultInfo
                           
xmlns="http://localhost:8080/ShipmentTrackService.xs
d"
                           
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
" xsi:schemaLocation="http://localhost:8080/ShipmentTrackService.xsd
ShipmentTra
                        <muws1:ReporterComponent>
                            <muws1:ComponentAddress>
                                <wsa:EndpointReference
xmlns:wsa="http://www.w3.
org/2005/08/addressing">
                                   
<wsa:Address>http://localhost:8080/wsn-produ
cer/services/WsResource</wsa:Address>
                                </wsa:EndpointReference>
                            </muws1:ComponentAddress>
                        </muws1:ReporterComponent>
                        <muws2:Situation
xmlns:muws2="http://docs.oasis-open.org
/wsdm/muws2-2.xsd">
                            <muws2:SituationCategory>
                                <muws2:AvailabilitySituation/>
                            </muws2:SituationCategory>
                           
<muws2:SituationTime>2009-05-21T15:27:04+08:00</muws
2:SituationTime>
                            <muws2:Priority>70</muws2:Priority>
                            <muws2:Message>Something important has happened
in t
he muse-test.apache.org!</muws2:Message>
                        </muws2:Situation>
                        <shipmentCheckResultInfo
                           
xmlns="http://localhost:8080/ShipmentTrackService.xs
d"
                           
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
" xsi:schemaLocation="http://localhost:8080/ShipmentTrackService.xsd
ShipmentTra
ckService.xsd">
                            <shipmentID>123</shipmentID>
                            <shipmentOwner>bincan</shipmentOwner>
                            <shipmentCheckResult>true</shipmentCheckResult>
                        </shipmentCheckResultInfo>
                    </muws1:ManagementEvent>
                </wsnt:Message>
            </wsnt:NotificationMessage>
        </wsnt:Notify>
    </soap:Body>
</soap:Envelope>

[Fatal Error] :5:184: The element type "HR" must be terminated by the
matching e
nd-tag "</HR>".
2009-5-21 15:31:06 org.apache.muse.util.LoggingUtils logError
信息: There was an error while processing a request:

The element type "HR" must be terminated by the matching end-tag "</HR>".

       
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.java:298)
       
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.java:254)
       
org.apache.muse.ws.notification.remote.NotificationConsumerClient.notify
(NotificationConsumerClient.java:99)
       
org.apache.muse.ws.notification.impl.SimpleSubscriptionManager.publish(S
impleSubscriptionManager.java:267)
       
org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
SimpleNotificationProducer.java:445)
       
org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
SimpleNotificationProducer.java:473)
       
org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
SimpleNotificationProducer.java:462)
        org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1.run(Unknown Source)

------------------------------------------

2009-5-21 15:31:21
org.apache.muse.ws.notification.impl.SimpleSubscriptionManage
r publish
信息: [ID = 'LastPublishFailed'] The last notification published via
wsnt:Notify
 failed to reach its destination. The consumer may be unavailable. The
original
error was: The element type "HR" must be terminated by the matching end-tag
"</H
R>".
2009-5-21 15:31:21 org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1 run
信息: Waiting 10 seconds before sending message...
******************************************************************

and at wsn-consumer, it produced

*******************************************************************
[Fatal Error] :14:45: Element or attribute do not match QName production:
QName:
:=(NCName':')?NCName.
*******************************************************************

What should I do? Modify wsn-consumer's code? And if, 
-- 
View this message in context: http://www.nabble.com/Transport-my-own-data-types--form-wsn-producer-to-wsn-consumer-tp23631392p23649285.html
Sent from the Muse User mailing list archive at Nabble.com.