Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.
This repository was 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

Description

@speller

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions