I'm new to Applescript, but I followed this handy tutorial, the first Google result for "Applescript webservice": http://developer.apple.com/internet/applescript/applescripttoperl.html
So I have (hopefully) a perl script giving me a webservice at http://localhost:8001
but when I run
set p to {"http://www.perl.com/pace/perlnews.rdf", "http://www.perl.com/pace/perlnews.rdf"}
using terms from application "http://www.apple.com/placebo"
tell application "http://localhost:8001" to return call soap {method name:"fetch_headlines", method namespace uri:"http://localhost:8001", SOAPAction:("http://localhost:8001" & "#" & "fetch_headlines"), parameters:p}
end using terms from
I get
"got an error: Transport error"
Google is failing me. Any ideas where to look?
Transport error mean that the communication endpoint does not respond. Do you forget start the perl soap-server script (for listening at port 8001)?
And after you start your perl SOAP server, your applescript SOAP-client code should be
set p to "http://search.cpan.org/uploads.rdf"
using terms from application "http://www.apple.com/placebo"
tell application "http://localhost:8001/Server" to return call soap {method name:"fetch_headlines", method namespace uri:"http://localhost:8001/Server", SOAPAction:("http://localhost:8001/Server" & "#" & "fetch_headlines"), parameters:{uri:p}}
end using terms from
ps: http://www.perl.com/pace/perlnews.rdf does not exists...
Related
I am trying to use post method in this add Attachment to SAP ODATA service (URL), then I am getting the error
"Key 'file_name' not given".
I used Multippart/form-data and given file_name (with single cotes and with out it) still the error is same.
Any idea where to give file_name?
Thanks.
I've nano 10 PLC which records some data in its memory i need that data on my web application we can program the PLC with "Ladder + BASIC" language that can easily handle sophisticated tasks with just a few lines of codes now my requirement is get PLC recorded data to my web application through Web Service or REST API call is it possible to call api if so how to proceed with it
You just have to use TCPCONNECT to establish the connection.
PRINT #4 "<TCPCONNECT 192.168.0.51:3000>"
Use STATUS(3) to check if the connection has been established or not.
IF STATUS(3)
SETLCD 1,1,"Connected"
ELSE
SETLCD 1,1,"NOT Connected"
GOTO 100
ENDIF
Then send the request
PRINT #4 "GET /hello.htm HTTP/1.1"
PRINT #4 "" ' this is important
You have to follow the HTTP protocol format. For other methods, refer https://www.jmarshall.com/easy/http/#othermethods
Look at http://www.triplc.com/Sample_Programs.htm
You will find tbasic sample code for tcp/ip. Make sure you format your request like a normal http GET or POST request. You will have to serialize your data to JSON.
We're using a $server = SOAP::Transport::HTTP::Apache->new; $server->dispatch_with(...) over here as a backend to a JS-based application. Should the underlying module die, it sends back a nice error message that gets displayed by the JS code.
The problem is, I would like more detailed messages (e.g. Carp::longmess), and a hard copy of those on STDERR.
How can I inject a custom exception handler into SOAP::Transport::HTTP::Apache with minimal code modifications?
(This is a large and old project we can't afford to rewrite, though honestly it deserves a rewrite).
UPDATE: here's a sample error message:
<soap:Body><soap:Fault>
<faultcode>soap:Server</faultcode><faultstring>Column
'allocation' cannot be null at
/usr/local/lib/perl5/site_perl/5.8.8/Tangram/Storage.pm
line 686. </faultstring></soap:Fault></soap:Body>
I get a Tangram error but this is unlikely a bug in Tangram and anyway I need a full stack-trace. OTOH, the die message got into a SOAP message which is not a normal die action so there's a handler somewhere -- which I want to customize a bit.
The error handler is located under SOAP::Transport::HTTP::Server::_output_soap_fault. Try a grep on <faultcode> in the perl INC paths.
I have python's based soap server and tried to call it functions using erlang (yaws_soap_lib based) soap client:
1> inets:start().
ok
2> yaws_soap_lib:call("http://127.0.0.1:90/soap/system/wsdl","cpu_count",[]).
{ok,undefined,undefined}
here is what I was able to see with tcpdump program (answer of server to client):
HTTP/1.1.200.OK..Date:.Wed,.20.Oct.2010.15:56:11.GMT..Server:.Apache/2.2.15.(Unix).mod_wsgi/2.5.Python/2.5.2..Content-Length:.276..Content-Type:.text/xml
< SOAP-ENV:Envelope.xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance".xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" > < SOAP-NV:Body> < cpu_countResponse>< cpu_countResult.xsi:type="xs:int">2< /cpu_countResult>< /cpu_countResponse>< /SOAP-ENV:Body>< /SOAP-ENV:Envelope>
as one can see in envelope server answer 2, but yaws_soap_lib:call was not able to see that 2 in the answer. is there an option to fix the issue?
Thanks.
I suspect you have not specified NS prefix, which is by default "P" or "p" (I can't remember). So whenever you receive response soap client is not able to deserialize it, because it is represented in erlsom model as a record 'P:cpu_countResponse'.
In BizTalk 2006, I am trying to set up a messaging-only scenario whereby the recieved message (a string) is passed to a web service method that takes a single string parameter. In other words, the whole body of the BizTalk message should be passed as the parameter to the web service call.
The service method looks like this:
[WebMethod]
public void LogAuditEvent(string auditEventMessage)
I have set up the assembly with the proxy class in the SOAP adapter configuration as required, but I can't figure out how to get the message body to be passed as the parameter. Without doing anything special, I get the following error message:
Failed to serialize the message part
"auditEventMessage" into the type
"String" using namespace "".
I think this means that the adapter cannot find a message part named after the parameter. So, my question is what do I need to do to get my message set up correctly? I was thinking that maybe I needed to add an outbound map, but was not sure what to use as the source schema and how to generate a proper schema for the web service request message.
Does anyone have any pointers on this seemingly simple task?
Thanks.
TDL,
I would take a look at the links below for some tips on how to do this. SOAP adapter can be problematic I would recommend WCF if your using R2. And if not look at the WSE adapters as well.
http://blogs.digitaldeposit.net/saravana/post/2007/01/31/Calling-Web-Service-from-BizTalk-2006-in-a-Messaging-only-Scenario-(aka-Content-based-Routing).aspx
-and-
http://www.pluralsight.com/community/blogs/aaron/archive/2005/10/07/15386.aspx
-and-
http://social.technet.microsoft.com/Forums/en-US/biztalkgeneral/thread/92f2cad3-39b9-47d0-9e6f-011ccd2f9e10/
-Bryan