soap-client icon indicating copy to clipboard operation
soap-client copied to clipboard

SOAP ENVELOPE 1.2

Open victorgp89 opened this issue 7 years ago • 20 comments

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">

victorgp89 avatar Nov 22 '17 14:11 victorgp89

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

goetas avatar Nov 22 '17 14:11 goetas

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">

victorgp89 avatar Nov 22 '17 14:11 victorgp89

apparently your server also supports both. you should have also two "ports" section where you can choose which one to use

goetas avatar Nov 22 '17 14:11 goetas

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>

victorgp89 avatar Nov 22 '17 15:11 victorgp89

Hmmm.. can you share your config.yml ?

goetas avatar Nov 22 '17 16:11 goetas

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': ~

victorgp89 avatar Nov 22 '17 16:11 victorgp89

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:

goetas avatar Nov 22 '17 16:11 goetas

Re opeing it

goetas avatar Nov 22 '17 16:11 goetas

All this https://github.com/goetas-webservices/soap-client/compare/v0.1.3...master commits are unreleased

goetas avatar Nov 22 '17 16:11 goetas

OK, so I understand that doing these commits will not solve the problem, will it?

If not, I could try to help you.

victorgp89 avatar Nov 22 '17 16:11 victorgp89

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.

goetas avatar Nov 22 '17 16:11 goetas

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

victorgp89 avatar Nov 22 '17 17:11 victorgp89

I have implemented your soapclient in our company for communication with different hoteliers

initially this lib was build exactly for OTA :smile:

goetas avatar Nov 22 '17 17:11 goetas

Any suggestions for which section to start looking at in order to resolve the conflict?

victorgp89 avatar Nov 23 '17 08:11 victorgp89

Is necessary to play a lot with this and this in order to configure and run it correctly.

goetas avatar Nov 23 '17 08:11 goetas

But would it be necessary to modify the wsdlReader true?

victorgp89 avatar Nov 23 '17 15:11 victorgp89

from what I can see should be good as it is

goetas avatar Nov 23 '17 15:11 goetas

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.

victorgp89 avatar Nov 23 '17 16:11 victorgp89

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>

victorgp89 avatar Nov 24 '17 15:11 victorgp89

nice to hear that it worked

goetas avatar Nov 27 '17 11:11 goetas