Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
weierophinney opened this issue Dec 31, 2019 · 2 comments
Closed

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

weierophinney opened this issue Dec 31, 2019 · 2 comments
Labels
Question Further information is requested

Comments

@weierophinney
Copy link
Member

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?


Originally posted by @speller at zendframework/zend-soap#43

@rdoering
Copy link

rdoering commented Jun 5, 2020

Is it possible, that this is an PHP-soapServer issue?

@weierophinney
Copy link
Member Author

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee.
If you have a security issue, please follow our security reporting guidelines.
If you wish to take on the role of maintainer, please nominate yourself

If you need an actively developed SOAP client, we recommend phpro/soap-client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants