Interesting, Jochem.  This is like an onion.  Every time I unwrap one layer,
it reveals a dozen new layers underneath.

That web service worked on the server this code was running on until last
Friday.  It works on my dev server.   The "public" method works on its own
web site,  and exactly the same code (but with different query names and
function names) doesn't work as a web service, when it did last week.  Huh?
Well that's onion layer number one.   Why it would work ok on two servers,
and not on the third (production) one.

Aside from that, now I'm  wondering what to do .  you say "Why do you choose
to use SOAP here? I would personally go for using REST".  I haven't got a
clue.  All I'm doing is using the code in CFWACK and trying to make it work.
Ben says:  "As we discovered, Web Service creation is exceptionally easy
when we utilise the functionality inherent in ColdFusion components."    And
that's what I'm doing.  I thought that what was generated by the CFC using
access="Remote"  was WSDL - a flavour of SOAP.   Are you saying its not wise
to use a CFC for it?   

Ben's book CFWACK led me to believe it was easy to share information by
means of a web service.  So also did Macromedia's Robin Hilliard at the CFUG
meeting when I first heard about web services.  "Piece of cake!" he
enthused.   "Nothing to it!  Once you learn how to do CFCs, it's a
no-brainer!"   HAH!  

So like a bloody fool, I accepted Ben, Macromedia,  Robin Hilliard as
experts in the field, and went ahead.  I used that web service myself in my
own sites,  I tested it by moving a query across between my dev server, and
my production server, and between two sites on different production servers.
It WAS a piece of cake.  Nothing to it.  Follow the instructions in Ben's
book and no problem.

Now I move that exact code, and it doesn't work.  I get abusive mail from
PHP developers telling me that my page produces invalid RSS code (it's not
RSS so that explains that!) I try to find out how to help the PHP users and
the PHP people wont help, the web sites I've been shown and have found in
google, all tell me how to create a web service in PHP, but no one gives any
instructions I can understand on how to consume a WSDL web service.    I
thought WSDL produced SOAP output and that's why I used it. NO one until
you, Jochem has suggested any different.  I don't even know what REST is.

So where do I go now?

Cheers

Mike Kear

Windsor, NSW, Australia

AFP Webworks

http://afpwebworks.com



  _____  

From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 16 March 2004 9:24 PM
To: CF-Talk
Subject: RE: CFC Web services wont work with PHP sites

Michael Kear said:
>
> <?php
>     include('SOAP/Client.php');
>     $SOAPClient = new
SOAP_Client("http://localhost/SOAP/example/server.php");
>     $SOAPOptions = array(
>             'namespace'=> 'urn:SOAP_Example_Server',
>             'trace'=>1
>         );
>     $sEquation = $SOAPclient->call(
>             "echoString",
>             $params = array("inputString" => "21 divided by 7
equals: "),
>             $SOAPOptions
>             );
>     $sResult = $SOAPclient->call(
>             "divide",
>             $params = array("dividend" => "21", "divisor" => 7),
>             $SOAPOptions
>             );
>  ?>

> How do I tell these PHP folks who wont learn and don't have a clue,
> how to use method getthisweeksevents from the web service at
> http://bluegrass.org.au/_cfcs/anniversaries.cfc?wsdl

First you make sure the web service at
http://bluegrass.org.au/_cfcs/anniversaries.cfc?wsdl actually works (I
currently download the source of the webservice if I try it).

At first glance, the code should be something like:
<?php
    include('SOAP/Client.php');
    $SOAPClient = new
SOAP_Client("http://localhost/SOAP/example/server.php");
    $SOAPOptions = array(
            'namespace'=>
'urn:http://bluegrass.org.au/_cfcs/anniversaries.cfc?wsdl',
            'trace'=>1
        );
    $sResult = $SOAPclient->call(
            "getthisweeksevents",
            $SOAPOptions
            );
?>

>   What code do I change? And to what?

Why do you choose to use SOAP here? I would personally go for using
REST and parse the XML using for instance
http://revjim.net/code/xmlParser/

> So .. if I take a stab in the dark at what has to be changed in the
> above, how do I check I'm giving the right instructions???

Install PHP and test it.

> All I ever get to this question is yet another list of URLS.

Maybe consuming web services in PHP is not exactly trivial and people
want to get compensated for writing code.

Jochem

  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to