Java Reference
In-Depth Information
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.NodeList;
@WebServiceProvider
@ServiceMode(value = javax.xml.ws.Service.Mode.MESSAGE)
@BindingType(value = HTTPBinding.HTTP_BINDING)
class Library implements Provider<Source>
{
private final static String LIBFILE = "library.ser";
@Resource
private WebServiceContext wsContext;
private Map<String, Book> library;
Library()
{
try
{
library = deserialize();
}
catch (IOException ioe)
{
library = new HashMap<>();
}
}
@Override
public Source invoke(Source request)
{
if (wsContext == null)
throw new RuntimeException("dependency injection
failed on wscontext");
MessageContext
msgContext
=
wsCon-
text.getMessageContext();
switch
((String)
msgCon-
text.get(MessageContext.HTTP_REQUEST_METHOD))
{
case "delete": return doDelete(msgContext);
Search WWH ::




Custom Search