soap-client
soap-client copied to clipboard
SOAP ENVELOPE 1.2
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">
it depends on your soap implementation. Soap versions are not just namespace changes, there are many other underlying differences. here you can find an overview.
Actually the client supports both and the ose of one vs the other is defined by your wsdl schema
And it's posible to change the version in my implementation of your soap client?
The remot wsdl has this headboard:
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.opentravel.org/OTA/2003/05" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.opentravel.org/OTA/2003/05">
apparently your server also supports both. you should have also two "ports" section where you can choose which one to use
Yes, sorry for the incovenients but yes, they jave two "ports" sections.
<wsdl:binding name="OTAReceiveServiceSoap" type="tns:OTAReceiveServiceSoap">...</wsdl:binding> <wsdl:binding name="OTAReceiveServiceSoap12" type="tns:OTAReceiveServiceSoap">...</wsdl:binding>
In client Factory try this: $service = $this->getSoapService($wsdl, 'OTAReceiveServiceSoap12', 'OTAReceiveService');
But the message is still not correct in the construction
<SOAP:Envelope xmlns:SOAP="http://www.w3.org/2003/05/soap-envelope"> SOAP:Body <ns-77e106cb:OTA_HotelRatePlanRQ xmlns:ns-77e106cb="http://www.opentravel.org/OTA/2003/05" Version="0"> ns-77e106cb:POS ns-77e106cb:Source <ns-77e106cb:RequestorID ID="IGM" Type="1" MessagePassword="IGM123"> <ns-77e106cb:CompanyName Code="C" CodeContext="556"/> </ns-77e106cb:RequestorID> </ns-77e106cb:Source> </ns-77e106cb:POS> ns-77e106cb:RatePlans ns-77e106cb:RatePlan <ns-77e106cb:DateRange Start="2017-11-22" End="2017-11-22"/> ns-77e106cb:RatePlanCandidates <ns-77e106cb:RatePlanCandidate AvailRatesOnlyInd="true"> ns-77e106cb:HotelRefs <ns-77e106cb:HotelRef HotelCode="54394"/> </ns-77e106cb:HotelRefs> </ns-77e106cb:RatePlanCandidate> </ns-77e106cb:RatePlanCandidates> </ns-77e106cb:RatePlan> </ns-77e106cb:RatePlans> </ns-77e106cb:OTA_HotelRatePlanRQ> </SOAP:Body> </SOAP:Envelope>
Hmmm.. can you share your config.yml ?
soap_client: ~
xsd2php:
namespaces:
'http://www.opentravel.org/OTA/2003/05': 'Igm\Synergy\Models\OTA'
destinations_php:
'Igm\Synergy\Models\OTA': src/Models/OTA
destinations_jms:
'Igm\Synergy\Models\OTA': metadata/OTA
wsdl2php:
metadata:
'http://vendor-ctrip.fws.ctripqa.com/Hotel/OTAReceive/OTAReceiveService.asmx?wsdl': ~
Unfortunately looking at the code, the 1.2 support is not complete and there are many configuration mappings that are not complete. Apparently is required a lot of work to solve it :cry:
Re opeing it
All this https://github.com/goetas-webservices/soap-client/compare/v0.1.3...master commits are unreleased
OK, so I understand that doing these commits will not solve the problem, will it?
If not, I could try to help you.
the commits add the 1.2 support but is not configured properly. Is necessary to play a lot with this and this in order to configure and run it correctly.
Ok, I will try to I'm going to try to keep an eye on him. I would like to be able to fix it because I have implemented your soapclient in our company for communication with different hoteliers
I have implemented your soapclient in our company for communication with different hoteliers
initially this lib was build exactly for OTA :smile:
Any suggestions for which section to start looking at in order to resolve the conflict?
But would it be necessary to modify the wsdlReader true?
from what I can see should be good as it is
The 'path_generator' in SoapClientExtension is new argument in config.yml. The 'problem' must be in the creation of the envelopes of the metadata, right? It is a bit complex to understand the root of the problem in the construction of headers. Again, I'm sorry for the inconvenience. But it's a project that interests me a lot.
I changed the version of your library wsdl2php:
"require-dev": { "goetas-webservices/wsdl2php": "^0.3" },
I generated the metadata and clases again. And it seems that now the xml is generate correctly:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> SOAP:Body <ns-77e106cb:OTA_HotelRatePlanRQ xmlns:ns-77e106cb="http://www.opentravel.org/OTA/2003/05" Version="0"> ns-77e106cb:POS ns-77e106cb:Source <ns-77e106cb:RequestorID ID="IGM" Type="1" MessagePassword="IGM123"> <ns-77e106cb:CompanyName Code="C" CodeContext="556"/> </ns-77e106cb:RequestorID> </ns-77e106cb:Source> </ns-77e106cb:POS> ns-77e106cb:RatePlans ns-77e106cb:RatePlan <ns-77e106cb:DateRange Start="2017-11-24" End="2017-11-24"/> ns-77e106cb:RatePlanCandidates <ns-77e106cb:RatePlanCandidate AvailRatesOnlyInd="true"> ns-77e106cb:HotelRefs <ns-77e106cb:HotelRef HotelCode="54394"/> </ns-77e106cb:HotelRefs> </ns-77e106cb:RatePlanCandidate> </ns-77e106cb:RatePlanCandidates> </ns-77e106cb:RatePlan> </ns-77e106cb:RatePlans> </ns-77e106cb:OTA_HotelRatePlanRQ> </SOAP:Body> </SOAP:Envelope>
nice to hear that it worked