hmm, the notion that the WSDL might be changing and even giving
changing URLs for submission does nix the idea of a static 1-step
approach.
and you say that witango doesn't have a good way to parse up the WSDL
to use to formulate a request? Does not bode well.
On Aug 31, 2006, at 12:44 PM, Robert Garcia wrote:
It all depends, the best way, is to use a 2 call method, where you
query the WSDL, and then, build the soap request from its contents,
and many times this is required. This is VERY easy, when you work
in a dev environment, that has a class, that will parse the WSDL,
and do most of the work for you. But witango doesn't do any of this
for you. So if your requirements, are to hit a wsdl, first, then
build the the soap request, based on its specs, it can be very
complicated.
Sometimes, you query the wsdl, and the only thing that may change
from time to time, is the url, you are actually supposed to make
the request to, but sometimes, the wsdl will describe a slightly
different schema, or something of that nature.
My suggestion is this, don't do it in witango. Do it in JAVA, as a
bean, or VB, or RB, and write an external object, where you can use
a nice easy class built for you that does the work.
Here is a quick example of what I mean, here is an extremely simple
soap method, to get the current temperature for a zip code:
<?xml version="1.0"?>
<definitions name="TemperatureService" targetNamespace="http://
www.xmethods.net/sd/TemperatureService.wsdl" xmlns:tns="http://
www.xmethods.net/sd/TemperatureService.wsdl" xmlns:xsd="http://
www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/
wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<message name="getTempRequest">
<part name="zipcode" type="xsd:string"/>
</message>
<message name="getTempResponse">
<part name="return" type="xsd:float"/>
</message>
<portType name="TemperaturePortType">
<operation name="getTemp">
<input message="tns:getTempRequest"/>
<output message="tns:getTempResponse"/>
</operation>
</portType>
<binding name="TemperatureBinding" type="tns:TemperaturePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/
soap/http"/>
<operation name="getTemp">
<soap:operation soapAction=""/>
<input>
<soap:body use="encoded" namespace="urn:xmethods-Temperature"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:xmethods-Temperature"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="TemperatureService">
<documentation>Returns current temperature in a given U.S.
zipcode </documentation>
<port name="TemperaturePort" binding="tns:TemperatureBinding">
<soap:address location="http://services.xmethods.net:80/soap/
servlet/rpcrouter"/>
</port>
</service>
</definitions>
now, you could build a soap request, based on this wsdl, by hand,
and use <@url to get the result, but what if the requirements, were
to parse this wsdl, on each call, for whatever reason? Well, take a
look, at how you would do it, in RealBasic 5.5 or above:
dim sm as SOAPMethod
// create new method and load WSDL document from URL
sm = new SOAPMethod("http://www.xmethods.net/sd/2001/
TemperatureService.wsdl")
// call the getTemp method and display the result
msgBox sm.getTemp(zipcodeFld.text)
Its like 3 lines of code, the class parses the wsdl, and you just
call the method, with the one parameter. It builds the entire soap
request for you, based on the wsdl. I am sure there are similar
classes in .NET, and I know there are in JAVA also. So a tool like
this, could be used to write a simple external action in witango.
Witango can do SOAP, but it can be painful, and many times, you run
into an encoding issue, or an xml issue, that makes the whole
effort for naught, because you hit something that witango can't do.
Witango 5.5009 just doesn't have enough of the necessary tools, and
such to do this stuff reliably and easy. It can be done, but the
more you do it, you hit a brick wall.
Here is a post, from witango customer support, on how to build a
soap request, using <@url may be helpful:
Rick,
It is as easy as this.
<@ASSIGN request$WebService "http://www.witango.com/AddService.wws">
<@ASSIGN request$SoapPayload '<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://
127.0.0.1/webservice/" xmlns:xsd="http://www.w3.org/2001/
XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<SOAP-ENV:Body>
<Add_In_Request>
<Value1>10</Value1>
<Value2>20</Value2>
</Add_In_Request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>'>
<@URL LOCATION='@@request$WebService' USERAGENT='Witango
<@VERSION> <@PLATFORM><@CRLF>Content-Type: text/
xml<@CRLF>SOAPAction: "http://www.witango.com/AddService.wws"'
POSTARGS='<?xml version="1.0" encoding="ISO-8859-1" ?><@CRLF><@VAR
request$SoapPayload ENCODING="NONE">'>
This is will call a tcf that is exposed as a web service on the
witango web site.
Calling a SOAP service on any platform from Witango Server 5.5 is
just as easy. The SOAPAction is also exposed via @HTTPATTRIBUTE.
All you need to do with the result is put it into a DOM variable
and grab the components you need using their element names with
XPATH expressions.
Witango Support
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On Aug 31, 2006, at 11:52 AM, Roland Dumas wrote:
Procedurally, is SOAP a 1 hit process or a 2?
Does the client send a properly packaged payload and wait for a
response? or does it ask for something and use that to create the
query?
I don't really want to know all about it, just enough to push the
query and interpret the response in this one case.
On Aug 31, 2006, at 11:48 AM, Scott Cadillac wrote:
Hi Roland,
they say
it's not so
simple. More moving parts because it's SOAP.
There is a bit to SOAP, but it still boils down to just HTTP and
posting and read text formatted as XML.
I think I slept through
the discussion of SOAP in San Diego.
T'sk, T'sk. I'll have to put a little black mark in my book ;-)
I have files called .wsdl and various test and debug docs.
Where to I go to decrypt this SOAP stuff?
Version 5.5 comes with some built-in SOAP features. I would
suggest starting there. Please note, I have not used or tried the
SOAP features of Witango - I primarily use .NET these days.
Best of luck Roland.
Scott Cadillac,
Email: [EMAIL PROTECTED]
http://scott.cadillac.bz
____________________________________________________________________
____
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
_____________________________________________________________________
___
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
______________________________________________________________________
__
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf