goetas-webservices / soap-client-demo Goto Github PK
View Code? Open in Web Editor NEWDemo project for https://github.com/goetas-webservices/soap-client
Demo project for https://github.com/goetas-webservices/soap-client
Hi,
Sorry but in step3 if I need authentication to access wsdl, how should it be done?
Thanks for advance.
I clone this project to my mac,use php bin/demo.php
it run,but when I use http://localhost/projectpath/bin/demo.php
to visit,it is error, look like Fatal error: Uncaught JMS\Serializer\Exception\InvalidArgumentException: The directory "metadata/Calculator" does not exist. in /Users/path/projectpath/vendor/jms/serializer/src/JMS/Serializer/SerializerBuilder.php:314
My config.yml is your demo:
soap_client:
# alternative_endpoints:
# service:
# port: http://localhost:8080
namespaces:
'http://tempuri.org/': 'Calculator'
destinations_php:
'Calculator': src/Calculator
destinations_jms:
'Calculator': metadata/Calculator
metadata:
'http://www.dneonline.com/calculator.asmx?WSDL': ~
and I run endor/bin/soap-client generate config/config.yml src/Service/Container --dest-class=Service/Container/SoapContainer
Could I ask you how to run on website?
Thankyou very much.
If we receive an xml request, is it possible to use the serializer only with xsd? without metadata and wsdl?
Like: $ this-> serializer-> deserialize ((string) $ request-> getRawBody (), $ class, 'xml');
Thanks for advance
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.
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.
Dear,
May I know what is : <ns-77e106cb:OTA_HotelAvailNotifRQ xmlns:ns-77e106cb?
I don't understand how these symbols are formed.
Thank you.
Hello,
I'm trying to use the demo with a custom wsdl, but got error when deserializing the OTA_HotelAvailRQ message. Seems that it's not handling the soap headers as expected. Can you give me some thoughts on what is happening? Thank you.
I attach wsdl and xml message.
Code executed:
$xml = file_get_contents(__DIR__ . '/OTA_HotelAvailRQ.xml');
$test = $serializer->deserialize($xml, ReadRoomTypeCodesInput::class, 'xml');
CLI Response
carnau@lenovo:/srv/host/gitlab/carnau/soap-client-demo$ php bin/demo-server.php PHP Fatal error: Uncaught ReflectionException: Class GoetasWebservices\SoapServices\SoapEnvelope\Headers does not exist in /srv/host/gitlab/carnau/soap-client-demo/vendor/jms/metadata/src/Metadata/MetadataFactory.php:167 Stack trace: #0 /srv/host/gitlab/carnau/soap-client-demo/vendor/jms/metadata/src/Metadata/MetadataFactory.php(167): ReflectionClass->__construct('GoetasWebservic...') #1 /srv/host/gitlab/carnau/soap-client-demo/vendor/jms/metadata/src/Metadata/MetadataFactory.php(72): Metadata\MetadataFactory->getClassHierarchy('GoetasWebservic...')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.