Works like a charm (unless you mean a charm with an LDoN augment, then it works much better than that).Here's the java code, as promised. I put it into two single static methods for brevity, in a class called GP_Tester. I am using axis from apache (http://ws.apache.org). The classes for communicating with the server have to be generated using the wsdl2java program (which is part of axis). If using the eclipse IDE, there is a nice plugin to use this, but if not, it's not that hard to run it from the command line. Once that's done, then add the newly generated classes to the classpath (or to the source directory tree) and you are all set. Here is the code (the tabs didn't come through right, but it still has 1 space indentations):___________________________________________________________import com.guildportal.Services.*; // These are generated by wsdl2java
public class GP_Tester{ public static String getHTML(String userName, String password, int contentInstanceID) throws Exception { PublisherLocator ploc = new PublisherLocator(); PublisherSoapStub p = (PublisherSoapStub)ploc.getPublisherSoap();
_GetFreeForm ff = new _GetFreeForm(); ff.setUserName(userName); ff.setPassword(password); ff.setContentInstanceID(contentInstanceID); _GetFreeFormResponse resp = p.getFreeForm(ff); return resp.getGetFreeFormResult().getHtml(); }
public static void publish(Sting userName, String password, int contentInstanceID, String HTML_toPublish) throws Exception { PublisherLocator ploc = new PublisherLocator(); PublisherSoapStub p = (PublisherSoapStub)ploc.getPublisherSoap(); FreeForm fform = new FreeForm(); fform.setContentInstanceID(contentInstanceID); fform.setHtml(HTML_toPublish); _Publish pub = new _Publish(); pub.setContentData(fform); pub.setUserName(userName); pub.setPassword(password); p.publish(pub); }
public static void main(String args[]) throws Exception { int contentInstanceID = 000000; // Put in your contentInstanceID String userName = "myname"; // Put in your username String password = "mypassword"; // Put in your password String html2publish = "THIS IS FROM WEB SERVICES"; // Some HTML System.out.println("HTML WAS: "+GP_Tester.getHTML(userName, password, contentInstanceID));
GP_Tester.publish(userName, password, contentInstanceID, html2publish);
System.out.println("HTML NOW: "+GP_Tester.getHTML(userName, password, contentInstanceID)); }}___________________________________________________________Have fun. I'll try to help anyone else trying this out, just post here or send me a site email..