goetas-webservices / xsd2php

Convert XSD into PHP classes and JMS serializer definitions
MIT License
236 stars 90 forks source link

SOAP_HEADERS #65

Open victorgp89 opened 6 years ago

victorgp89 commented 6 years ago

Hi,

I've a question, When I receive a petition with soap wrap, the serializer extracts them correctly but when I generate a response like:

image

And serialize the response: $serializer = $model->getSerializer(); $xmlMessage = $serializer->serialize($response, 'xml');

It not add the soap wrap:

<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelResRS xmlns="http://www.opentravel.org/OTA/2003/05">
    <HotelReservations>
        <HotelReservation>
            <ResGlobalInfo>
                <HotelReservationIDs>
                    <HotelReservationID ResID_Type="502" ResID_Value="103502"/>
                    <HotelReservationID ResID_Type="501" ResID_Value="6423533777"/>
                </HotelReservationIDs>
            </ResGlobalInfo>
        </HotelReservation>
    </HotelReservations>
</OTA_HotelResRS>

It's possible to add this headers?

Many thanks for advance.

goetas commented 6 years ago

You should have a look to https://github.com/goetas-webservices/soap-client if you need to deal with soap

(but thats a different story :smiley: )

victorgp89 commented 6 years ago

But they only want to attach me with xml and I've to response with OTA with SoapEnvelope without having wsdl in between. What solutions could I get? Is for OTA_HotelResRS.

2018-06-19 10:10 GMT+02:00 Asmir Mustafic notifications@github.com:

You should have a look to https://github.com/goetas- webservices/soap-client if you need to deal with soap

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/goetas-webservices/xsd2php/issues/65#issuecomment-398313156, or mute the thread https://github.com/notifications/unsubscribe-auth/AIqbpJ92EEVIj65l3n3XOhtyY8KAfsTSks5t-LHkgaJpZM4UtB-V .

victorgp89 commented 6 years ago

For example with add some information manually in SoapContainer:

'HotelCheckInNotif' => array(
    'action' => 'http://www.opentravel.org/OTA/2003/05/HotelCheckInNotif',
    'style' => 'document',
    'version' => '1.1',
    'name' => 'HotelCheckInNotif',
    'method' => 'hotelCheckInNotif',
    'input' => array(
        'message_fqcn' =>
'Igm\\Synergy\\Definitions\\OTA\\SoapEnvelope\\Messages\\HotelCheckInNotifInput',
        'headers_fqcn' =>
'Igm\\Synergy\\Definitions\\OTA\\SoapEnvelope\\Headers\\HotelCheckInNotifInput',
        'part_fqcn' =>
'Igm\\Synergy\\Definitions\\OTA\\SoapParts\\HotelCheckInNotifInput',
        'parts' => array(
            'request' => 'OTAHotelResCheckInNotifRQ',
        ),
    ),
    'output' => array(
        'message_fqcn' =>
'Igm\\Synergy\\Definitions\\OTA\\SoapEnvelope\\Messages\\HotelCheckInNotifOutput',
        'headers_fqcn' =>
'Igm\\Synergy\\Definitions\\OTA\\SoapEnvelope\\Headers\\HotelCheckInNotifOutput',
        'part_fqcn' =>
'Igm\\Synergy\\Definitions\\OTA\\SoapParts\\HotelCheckInNotifOutput',
        'parts' => array(
            'hotelCheckInNotifResult' => 'OTAHotelResCheckInNotifRS',
        ),
    ),
    'fault' => array(

    ),

And add some fields in metadata?

2018-06-19 10:19 GMT+02:00 Victor Galvez Pages victorgp.18@gmail.com:

But they only want to attach me with xml and I've to response with OTA with SoapEnvelope without having wsdl in between. What solutions could I get? Is for OTA_HotelResRS.

2018-06-19 10:10 GMT+02:00 Asmir Mustafic notifications@github.com:

You should have a look to https://github.com/goetas-webs ervices/soap-client if you need to deal with soap

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/goetas-webservices/xsd2php/issues/65#issuecomment-398313156, or mute the thread https://github.com/notifications/unsubscribe-auth/AIqbpJ92EEVIj65l3n3XOhtyY8KAfsTSks5t-LHkgaJpZM4UtB-V .

goetas commented 6 years ago

Maybe just manually wrapping the XML into a soap envelope...? it is not elegant but might work...

victorgp89 commented 6 years ago

And which one would you recommend?

2018-06-19 10:34 GMT+02:00 Asmir Mustafic notifications@github.com:

Maybe just manually wrapping the XML into a soap envelope...? it is not elegant but might work...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/goetas-webservices/xsd2php/issues/65#issuecomment-398320088, or mute the thread https://github.com/notifications/unsubscribe-auth/AIqbpE26D7QAP0PdbASWA4rx9LedjKDzks5t-LeogaJpZM4UtB-V .

goetas commented 6 years ago

something as:


$xmlMessage = $serializer->serialize($response, 'xml');

echo '<soap....>' . $xmlMessage .'</soap....>';