By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,948 Members | 1,958 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,948 IT Pros & Developers. It's quick & easy.

PHP5 consume web service without wsdl

P: n/a
I need to consume a web service written in Perl but there is no wsdl
file for this service.
The perl soap client that can call and consume this web service looks
like this (if it helps)

#!perl -w

use SOAP::Lite +trace => "debug";

print SOAP::Lite
->uri("urn:WebServices")
->proxy("http://example.com")
->SomeMethodName('param1', 'param2')
->result;

How can this be translated in to something that is easily used in PHP5?

There is no wsdl file describing the web service above.

Feb 14 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
frustratedcoder wrote:
I need to consume a web service written in Perl but there is no wsdl
file for this service.
The perl soap client that can call and consume this web service looks
like this (if it helps)

#!perl -w

use SOAP::Lite +trace => "debug";

print SOAP::Lite
->uri("urn:WebServices")
->proxy("http://example.com")
->SomeMethodName('param1', 'param2')
->result;

How can this be translated in to something that is easily used in PHP5?

There is no wsdl file describing the web service above.


I'm going to assume that you are using the built-in SOAP library (as
opposed to PEAR or nuSOAP). I'm also going to assume PHP5 and an
object-oriented approach.

To instantiate a new SOAP client:

$client = new SoapClient(null, $args);

The null indicates that there is no WSDL for this client.

The args will be something like:
$args = array(
'soap_version' => SOAP_1_1,
'location' => 'http://example.com/?WebServices',
'uri' => 'http://example.com/'
);

Then you can call the methods as:

$client->SomeMethodName(array('param1', 'param2'));

Don't forget to set try-catch blocks to handle exceptions.

-david-
Feb 14 '06 #2

P: n/a
This was exactly the example I was looking for, thanks.

Feb 14 '06 #3

P: n/a
Now I have the access to the web service, but all Im getting is
"PCFET0NUWVBFIFN0ZXBTdG9uZUVhc3lDcnVpdENh"? when I run the client
written in Perl I get a string of xml in return.

Feb 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.