Skip to content

Commit

Permalink
Merge pull request #28 from veewee/improved-method-types
Browse files Browse the repository at this point in the history
Improve method type information
  • Loading branch information
veewee committed May 24, 2024
2 parents 758e2b6 + df278ed commit df16b8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private function findXsdType(QNamed $type): XsdType
return XsdType::guess($type->localName)
->withXmlNamespaceName($type->prefix)
->withXmlNamespace($namespace->unwrapOr(''))
->withXmlTypeName($type->localName)
->withMeta(
static fn (TypeMeta $meta): TypeMeta => $meta->withIsSimple(true)
);
Expand Down
9 changes: 8 additions & 1 deletion src/Metadata/Converter/Wsdl1ToMethodsConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Soap\Engine\Metadata\Collection\ParameterCollection;
use Soap\Engine\Metadata\Model\Method;
use Soap\Engine\Metadata\Model\Parameter;
use Soap\Engine\Metadata\Model\TypeMeta;
use Soap\Engine\Metadata\Model\XsdType;
use Soap\WsdlReader\Locator\Wsdl1SelectedServiceLocator;
use Soap\WsdlReader\Metadata\Converter\Methods\Configurator\BindingOperationConfigurator;
Expand Down Expand Up @@ -50,7 +51,13 @@ private function parseMethod(Wsdl1SelectedService $service, BindingOperation $bi
$parameters = $inputMessage->map($convertMessageToTypesDict)->mapOr(
static fn (array $types) => map_with_key(
$types,
static fn (string $name, XsdType $type) => new Parameter($name, $type)
static fn (string $name, XsdType $type) => new Parameter(
$name,
// Make sure the target type encodes into an **element** that is **named like the parameter part**.
$type
->withXmlTargetNodeName($name)
->withMeta(static fn (TypeMeta $meta): TypeMeta => $meta->withIsElement(true))
)
),
[]
);
Expand Down

0 comments on commit df16b8a

Please sign in to comment.