IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

SoapClient : erreur lors de l'appel d'une fonction


Sujet :

Langage PHP

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2004
    Messages
    77
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Juin 2004
    Messages : 77
    Points : 68
    Points
    68
    Par défaut SoapClient : erreur lors de l'appel d'une fonction
    Bonjour,

    Je tente d'appeler une fonction à partir d'un webservice. Je pense appeler correctement la fonction mais voici ce qu'elle me retourne :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    <br />
    <b>Fatal error</b>:  Uncaught SoapFault exception: [HTTP] Bad Request in /mnt/sda5/wwwroot/myfile.php:40
    Stack trace:
    #0 [internal function]: SoapClient-&gt;__doRequest('&lt;?xml version=&quot;...', 'http://62.105.9...', 'http://Holidayb...', 2, 0)
    #1 [internal function]: SoapClient-&gt;__call('AvailabilitySea...', Array)
    #2 /mnt/sda5/wwwroot/myfile.php(40): SoapClient-&gt;AvailabilitySearch(Array)
    #3 {main}
      thrown in <b>/mnt/sda5/wwwroot/myfile.php</b> on line <b>40</b><br />
    voici mon code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
     
    $wsdl = "http://62.105.........";      
    $client = new SoapClient($wsdl, array("trace"=>true,'soap_version'=> SOAP_1_2));
     
    $xml = '<?xml version="1.0" encoding="utf-8" ?>
    <HB_AvailabilitySearch>
          <Control lang="en">
                <Brand>EC</Brand>
                <Country>FR</Country>
                <SessionId/>
                <AffiliateId>XXXXX</AffiliateId>
          </Control>
          <CampsiteQuery siteCode="MC013">
                <ArrivalDate>2010-05-01</ArrivalDate>
                <Duration durationType="Nights">4</Duration>
                <NumberOfAdults>2</NumberOfAdults>
                <NumberOfChildren>0</NumberOfChildren>
                <NumberOfInfants>0</NumberOfInfants>
          </CampsiteQuery>
    </HB_AvailabilitySearch>';
    $soapvar = new SoapVar($xml, XSD_ANYXML);
     
    $reponse = $client->AvailabilitySearch(array("docRQ"=>$soapvar));
    voici ce que retourne getLastRequest :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
     
    ?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://Holidaybreak.com/"><env:Body><ns1:AvailabilitySearch><ns1:docRQ>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
    &lt;HB_AvailabilitySearch&gt;
          &lt;Control lang="en"&gt;
                &lt;Brand&gt;EC&lt;/Brand&gt;
                &lt;Country&gt;FR&lt;/Country&gt;
     
                &lt;SessionId/&gt;
                &lt;AffiliateId&gt;OCTEC&lt;/AffiliateId&gt;
          &lt;/Control&gt;
          &lt;CampsiteQuery siteCode="MC013"&gt;
                &lt;ArrivalDate&gt;2010-05-01&lt;/ArrivalDate&gt;
     
                &lt;Duration durationType="Nights"&gt;4&lt;/Duration&gt;
                &lt;NumberOfAdults&gt;2&lt;/NumberOfAdults&gt;
                &lt;NumberOfChildren&gt;0&lt;/NumberOfChildren&gt;
                &lt;NumberOfInfants&gt;0&lt;/NumberOfInfants&gt;
     
          &lt;/CampsiteQuery&gt;
    &lt;/HB_AvailabilitySearch&gt;</ns1:docRQ></ns1:AvailabilitySearch></env:Body></env:Envelope>

    et getlastresponse :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Sender</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to read request. ---&gt; There is an error in XML document (17, 45). ---&gt; The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>
    Merci pour votre aide

  2. #2
    Membre éclairé

    Profil pro
    Inscrit en
    Juin 2004
    Messages
    772
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Juin 2004
    Messages : 772
    Points : 872
    Points
    872
    Par défaut
    Si tu utilises Soap, il faut envoyer un objet au lieu du code XML brut...

    Tu peux montrer la WSDL ?
    • Mon blog PHP : http://blog.alterphp.com
    • "Peace cannot be kept by force, it can only be achieved by Understanding" -- Albert Einstein

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2004
    Messages
    77
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Juin 2004
    Messages : 77
    Points : 68
    Points
    68
    Par défaut
    Je te l'ai envoyé en MP.

    Mon partenaire ne m'a donner qu'un XML.
    Et ce qui m'etonne c'est le XML avec l'enveloppe est bon?

  4. #4
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2004
    Messages
    77
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Juin 2004
    Messages : 77
    Points : 68
    Points
    68
    Par défaut wsdl
    voici le wsdl :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
     
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions 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:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://Holidaybreak.com/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://Holidaybreak.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://Holidaybreak.com/">
          <s:element name="AvailabilitySearch">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="docRQ">
                  <s:complexType mixed="true">
                    <s:sequence>
     
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="AvailabilitySearchResponse">
            <s:complexType>
     
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="AvailabilitySearchResult">
                  <s:complexType mixed="true">
                    <s:sequence>
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
     
            </s:complexType>
          </s:element>
          <s:element name="SiteExtras">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="docRQ">
                  <s:complexType mixed="true">
                    <s:sequence>
                      <s:any />
     
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="SiteExtrasResponse">
            <s:complexType>
              <s:sequence>
     
                <s:element minOccurs="0" maxOccurs="1" name="SiteExtrasResult">
                  <s:complexType mixed="true">
                    <s:sequence>
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
            </s:complexType>
     
          </s:element>
          <s:element name="ReserveBooking">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="docRQ">
                  <s:complexType mixed="true">
                    <s:sequence>
                      <s:any />
                    </s:sequence>
     
                  </s:complexType>
                </s:element>
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="ReserveBookingResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="ReserveBookingResult">
     
                  <s:complexType mixed="true">
                    <s:sequence>
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
            </s:complexType>
          </s:element>
     
          <s:element name="CheckPrice">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="docRQ">
                  <s:complexType mixed="true">
                    <s:sequence>
                      <s:any />
                    </s:sequence>
                  </s:complexType>
     
                </s:element>
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="CheckPriceResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="CheckPriceResult">
                  <s:complexType mixed="true">
     
                    <s:sequence>
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="UpdateBooking">
     
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="docRQ">
                  <s:complexType mixed="true">
                    <s:sequence>
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
     
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="UpdateBookingResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="UpdateBookingResult">
                  <s:complexType mixed="true">
                    <s:sequence>
     
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="ConfirmBooking">
            <s:complexType>
     
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="docRQ">
                  <s:complexType mixed="true">
                    <s:sequence>
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
     
            </s:complexType>
          </s:element>
          <s:element name="ConfirmBookingResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="ConfirmBookingResult">
                  <s:complexType mixed="true">
                    <s:sequence>
                      <s:any />
     
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="BookingDetails">
            <s:complexType>
              <s:sequence>
     
                <s:element minOccurs="0" maxOccurs="1" name="docRQ">
                  <s:complexType mixed="true">
                    <s:sequence>
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
            </s:complexType>
     
          </s:element>
          <s:element name="BookingDetailsResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="BookingDetailsResult">
                  <s:complexType mixed="true">
                    <s:sequence>
                      <s:any />
                    </s:sequence>
     
                  </s:complexType>
                </s:element>
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="CreateGroupRegionList">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="admin" type="s:string" />
     
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="CreateGroupRegionListResponse">
            <s:complexType />
          </s:element>
        </s:schema>
      </wsdl:types>
      <wsdl:message name="AvailabilitySearchSoapIn">
     
        <wsdl:part name="parameters" element="tns:AvailabilitySearch" />
      </wsdl:message>
      <wsdl:message name="AvailabilitySearchSoapOut">
        <wsdl:part name="parameters" element="tns:AvailabilitySearchResponse" />
      </wsdl:message>
      <wsdl:message name="SiteExtrasSoapIn">
        <wsdl:part name="parameters" element="tns:SiteExtras" />
      </wsdl:message>
      <wsdl:message name="SiteExtrasSoapOut">
     
        <wsdl:part name="parameters" element="tns:SiteExtrasResponse" />
      </wsdl:message>
      <wsdl:message name="ReserveBookingSoapIn">
        <wsdl:part name="parameters" element="tns:ReserveBooking" />
      </wsdl:message>
      <wsdl:message name="ReserveBookingSoapOut">
        <wsdl:part name="parameters" element="tns:ReserveBookingResponse" />
      </wsdl:message>
      <wsdl:message name="CheckPriceSoapIn">
     
        <wsdl:part name="parameters" element="tns:CheckPrice" />
      </wsdl:message>
      <wsdl:message name="CheckPriceSoapOut">
        <wsdl:part name="parameters" element="tns:CheckPriceResponse" />
      </wsdl:message>
      <wsdl:message name="UpdateBookingSoapIn">
        <wsdl:part name="parameters" element="tns:UpdateBooking" />
      </wsdl:message>
      <wsdl:message name="UpdateBookingSoapOut">
     
        <wsdl:part name="parameters" element="tns:UpdateBookingResponse" />
      </wsdl:message>
      <wsdl:message name="ConfirmBookingSoapIn">
        <wsdl:part name="parameters" element="tns:ConfirmBooking" />
      </wsdl:message>
      <wsdl:message name="ConfirmBookingSoapOut">
        <wsdl:part name="parameters" element="tns:ConfirmBookingResponse" />
      </wsdl:message>
      <wsdl:message name="BookingDetailsSoapIn">
     
        <wsdl:part name="parameters" element="tns:BookingDetails" />
      </wsdl:message>
      <wsdl:message name="BookingDetailsSoapOut">
        <wsdl:part name="parameters" element="tns:BookingDetailsResponse" />
      </wsdl:message>
      <wsdl:message name="CreateGroupRegionListSoapIn">
        <wsdl:part name="parameters" element="tns:CreateGroupRegionList" />
      </wsdl:message>
      <wsdl:message name="CreateGroupRegionListSoapOut">
     
        <wsdl:part name="parameters" element="tns:CreateGroupRegionListResponse" />
      </wsdl:message>
      <wsdl:portType name="PublicServiceSoap">
        <wsdl:operation name="AvailabilitySearch">
          <wsdl:input message="tns:AvailabilitySearchSoapIn" />
          <wsdl:output message="tns:AvailabilitySearchSoapOut" />
        </wsdl:operation>
        <wsdl:operation name="SiteExtras">
          <wsdl:input message="tns:SiteExtrasSoapIn" />
     
          <wsdl:output message="tns:SiteExtrasSoapOut" />
        </wsdl:operation>
        <wsdl:operation name="ReserveBooking">
          <wsdl:input message="tns:ReserveBookingSoapIn" />
          <wsdl:output message="tns:ReserveBookingSoapOut" />
        </wsdl:operation>
        <wsdl:operation name="CheckPrice">
          <wsdl:input message="tns:CheckPriceSoapIn" />
          <wsdl:output message="tns:CheckPriceSoapOut" />
     
        </wsdl:operation>
        <wsdl:operation name="UpdateBooking">
          <wsdl:input message="tns:UpdateBookingSoapIn" />
          <wsdl:output message="tns:UpdateBookingSoapOut" />
        </wsdl:operation>
        <wsdl:operation name="ConfirmBooking">
          <wsdl:input message="tns:ConfirmBookingSoapIn" />
          <wsdl:output message="tns:ConfirmBookingSoapOut" />
        </wsdl:operation>
     
        <wsdl:operation name="BookingDetails">
          <wsdl:input message="tns:BookingDetailsSoapIn" />
          <wsdl:output message="tns:BookingDetailsSoapOut" />
        </wsdl:operation>
        <wsdl:operation name="CreateGroupRegionList">
          <wsdl:input message="tns:CreateGroupRegionListSoapIn" />
          <wsdl:output message="tns:CreateGroupRegionListSoapOut" />
        </wsdl:operation>
      </wsdl:portType>
     
      <wsdl:binding name="PublicServiceSoap" type="tns:PublicServiceSoap">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="AvailabilitySearch">
          <soap:operation soapAction="http://Holidaybreak.com/AvailabilitySearch" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
     
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="SiteExtras">
          <soap:operation soapAction="http://Holidaybreak.com/SiteExtras" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
     
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="ReserveBooking">
          <soap:operation soapAction="http://Holidaybreak.com/ReserveBooking" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
     
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="CheckPrice">
          <soap:operation soapAction="http://Holidaybreak.com/CheckPrice" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
     
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="UpdateBooking">
          <soap:operation soapAction="http://Holidaybreak.com/UpdateBooking" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
     
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="ConfirmBooking">
          <soap:operation soapAction="http://Holidaybreak.com/ConfirmBooking" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
     
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="BookingDetails">
          <soap:operation soapAction="http://Holidaybreak.com/BookingDetails" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
     
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="CreateGroupRegionList">
          <soap:operation soapAction="http://Holidaybreak.com/CreateGroupRegionList" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
     
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:binding name="PublicServiceSoap12" type="tns:PublicServiceSoap">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="AvailabilitySearch">
          <soap12:operation soapAction="http://Holidaybreak.com/AvailabilitySearch" style="document" />
          <wsdl:input>
            <soap12:body use="literal" />
     
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="SiteExtras">
          <soap12:operation soapAction="http://Holidaybreak.com/SiteExtras" style="document" />
          <wsdl:input>
            <soap12:body use="literal" />
     
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="ReserveBooking">
          <soap12:operation soapAction="http://Holidaybreak.com/ReserveBooking" style="document" />
          <wsdl:input>
            <soap12:body use="literal" />
     
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="CheckPrice">
          <soap12:operation soapAction="http://Holidaybreak.com/CheckPrice" style="document" />
          <wsdl:input>
            <soap12:body use="literal" />
     
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="UpdateBooking">
          <soap12:operation soapAction="http://Holidaybreak.com/UpdateBooking" style="document" />
          <wsdl:input>
            <soap12:body use="literal" />
     
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="ConfirmBooking">
          <soap12:operation soapAction="http://Holidaybreak.com/ConfirmBooking" style="document" />
          <wsdl:input>
            <soap12:body use="literal" />
     
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="BookingDetails">
          <soap12:operation soapAction="http://Holidaybreak.com/BookingDetails" style="document" />
          <wsdl:input>
            <soap12:body use="literal" />
     
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="CreateGroupRegionList">
          <soap12:operation soapAction="http://Holidaybreak.com/CreateGroupRegionList" style="document" />
          <wsdl:input>
            <soap12:body use="literal" />
     
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="PublicService">
        <wsdl:port name="PublicServiceSoap" binding="tns:PublicServiceSoap">
          <soap:address location="http://62.105.93.13/XMLResLive/PublicService.asmx" />
     
        </wsdl:port>
        <wsdl:port name="PublicServiceSoap12" binding="tns:PublicServiceSoap12">
          <soap12:address location="http://62.105.93.13/XMLResLive/PublicService.asmx" />
        </wsdl:port>
      </wsdl:service>
    </wsdl:definitions>

  5. #5
    Membre éclairé

    Profil pro
    Inscrit en
    Juin 2004
    Messages
    772
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Juin 2004
    Messages : 772
    Points : 872
    Points
    872
    Par défaut
    Il faudrait que je sache ce que fait le service et ce qu'il prend vraiment en paramètre. J'ai l'impression que la fonction côté serveur attend un message XML.

    Pour AvailabilitySearch, tu peux essayer :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $response->docRQ->test= '<! [CDATA['.$xml.']]>';
    A mon avis, le problème vient de l'échappement de caractères spéciaux, comme < et > ...
    • Mon blog PHP : http://blog.alterphp.com
    • "Peace cannot be kept by force, it can only be achieved by Understanding" -- Albert Einstein

  6. #6
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2004
    Messages
    77
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Juin 2004
    Messages : 77
    Points : 68
    Points
    68
    Par défaut
    Je vais essayer cela de suite.

    Merci

  7. #7
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2004
    Messages
    77
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Juin 2004
    Messages : 77
    Points : 68
    Points
    68
    Par défaut
    J'ai mis le cdata autour de mon xml mais je ne suis pas sur que c'est bien ce que tu as voulu dire.

  8. #8
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2004
    Messages
    77
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Juin 2004
    Messages : 77
    Points : 68
    Points
    68
    Par défaut
    pour repondre a ta premiere question, j'ai aussi ca :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
     
    POST /XMLResDev/PublicService.asmx HTTP/1.1
    Host: 62.....
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://Holidaybreak.com/AvailabilitySearch"
     
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <AvailabilitySearch xmlns="http://Holidaybreak.com/">
          <docRQ>xml</docRQ>
        </AvailabilitySearch>
      </soap:Body>
    </soap:Envelope>
     
    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
     
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <AvailabilitySearchResponse xmlns="http://Holidaybreak.com/">
          <AvailabilitySearchResult>xml</AvailabilitySearchResult>
        </AvailabilitySearchResponse>
      </soap:Body>
    </soap:Envelope>
    et ca comme xml d'exemple fournis :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    <?xml version="1.0" encoding="utf-8"?>
    <HB_AvailabilitySearch>
      <Control lang="en">
        <Brand>KC</Brand>
        <Country>GB</Country>
        <SessionId>
        </SessionId>
        <AffiliateId>CLIENT_ID</AffiliateId>
      </Control>
      <CampsiteQuery siteCode="BS021">
        <ArrivalDate>2009-05-10</ArrivalDate>
        <Duration durationType="Nights">7</Duration>
        <NumberOfAdults>2</NumberOfAdults>
        <NumberOfChildren>2</NumberOfChildren>
        <NumberOfInfants>0</NumberOfInfants>
      </CampsiteQuery>
    </HB_AvailabilitySearch>

  9. #9
    Membre éclairé

    Profil pro
    Inscrit en
    Juin 2004
    Messages
    772
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Juin 2004
    Messages : 772
    Points : 872
    Points
    872
    Par défaut
    Si c'est bien ça.

    Mais si tu avais le code côté serveur de la fonction qui gère AvailabilitySearch ce serait plus simple de savoir exactement ce que ta fonction attend...
    • Mon blog PHP : http://blog.alterphp.com
    • "Peace cannot be kept by force, it can only be achieved by Understanding" -- Albert Einstein

  10. #10
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2004
    Messages
    77
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Juin 2004
    Messages : 77
    Points : 68
    Points
    68
    Par défaut
    Ben non c'est ca le problème, c'est un webservice chez un partenaire et je n'ai accés à rien. Et ils me répondent que cela vient de mon client soap qui doit mal appeler la fonction.

  11. #11
    Membre éclairé

    Profil pro
    Inscrit en
    Juin 2004
    Messages
    772
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Juin 2004
    Messages : 772
    Points : 872
    Points
    872
    Par défaut
    Euhh... le xml que j'ai mis en gras, il faut le remplacer par ton message XML c'est bien ça ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    POST /XMLResDev/PublicService.asmx HTTP/1.1
    Host: 62.....
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://Holidaybreak.com/AvailabilitySearch"
     
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <AvailabilitySearch xmlns="http://Holidaybreak.com/">
          <docRQ>xml</docRQ>
        </AvailabilitySearch>
      </soap:Body>
    </soap:Envelope>
     
    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
     
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <AvailabilitySearchResponse xmlns="http://Holidaybreak.com/">
          <AvailabilitySearchResult>xml</AvailabilitySearchResult>
        </AvailabilitySearchResponse>
      </soap:Body>
    </soap:Envelope>
    Et sinon il fait quoi le webservice ? Ce qu'on lui envoie c'est quoi et qu'est-ce qu'on en attend en retour ?
    • Mon blog PHP : http://blog.alterphp.com
    • "Peace cannot be kept by force, it can only be achieved by Understanding" -- Albert Einstein

  12. #12
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2004
    Messages
    77
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Juin 2004
    Messages : 77
    Points : 68
    Points
    68
    Par défaut
    Oui je pense qu'il faut remplacer xml par le xml "HB_AvailabilitySearch"

    et il doit renvoyer un xml avec un tas d'info selectionnée a partir des valeur dans "HB_AvailabilitySearch"

  13. #13
    Membre éclairé

    Profil pro
    Inscrit en
    Juin 2004
    Messages
    772
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Juin 2004
    Messages : 772
    Points : 872
    Points
    872
    Par défaut
    On a du mal se comprendre...

    Montre ton code côté client STP
    • Mon blog PHP : http://blog.alterphp.com
    • "Peace cannot be kept by force, it can only be achieved by Understanding" -- Albert Einstein

  14. #14
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2004
    Messages
    77
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Juin 2004
    Messages : 77
    Points : 68
    Points
    68
    Par défaut
    le code dans mon premier message :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    $wsdl = "http://62.105.........";      
    $client = new SoapClient($wsdl, array("trace"=>true,'soap_version'=> SOAP_1_2));
     
    $xml = '<?xml version="1.0" encoding="utf-8" ?>
    <HB_AvailabilitySearch>
          <Control lang="en">
                <Brand>EC</Brand>
                <Country>FR</Country>
                <SessionId/>
                <AffiliateId>XXXXX</AffiliateId>
          </Control>
          <CampsiteQuery siteCode="MC013">
                <ArrivalDate>2010-05-01</ArrivalDate>
                <Duration durationType="Nights">4</Duration>
                <NumberOfAdults>2</NumberOfAdults>
                <NumberOfChildren>0</NumberOfChildren>
                <NumberOfInfants>0</NumberOfInfants>
          </CampsiteQuery>
    </HB_AvailabilitySearch>';
    $soapvar = new SoapVar($xml, XSD_ANYXML);
     
    $reponse = $client->AvailabilitySearch(array("docRQ"=>$soapvar));

  15. #15
    Membre éclairé

    Profil pro
    Inscrit en
    Juin 2004
    Messages
    772
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Juin 2004
    Messages : 772
    Points : 872
    Points
    872
    Par défaut
    Et comme ça ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    $wsdl = "http://62.105.........";      
    $client = new SoapClient($wsdl, array("trace"=>true,'soap_version'=> SOAP_1_2));
     
    $xml = '<?xml version="1.0" encoding="utf-8" ?>
    <HB_AvailabilitySearch>
          <Control lang="en">
                <Brand>EC</Brand>
                <Country>FR</Country>
                <SessionId/>
                <AffiliateId>XXXXX</AffiliateId>
          </Control>
          <CampsiteQuery siteCode="MC013">
                <ArrivalDate>2010-05-01</ArrivalDate>
                <Duration durationType="Nights">4</Duration>
                <NumberOfAdults>2</NumberOfAdults>
                <NumberOfChildren>0</NumberOfChildren>
                <NumberOfInfants>0</NumberOfInfants>
          </CampsiteQuery>
    </HB_AvailabilitySearch>';
     
    //$soapvar = new SoapVar($xml, XSD_ANYXML);
     
    $xmlSearch->docRQ->search1 = '<! [CDATA[' . $xml . ']]>';
     
    $reponse = $client->AvailabilitySearch($xmlSearch);
    • Mon blog PHP : http://blog.alterphp.com
    • "Peace cannot be kept by force, it can only be achieved by Understanding" -- Albert Einstein

  16. #16
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2004
    Messages
    77
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Juin 2004
    Messages : 77
    Points : 68
    Points
    68
    Par défaut
    J'ai ca comme erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Fatal error: Uncaught SoapFault exception: [Sender] SOAP-ERROR: Encoding: object hasn't 'any' property

  17. #17
    Membre éclairé

    Profil pro
    Inscrit en
    Juin 2004
    Messages
    772
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Juin 2004
    Messages : 772
    Points : 872
    Points
    872
    Par défaut
    J'essaierais ça

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    $wsdl = "http://62.105.........";      
    $client = new SoapClient($wsdl, array("trace"=>true,'soap_version'=> SOAP_1_2));
     
    $xml = '<?xml version="1.0" encoding="utf-8" ?>
    <HB_AvailabilitySearch>
          <Control lang="en">
                <Brand>EC</Brand>
                <Country>FR</Country>
                <SessionId/>
                <AffiliateId>XXXXX</AffiliateId>
          </Control>
          <CampsiteQuery siteCode="MC013">
                <ArrivalDate>2010-05-01</ArrivalDate>
                <Duration durationType="Nights">4</Duration>
                <NumberOfAdults>2</NumberOfAdults>
                <NumberOfChildren>0</NumberOfChildren>
                <NumberOfInfants>0</NumberOfInfants>
          </CampsiteQuery>
    </HB_AvailabilitySearch>';
     
    //$soapvar = new SoapVar($xml, XSD_ANYXML);
     
    $xmlSearch->docRQ->search1 = new SoapVar('<! [CDATA[' . $xml . ']]>', XSD_ANYXML);
     
    $reponse = $client->AvailabilitySearch($xmlSearch);
    ou

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    $wsdl = "http://62.105.........";      
    $client = new SoapClient($wsdl, array("trace"=>true,'soap_version'=> SOAP_1_2));
     
    $xml = '<?xml version="1.0" encoding="utf-8" ?>
    <HB_AvailabilitySearch>
          <Control lang="en">
                <Brand>EC</Brand>
                <Country>FR</Country>
                <SessionId/>
                <AffiliateId>XXXXX</AffiliateId>
          </Control>
          <CampsiteQuery siteCode="MC013">
                <ArrivalDate>2010-05-01</ArrivalDate>
                <Duration durationType="Nights">4</Duration>
                <NumberOfAdults>2</NumberOfAdults>
                <NumberOfChildren>0</NumberOfChildren>
                <NumberOfInfants>0</NumberOfInfants>
          </CampsiteQuery>
    </HB_AvailabilitySearch>';
     
    //$soapvar = new SoapVar($xml, XSD_ANYXML);
     
    $xmlSearch->docRQ->any = '<! [CDATA[' . $xml . ']]>';
     
    $reponse = $client->AvailabilitySearch($xmlSearch);
    • Mon blog PHP : http://blog.alterphp.com
    • "Peace cannot be kept by force, it can only be achieved by Understanding" -- Albert Einstein

  18. #18
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2004
    Messages
    77
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Juin 2004
    Messages : 77
    Points : 68
    Points
    68
    Par défaut
    J'ai trouvé la solution :

    J'ai écris ce code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
     
    $xml = '<ns1:AvailabilitySearch><ns1:docRQ>
    <HB_AvailabilitySearch>
          <Control lang="en">
                <Brand>EC</Brand>
                <Country>FR</Country>
                <SessionId/>
                <AffiliateId>OCTEC</AffiliateId>
          </Control>
          <CampsiteQuery siteCode="MC013">
                <ArrivalDate>2010-05-01</ArrivalDate>
                <Duration durationType="Nights">4</Duration>
                <NumberOfAdults>2</NumberOfAdults>
                <NumberOfChildren>0</NumberOfChildren>
                <NumberOfInfants>0</NumberOfInfants>
          </CampsiteQuery>
    </HB_AvailabilitySearch>
    </ns1:docRQ></ns1:AvailabilitySearch>';
     
    $soapvar = new SoapVar($xml, XSD_ANYXML);
     
    $reponse = $client->AvailabilitySearch($soapvar);
    Bizarrement, il faut ecrire la balise du nom de la fonction (AvailabilitySearch) avec le type XSD_ANYXML alors qu'avec XSD_STRING il n'y a pas besoin

  19. #19
    Membre éclairé

    Profil pro
    Inscrit en
    Juin 2004
    Messages
    772
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Juin 2004
    Messages : 772
    Points : 872
    Points
    872
    Par défaut
    Bon à savoir !

    C'est la première fois que je rencontrais des types xsd:any
    • Mon blog PHP : http://blog.alterphp.com
    • "Peace cannot be kept by force, it can only be achieved by Understanding" -- Albert Einstein

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [XL-2010] Erreur lors de l'appel d'une fonction VBA à partir d'Excel
    Par Romain92 dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 24/09/2014, 11h21
  2. [forward] Erreur lors de l'appel d'une méthode
    Par GLDavid dans le forum Servlets/JSP
    Réponses: 2
    Dernier message: 03/07/2007, 17h10
  3. Erreur lors de l'appel d'une fonction
    Par larimoise dans le forum MATLAB
    Réponses: 6
    Dernier message: 21/04/2007, 11h02
  4. Erreur lors de l'appel d'une page executée avec AJAX
    Par jt-tronix dans le forum Langage
    Réponses: 3
    Dernier message: 08/11/2006, 17h56
  5. Erreur lors de l'appel d'une DLL créée avec Visual
    Par WELCOMSMAIL dans le forum C++Builder
    Réponses: 6
    Dernier message: 06/09/2006, 15h53

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo