goetas-webservices / soap-client Goto Github PK
View Code? Open in Web Editor NEWPHP implementation of SOAP 1.1 and 1.2 client specifications
License: MIT License
PHP implementation of SOAP 1.1 and 1.2 client specifications
License: MIT License
Hey Asmir!
Could you please create a new release, v0.2.12, including my latest configuration change?
Thanks a bunch!
Robbert
After installing dependencies with composer install --no-dev
the symfony/yaml
library is missing. Can be fixed by installing the library manually. This behaviour is not seen this in development since symfony/yaml
is required by goetas-webservices/wsdl2php
.
Sorry I cannot reopen issue #61, I have an additional problem, I cannot generate the metadata because also to access to WSDL during metadata generation needs credentials...
The definition "goetas_webservices.xsd2php.schema_reader" has a reference to an abstract definition "logger". Abstract definitions cannot be the target of references.
This error in library why does it appear?
Thanks for this nice library. I'd like to use it for a service which requires NTLM authentication. I've looked through the code but I'm not sure I see a way to set the necessary authentication in the config.yml
. Could you please provide some documentation for this?
Hi,
I would like to port my SoapClient code to goetas-webservices but I'm running a problem where the server requires xsi:type attribute on the record.
How can I add these type attributes to the generated xml request?
Thanks,
Karoly
It's possible to send soapfault with a 200 OK and not 500?
Is there a way to see/print the request and response messages? Something like a debug or test feature to print a log file with these messages? I would like to tag this as "help wanted" but I don't know how ...
Hi,
Sorry for the question. But I have this metadata yml
Igm\Synergy\Controllers\Boards\HotelMealPlansNotifRSType:
properties:
hotel:
expose: true
access_type: public_method
serialized_name: Hotel
accessor:
getter: getHotel
setter: setHotel
type: Igm\Synergy\Controllers\Boards\HotelMealPlansNotifRSType\HotelAType
mealPlans:
expose: true
access_type: public_method
serialized_name: MealPlans
accessor:
getter: getMealPlans
setter: setMealPlans
type: array<Igm\Synergy\Controllers\Boards\HotelMealPlansNotifRSType\MealPlansAType\MealPlanAType>
xml_list:
inline: false
entry_name: MealPlan
skip_when_empty: true
This class have this properties:
class HotelMealPlansNotifRSType extends BaseController
{
/**
* @property \Igm\Synergy\Controllers\Boards\HotelMealPlansNotifRSType\HotelAType
* $hotel
*/
private $hotel = null;
/**
* @property
* \Igm\Synergy\Controllers\Boards\HotelMealPlansNotifRSType\MealPlansAType\MealPlanAType[]
* $mealPlans
*/
private $mealPlans = null;
}
So far, everything is correct. But this class extends from another: BaseController. I need to exclude the parent's class properties in JMS\Serializer\Metadata\PropertyMetadata Object
With exclude : true, works from the HotelMealPlansNotifRSType but not from the extended properties.
I hit an issue that seems to be related to JMS Serializer component, but it's locked to version 1.x
. (TypeParser is failing to parse \AnyType
string).
I try to upgrade soap-client to use JMS Serializer 2.x or 3.x, but unit tests are failing because Serializer::getMetadataFactory()
is not available anymore. I have tried to access the factory using Reflection, but it fails latter because the MetadataFactory api seems to have changed.
"Call to undefined method JMS\Serializer\Metadata\PropertyMetadata::setValue()" at
/home/toilal/projects/goetas-webservices/soap-client/src/Arguments/ArgumentsReader.php:87
Given a large WS definition, with hundreds of operations where one would want to use only a subset, it might be useful to provide a configuration option to the generate command to consider only specific types or types referenced by an operation. I have in mind something similar this package offers: https://github.com/wsdl2phpgenerator/wsdl2phpgenerator#operationnames
In my usecase the generation results in 3000+ classes and 8000+ metadata files. Since it's generated code, and for the sake of auto-completion, maybe I should not care and just commit everything to vcs? On the otherhand, I am able to tell apart which methods I will use. A workaround might be to shorten the wsdl/xsd manually but that seems hacky.
Hi,
A question,
When a wsdl has importacions like:
<xsd:import namespace="http://ws.link.hotelresb2b.com/login" schemaLocation="Link?xsd=login.xsd"/>
When I execute the command:
vendor/bin/soap-client -vvv generate config/config_hotusa.yml src/Service/Container --dest-class=Igm/Synergy/Service/Container/SoapContainerHotusa
I've an error in the SchemaReader.php
In all the metadata that I have generated with WSDL without imports, I haven't had any problems.
Thanks for advance,
Victor
I have this operation name OTA_HotelRateAmountNotif, it is transformed in oTAHotelRateAmountNotif in SoapStub class.
The operation oTAHotelRateAmountNotif isn't find by your Client because it checks the key of operations array only by strtolower in findOperation
Line 141 in 049195e
A solution can be to compile operations array key with same strategy
Or is it better to remove the camelize transformation in Stub generator?
Hi,
If a partner has a webservice with wsdl, but they are the ones who attack us to receive a response it's necessary to perform the soapclient process?
Without soap-envelope I use xsdtophp library to deserialize but when the xml has SOAP-ENV it's more difficult and the response is without soap-envelope too.
Any suggestions @goetas ?
Thanks a lot.
Hi! First of all, thanks for all your efforts in trying to make soap work with PHP ๐ I know it's a pain..
Talking about that, I've been playing (read: debugging) my third party SOAP webservice with your libraries and have the following issues:
The WSDL (2.0) definition that I get from the webservice, has multiple inline schemas with the same targetNamespace. It seems like your schema reader is overwriting it everytime it finds a <xs:schema>
line. I looked it up in the WSDL-2.0 spec at http://www.w3.org/TR/wsdl20/ which states:
3.1.2 Inlining XML Schema
...
A WSDL 2.0 document MAY inline two or more schemas from the same targetNamespace. For example, two or more inlined schemas can have the same targetNamespace provided that they do not define the same elements or types. A WSDL 2.0 document MUST NOT define the same element or type in more than one inlined schema.
...
So the desired behaviour is that multiple schema
nodes with the same targetNamespace should "extend" each other, not override. I'd like to make PR to make that happen. Before I start, any concerns, thoughts, ideas? :D
Hi,
It's posible changes de namespace of soap-envelope?
WebService required:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
But library put me:
<SOAP:Envelope xmlns:SOAP="http://www.w3.org/2003/05/soap-envelope">
Hi Goetas,
I have the following wsdl:
https://integcert.synxis.com/interface/ota2010av2/OTA2010A.svc.wsdl
This is my yml:
But when I try to convert metadatas I've the following error:
Hi!
I've tried to run example script from readme.md section 'Using the client'. Unsuccessfully. I finally got it started.
I had to change:
$metadata = $container->get('goetas_webservices.soap_client.metadata_reader');
to
$metadata = $container->get('goetas_webservices.soap_client.metadata_loader.array');
It's a bug or?
Hi,
I have this config.yml:
soap_client: ~
xsd2php:
namespaces:
'http://dev.synergy.app/login': 'Igm\Synergy\Login'
'http://dev.synergy.app/schema': 'Igm\Synergy\Schema'
'http://dev.synergy.app/exception': 'Igm\Synergy\Exception'
'http://dev.synergy.app/mealplans': 'Igm\Synergy\Controllers\Mealplans'
destinations_php:
'Igm\Synergy\Controllers\Mealplans': src/application/controllers/mealplans
'Igm\Synergy\Schema': src/application/schema
'Igm\Synergy\Login': src/application/login
'Igm\Synergy\Exception': src/application/exception
destinations_jms:
'Igm\Synergy\Controllers\MealPlans': metadata/mealplans
'Igm\Synergy\Login': metadata/login
'Igm\Synergy\Exception': metadata/exception
wsdl2php:
metadata:
'/var/www/igm_xml/include/mealplan.wsdl': ~
The classes generate correctly but I have this error:
Unable to determine location to save JMS metadata for class 'Igm\Synergy\Controllers\Mealplans\SoapEnvelope\Headers\GetMealPlansInput
I installed the library inside a Symfony 4.3 project using composer. When I run the generate
command I get:
In Container.php line 263:
The "goetas_webservices.wsdl2php.wsdl_reader" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.
generate [--dest-class DEST-CLASS] [--] <config> <dest-dir>
Tried adding a few things to my services.yaml
config but not made it work.
My composer.json is:
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"goetas-webservices/soap-client": "^0.2.8",
"php-http/guzzle6-adapter": "^1.0",
"php-http/message": "^1.0",
"guzzlehttp/psr7": "^1.3",
"symfony/console": "4.3.*",
"symfony/dotenv": "4.3.*",
"symfony/flex": "^1.3.1",
"symfony/framework-bundle": "4.3.*",
"symfony/yaml": "4.3.*"
},
"require-dev": {
"goetas-webservices/wsdl-reader": "^0.3.5",
"goetas-webservices/wsdl2php": "^0.4.3",
"roave/security-advisories": "dev-master"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.3.*"
}
}
}
beacuse the "symfony/dependency-injection"
has upper bound "^3.0"
.
Hi,
In this project is posible load wsd or another depending on the url?
I'm consuming a Soap server that has some fields declared as xs:anyType
.
There's a note in xsd2php README.md about how to declare custom handlers for those types, but I can't get them to work with soap-client.
Could you provide a short example to make it work ? How to register a custom JMS Serializer handler inside soap client container ?
Hi Goetas,
Thanks for your job.
Is it possible to perform an html_entity_decode with some predeserialize event?
I would not like to do it for all clients that use the api if not only for those that return this type of coding.
Hi,
It's possible extract CDATA when XML is generate?
Thanks for advance.
I need to pass credentials to soap client, is there an example to do this?
Hi,
I wanted to see a problem I have about the Fault class.
When a web service returns an object inside the FaultDetail like this:
I have seen that a FaultHandler had been created.
What it does is insert the node as a string when it deserializes it:
[detail:Igm\Synergy\SoapClient\Envelope\SoapEnvelope12\Parts\Fault:private] => <ns3:LinkHotelException xmlns:ns3="http://ws.link.test.hotelresb2b.com/exception"><ns3:errorCode>0221</ns3:errorCode><ns3:language>2</ns3:language><ns3:message>The room with this affiliation does not exist in the system.[asdsadsad]</ns3:message></ns3:LinkHotelException>
Is it possible to emulate the behavior of HeaderPlaceHolder to be able to insert any type of object always inside?
Hi,
I'm trying use your library for source https://gclient.geis.cz/GService/GService.svc?singlewsdl
, but I don't know if I have configured it incorrectly or source is not good. Can you explain where I can find error?
My config file:
soap_client:
namespaces:
'http://tempuri.org/': 'Soap/GeisClient'
destinations_php:
'Geis/Client': src/soap
destinations_jms:
'Geis/Client': src/soap/metadata
metadata:
'https://gclient.geis.cz/GService/GService.svc?singlewsdl': ~
Command which I run
vendor/goetas-webservices/soap-client/bin/soap-client generate \
soap_config.yml \
--dest-class=Soap/GeisClient \
src/soap
The result is this error:
In SchemaReader.php line 597:
Can't find type named {http://schemas.datacontract.org/2004/07/GService.Manager}#RequestOfServiceRequestHUsxwOXq, at line 1 in https://gclient.geis.cz/GService/GService.svc?singlewsdl
In Schema.php line 248:
Can't find the Type named {http://schemas.datacontract.org/2004/07/GService.Manager}#RequestOfServiceRequestHUsxwOXq.
Thanks
Is there a way to use the main symfony container with soap-client when invoking generate command ?
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.