goetas-webservices / soap-client-demo

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

Unable to determine location to save PHP class #3

Closed victorgp89 closed 7 years ago

victorgp89 commented 7 years ago

I have this in my config.yml:

soap_client: ~

  xsd2php:
  namespaces:
    'http://tempuri.org/': 'Igm/SoapServices/Calculator'
  destinations_php:
    'Igm/SoapServices/Calculator': src/Calculator
  destinations_jms:
    'Igm/SoapServices/Calculator': metadata/Calculator
wsdl2php:
  metadata:
    'http://www.dneonline.com/calculator.asmx?WSDL': ~**

In my composer i have also this:

"autoload" : {
        "psr-4" : {
            "Igm\\SoapServices\\": "src",
            "Igm\\SoapServices\\Calculator"  : "src/Calculator",
            "Service\\"          : "src/Service"
        }
    }

But when I execute the command, return this error:

php bin/soap-client.php -vvv generate config/config.yml src/Service/Container

 **[GoetasWebservices\Xsd\XsdToPhp\PathGenerator\PathGeneratorException]                                     
  Unable to determine location to save PHP class 'Igm\SoapServices\Calculator\SoapEnvelope\Parts\AddInput'**

And when I put a unique namespace it works well.

goetas commented 7 years ago

Pay attention to the file path slashes and php namespace slashes. Your config file should be:

soap_client: ~

  xsd2php:
  namespaces:
    'http://tempuri.org/': 'Igm\SoapServices\Calculator'
  destinations_php:
    'Igm\SoapServices\Calculator': src/Calculator
  destinations_jms:
    'Igm\SoapServices\Calculator': metadata/Calculator
wsdl2php:
  metadata:
    'http://www.dneonline.com/calculator.asmx?WSDL': ~
goetas commented 7 years ago

@victorgp89 let me know if this is solved

victorgp89 commented 7 years ago

Yes, The problem is solved. I was guided by the example you have in https://github.com/goetas-webservices/xsd2php.

xsd2php: namespaces: 'http://www.example.org/test/': 'TestNs/MyApp'