Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Can not run soap server using document-style binding #43

Open
speller opened this issue Jun 16, 2017 · 1 comment
Open

Can not run soap server using document-style binding #43

speller opened this issue Jun 16, 2017 · 1 comment
Labels

Comments

@speller
Copy link

speller commented Jun 16, 2017

I'm trying to use document-style binding startegy with following test code:

<?php
include '../vendor/autoload.php';

ini_set("soap.wsdl_cache_enabled", "0");

class MyClass {
	/**
	 * @param string $inputParam
	 * @param string $inputParam2
	 * @return string
	 */
    public function method1($inputParam, $inputParam2) {
        return "$inputParam $inputParam2";
    }
}

if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    if (isset($_GET['wsdl'])) {
		// WSDL code
		$autodiscover = new Zend\Soap\AutoDiscover();
		$autodiscover
			->setBindingStyle([
				'style' => 'document',
			])
			->setClass('MyClass')
			->setUri('http://localhost.loc/test.php');
		header('Content-Type: text/xml');
		echo $autodiscover->toXml();
	} else {
		// Client code
		$client = new Zend\Soap\Client('http://localhost/test.php?wsdl');
		print_r($client->method1(22, 'some string'));
	}
} else {
	// Server code
	$soap = new Zend\Soap\Server("http://localhost/test.php?wsdl");
	$soap->setClass('MyClass');
	$soap->handle();
}

But when I try to run this script I get error:

SoapFault: Error cannot find parameter in C:\usr\work\amayama\amayama-eng\vendor\zendframework\zend-soap\src\Client.php on line 1166

If I remove the binding style config - it work fine. What I do wrong?

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-soap; a new issue has been opened at laminas/laminas-soap#11.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants