Java 2EE and XML Development

Скачать в pdf «Java 2EE and XML Development»


QueueSession qsession =    Establishes queue


qcon.createQueueSession(false,    connection


Session.AUTO_ACKNOWLEDGE);


QueueSender qsender =


qsession.createSender(queue);


TextMessage msg =


qsession.createTextMessage();


Sends JAXM message


qcon.start();


msg.setText(jaxmMsgString)


qsender.send(msg);


// clean up qsender.close(); qsession.close(); qcon.close();


} catch(Exception e) // log the error,


}


// asynchronous SOAP return null;


}



{


panic, etc.


— no message to send back


}


О This class is a JAXM web services proxy servlet that receives asynchronous image updates for products from a supplier.


e The onMessage method handles the image update from the asynchronous SOAP message. The parameter that it receives is the JAXM Message. This method returns null because no response is sent back to the message creator.


d This code block dumps the object to a UTF-8 string. We do this before we put it on the JMS queue because JAXM Messages are not serializable.


Now that we have created both the RPC-style and message-Style web services, we need to publish them for clients. This involves generating WSDL that describes our new services.

Using WSDL to describe web services


For our new web services to be discovered and invoked by new business partners, we must first create a description of each using WSDL. This description provides details about what the web service does, how to invoke it, and where it can be found on the Internet. These WSDL descriptions are then published in one or more web service registries like UDDI.


Table 4.3 Information groups in WSDL

Скачать в pdf «Java 2EE and XML Development»