First retrieve the WSDLs for both services and look at the XML line at the top to see what encoding is specified. Then set your soap client to use the same encoding when you create it. Most of the time this is set to UTF-8. Ciao, Andrew EPA WC wrote: > > 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 > > > -- View this message in context: http://www.nabble.com/Help-with-Soap-Client-tp23119586p25931177.html Sent from the Php - Soap mailing list archive at Nabble.com. -- PHP Soap Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php