You cant call web services using methods. A web services works very much
like a HTTP request. It is a stateless request so you have to pass
everything in at once.
You set the web service up much like a normal CFC, but you cant call
something like...
ws = createObject("WEBSERVICE", "bla.wsdl").init();
ws.setFirstName("foo");
ws.setLastName("bar");
result = ws.doName();
Each time you call a method on the web service it acts in its own request so
when you call setLastName() it will think FirstName was never set which is
why you pass it all in at once and have the doName() get the values from the
data.
You can pass in arguments though but that gets tricky when you have some
optional arguments. Our SMS webservice is XML based, set up an xml packet
and send it all to the web service.
IF you need to define the data types use CFPROPERTY, thats what its for.
Steve
Its either/or. I preferred the XML way so that's the way it was built. I
guess what I was trying to say in my last email is there isn't a right/wrong
way, just what ever fits better with what you are trying to do. Its easier
to search xml than it is to try and parse arguments if some arguments are
not required to be passed in. Also I don't know if you will have issues
with things like passing in arrays and stuff into the web service because of
the data types possibly not being maintained in the request. This is where
XML is better as you don't need to worry about it and you can handle it all
in your web service.
Steve
-----Original Message-----
From: cfau...@googlegroups.com [mailto:cfau...@googlegroups.com] On Behalf
Of Matthew
Sent: Tuesday, 11 November 2008 1:41 PM
To: cfaussie
Subject: [cfaussie] Re: Building a web service - can you pass in XML or
should the arguments be data typed
"All CF datatypes are converted to SOAP equivalents"
I couldn't agree with you more.
My experience is limited, but I have spent a lot of painful time
working on serious CF-SAP integration with single-sign-on
authentication via web services.
(In my case, CF was a consumer.)
We have tried every possible way to pass a recordset, which is called
"internal table" in SAP world, without success.
The remote function doesn't throw any method signature errors, which
it usually does, but it just recognises the parameter as an empty
recordset.
I guess something wrong is going on with CF's stubs - I mean CF's
implementation of web services.
We eventually re-wrote the remote function so it expects a serialised
recordset, which is not in XML but sort of DSL.
So, while CF's implementation of web services is magical and handy,
its capability is limited.
As a side note, I was able to achieve the same thing with Flex in half
an hour. (grin)
ArrayCollection of VOs is correctly recognised and parsed as "internal table".
Cheers.
Terry
2008/11/12 Kai Koenig <k...@bloginblack.de>: