Hi Mark, On Wed, Oct 19, 2011 at 8:56 PM, Mark Wallace <[email protected]> wrote:
I'm experimenting with supporting SOAP via a component, but trying to identify the right component. I tried pretending to be an Event Listener (see classes below), but this is kind of a kludge, and
I'm not able to get my SOAP Service Endpoint Implementation a copy of the XWiki Context (so my service endpoint can access to the wiki on service calls).
You can access the XWikiContext from the ExecutionContext. See http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents#HTheXWik... and https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwik... as an example. Hope this helps, Marius
Any ideas?
Here are the classes:
---8<--- MyService class ---8<--- package com.modusoperandi.xwiki.importer;
import javax.jws.WebService;
@WebService public class MyService {
public String getCurrentTime() { return new java.util.Date().toString(); } }
---8<--- SoapExtension class ---8<---
package com.modusoperandi.xwiki.importer;
import java.util.ArrayList; import java.util.List;
import javax.xml.ws.Endpoint;
import org.xwiki.component.annotation.Component; import org.xwiki.observation.EventListener; import org.xwiki.observation.event.Event;
@Component("mo-soap") public class SoapExtension implements EventListener {
public SoapExtension() { super(); }
@Override public List<Event> getEvents() { System.out.println("getEvents() called."); ArrayList<Event> eventList = new ArrayList<Event>(); // No events, really. Just acting like an event listener to get // called at XWiki startup.
// TODO for now, register soap services here. Endpoint.publish("http://0.0.0.0:8084/myservice", new MyService()); return eventList; }
/* * (non-Javadoc) * * @see org.xwiki.observation.EventListener#getName() */ @Override public String getName() { return "mo-soap"; }
/* * (non-Javadoc) * * @see * org.xwiki.observation.EventListener#onEvent(org.xwiki.observation.event * .Event, java.lang.Object, java.lang.Object) */ @Override public void onEvent(Event event, Object doc, Object ctx) {
} }
Thanks, -Mark
On 10/19/2011 4:04 AM, Thomas Mortagne wrote:
No there is no SOAP support in XWiki right now but adding a new entry point is pretty easy. Now I'm not sure how easy it is to add support for SOAP in this entry point.
On Wed, Oct 19, 2011 at 12:10 AM, Mark Wallace <[email protected]> wrote:
I am aware of a way to create REST resources in XWiki [1], but is there a way to create SOAP services within it?
Thanks, -Mark
[1]
http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI#HCustomres... -- Mark Wallace Principal Engineer, Semantic Applications Modus Operandi, Inc.
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs