diff --git a/src/Metadata/Converter/Methods/Converter/MessageToMetadataTypesConverter.php b/src/Metadata/Converter/Methods/Converter/MessageToMetadataTypesConverter.php index dd021bc..03c9001 100644 --- a/src/Metadata/Converter/Methods/Converter/MessageToMetadataTypesConverter.php +++ b/src/Metadata/Converter/Methods/Converter/MessageToMetadataTypesConverter.php @@ -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) ); diff --git a/src/Metadata/Converter/Wsdl1ToMethodsConverter.php b/src/Metadata/Converter/Wsdl1ToMethodsConverter.php index aa5edc6..0ad1929 100644 --- a/src/Metadata/Converter/Wsdl1ToMethodsConverter.php +++ b/src/Metadata/Converter/Wsdl1ToMethodsConverter.php @@ -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; @@ -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)) + ) ), [] );