tags:

views:

41

answers:

2

I'm trying to write PHP to call a web service. Using SoapUI, I construct the following call to the service, which works:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://gmo.ws.client.np.z2.com/xsd"&gt;
   <soapenv:Header/>
   <soapenv:Body>
      <xsd:login>
         <xsd:auth>
            <xsd:password>myPwd</xsd:password>
            <xsd:userName>myUsername</xsd:userName>
            <xsd:version>1.0</xsd:version>
         </xsd:auth>
         <xsd:applicationName>wnp</xsd:applicationName>
      </xsd:login>
   </soapenv:Body>
</soapenv:Envelope>

I'm using the following PHP to call the same service:

<?php
$client = new soapclient('http://www.z2systems.com:8888/neonws/services/GMOService');

$auth_array = array(
    'auth' => array(
      'password' => 'myPwd',
      'userName' => 'myUsername',
      'version' => '1.0'
    ),
    'applicationName' => 'wnp'
 );

$login_results = $client->__soapcall('login', $auth_array);
?>

When I make the call, I'm getting an error back "Parsing WSDL: Couldn't find ".

The provider of the web service has been less than helpful, so any advice would be greatly appreciated!

+1  A: 

I think you need to provide the WSDL url to PHP not some url pointing to an HTML error page. Try opening http://www.z2systems.com:8888/neonws/services/GMOService in a browser.

EDIT:

to you comment: try to wrap your auth-array in an additional array like this:

$login_results = $client->__soapcall('login', array($auth_array));

the arguments have to be an array, and the array you're giving is the first argument (if i understand the esdl correctly).

RC
Thanks. Had tried that along the way. But when I point it to the WSDL, I get back an error "Nil UserAuth, please verify your data.
Dennis Deery
@Dennis: please see my edit.
oezi
Oezi, thanks a million. I'd have sworn I tried that before, but I must not have. It worked!
Dennis Deery
+1  A: 

put the correct url to the wsdl into your soapclient and it should work.

http://www.z2systems.com:8888/neonws/services/GMOService < this is just pointing to an error-page

http://www.z2systems.com:8888/neonws/services/GMOService?wsdl < i think this is the url you're looking for

oezi
Thanks. Had tried that along the way. But when I point it to the WSDL, I get back an error "Nil UserAuth, please verify your data."
Dennis Deery