goetas-webservices / soap-client-demo

Demo project for https://github.com/goetas-webservices/soap-client
5 stars 7 forks source link

You must define a type #4

Closed victorgp89 closed 7 years ago

victorgp89 commented 7 years ago

I move this my issue in soap-server because the same happens to me.

$container = new \Igm\SoapServices\Service\Container\SoapClientContainer();

$buildSerializer = $generator::createSerializerBuilderFromContaioner($container, function($h) use($headerHandler){
    $h->registerSubscribingHandler($headerHandler); })->build();
$metadata = $container->get('goetas_webservices.soap_client.metadata_reader');

My serializer have the metadatasDir:

      [0] => JMS\Serializer\Metadata\Driver\YamlDriver Object
                        (
                            [locator:Metadata\Driver\AbstractFileDriver:private] => Metadata\Driver\FileLocator Object
                                (
                                    [dirs:Metadata\Driver\FileLocator:private] => Array
                                        (
                                            [Igm\SoapServices\Test] => metadata/Test
                                            [GoetasWebservices\SoapServices\SoapCommon\SoapEnvelope] => /var/www/synergy-generator/src/Generator/../Resources/metadata/jms
                                        )

                                )

                        )

My Yml is this:

Igm\SoapServices\Test\SoapEnvelope\Messages\GetSimpleInput:
    xml_root_name: 'SOAP:Envelope'
    xml_root_namespace: 'http://schemas.xmlsoap.org/soap/envelope/'
    xml_namespaces:
        SOAP: 'http://schemas.xmlsoap.org/soap/envelope/'
    properties:
        body:
            expose: true
            access_type: public_method
            type: Igm\SoapServices\Test\SoapEnvelope\Parts\GetSimpleInput
            serialized_name: Body
            xml_element:
                namespace: 'http://schemas.xmlsoap.org/soap/envelope/'
            accessor:
                getter: getBody
                setter: setBody
        header:
            expose: true
            access_type: public_method
            type: GoetasWebservices\SoapServices\SoapClient\Arguments\Headers\Handler\HeaderPlaceholder
            serialized_name: Header
            xml_element:
                namespace: 'http://schemas.xmlsoap.org/soap/envelope/'
            accessor:
                getter: getHeader
                setter: setHeader

But I still have the same error:

You must define a type for Igm\SoapServices\Test\SoapEnvelope\Messages\GetSimpleInput::$body.

victorgp89 commented 7 years ago

And when print: $metadata = $this->serializer->getMetadataFactory()->getMetadataForClass('Igm\SoapServices\Test\SoapEnvelope\Messages\GetSimpleInput');

Is correct the return: [reflection] => ReflectionClass Object ( [name] => Igm\SoapServices\Test\SoapEnvelope\Messages\GetSimpleInput )

goetas commented 7 years ago

just out of curiosity, can you put absolute paths everywhere on your config.yml and retry?

victorgp89 commented 7 years ago

That's the problem, If I put the absolute path in the config.yml don't work. But if I hardcored the path like:

$dir = '/var/www/synergy-generator/metadata/Test'; Yes, that's work

goetas commented 7 years ago

if it works with absolute paths, means that thee library works and means that you have to figure out which paths are wrong... I mean, it depends from where is executed your applications/script, which is the working directory and so on...