has anybody got SOAP interface to work
I am using Enterprise edition 5.5 and This is a fragment of code from my application where I am trying to import/update scripts without having to wait for them via the import directory or stop scraping and load via workbench.
We can often spend as much as 1 1/2hr per day uploading new scrapes via workbench etc.. and the import directory still requires us to restart scraping engine so we are trying to find a quicker way of doing this, thus I was looking at the soap interface
When I run this I browse to the location of a recently exported .sss file and I select it, however I ALWAYS get 0 as a result and the file isn't imported. The file I am importing has just been exported so its from the same version of screen scraper. And I have set AllowOverwrite on the individual scripts, and I have even set the ForceOverwriteScripts=true in the screen-scraper.properties. So I am trying to figure out does the soap update work? has anybody succeeded with this feature of soap - or am I trying something that isn't possible
// Open file dialog to find where the file is that we want to import.
var openFileDialog = new OpenFileDialog { Filter = "Screen Scraper Files|*.sss", Title = "Import Screen Scraper file" };
openFileDialog.ShowDialog();
if (openFileDialog.FileName != "")
{
// Create a new XmlDocument
var xmlDocument = new XmlDocument();
// and load it with the contents of that file
xmlDocument.Load(openFileDialog.FileName);
// Create on object so that we can connect to screen scraper
var soap = new SOAPInterfaceService();
// Import the xml we got from the file
var result = soap.update(xmlDocument.ToString());
// it failed
if(result==0)
{
_keepItDry.AddTolistBox(DateTime.Now.ToLongDateString()+" "+DateTime.Now.ToLongTimeString()+": we failed to import this script",_listBoxLog);
}
else
{
_keepItDry.AddTolistBox(DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + ": script imported.", _listBoxLog);
}
}
However, there is no more details on why or what might have happened. Nothing in the log files... no idea... so how do I find out what it didn't like or why it wouldn't import?
help is appreciated.
Regards Julian
I would need to see your
I would need to see your request to see if I can see the issue, but it should work.
I use the REST API to import/start/monitor scrapes all the time. You might find that easier to work with.
http://community.screen-scraper.com/documentation/api/RESTAPI
What do you mean by see the request?
In my fragment of code I am trying to load the xml from inside an SSS file and replace or add a new script into the screen scraper engine. I too use COM and REST to start stop scrapes all the time, however the ability to replace a script appears to be only available in the SOAP...
So the code shown is all the code... so it is the whole request... my question to the forum was is this supposed to work? How can I import new or update scripts without stopping the server and then going into workbench as we have many many changes per day 60+ and the act of uploading these scripts into workbench can take as much as 1 1/2 hours per day. I am trying to make my process more efficient by not stopping the scrape engine whilst I am doing this.
The SOAP should work, I just
The SOAP should work, I just haven't used it in a while.
I have a similar situation where I need to update some scripts on a regular basis. To do it I just move the scripts (as .sss files) to the screen-scraper/import directory. It will import all the files therein upon certain event triggers, such as launching a scrape.
Hi, Just my two
Hi,
Just my two cents--Jason's right that the SOAP interface is quite dated. Our intent was for the REST interface to replace it. If you look at the docs here:
http://community.screen-scraper.com/documentation/api/RESTAPI
under "Import a File" you'll notice that you can accomplish the same thing.
That said, SOAP should still work, though I haven't tried it for quite some time either. Rather than try to debug it, though, I think you're better off either using the REST method we provide or simply copy the files into the "import" folder as Jason describes. If neither of those two methods work for you could you provide a bit more detail on the problem you're encountering so that we can help troubleshoot?
Thanks,
Todd
So in summary SOAP doesnt work by RESTful might?
Todd, thanks for your reply. As far as I can see the soap import just does not work. I have tried using the import folder and we cannot seem to control when it actually loads the files and it seems haphazard so it's not a reliable method for us.
As to giving you a bit more detail.. I am not sure what I can do as the entire section of code is as originally listed it just ALWAYS fails no matter what I do, what I was hoping to find out was why? where? what logs? or tracing? can be done to find out why.
However, given that you say it can be done with RESTful then this is what I will now pursue...
FYI, in version 6.0.17a SOAP
FYI, in version 6.0.17a SOAP is working again.