Re: [SOAP] Help with Soap Client

[email protected] (NAVEEN)
Newsgroups php.soap
Message-ID <[email protected]>
Hi Tom,
 
The problem is in the WSDL.
Search for  those lines  having  use="encoded" in WSDL file and append 
 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"  with them.
 
Previous:
 use="encoded" 

After Modification :
 use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
 
Hope it works!
 
Naveen

--- On Sun, 4/19/09, EPA WC <[email protected]> wrote:


From: EPA WC <[email protected]>
Subject: [SOAP] Help with Soap Client
To: [email protected]
Date: Sunday, April 19, 2009, 9:57 AM


Hi All,

I am using the following code to build a SoapClient with some web service:

////////////////
<?php

ini_set("soap.wsdl_cache_enabled", "0");
ini_set('default_socket_timeout', 600);
$client = new SoapClient("http://iaspub.epa.gov/webservices/StationService/index.html?WSDL",array('trace'
=> 1));
try {
$sc = $client->getStationCount(43.1,43.5,-83.5,-83.1);
print $sc;
} catch (SoapFault $exception) {
    echo $exception;
}

?>
//////////////

But I got the following error:
///////////////
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Unspecified encodingStyle in /var/www/myphp/wqxststest.php:5
Stack trace: #0 /var/www/myphp/wqxststest.php(5):
SoapClient->SoapClient('http://iaspub.e...', Array) #1 {main} thrown
in /var/www/myphp/wqxststest.php on line 5
///////////////

Also when I tried same code (See below) with another service, it seems
working fine.
///////////////
<?php
$huc = $_REQUEST['huc'];
ini_set("soap.wsdl_cache_enabled", "0");
ini_set('default_socket_timeout', 600);
$client = new SoapClient("http://iaspub.epa.gov/webservices/WatershedSummaryService/index.html?WSDL",array('trace'
=> 1));
try {
$client->getCharacteristicSummary($huc);
print $client->__getLastResponse();
} catch (SoapFault $exception) {
    echo $exception;
}
///////////////
?>

I tried to find what's causing this error on Google but no success.
Anyone know what's going on?

Your help is highly appreciated!

Tom

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.