i'm trying to make a soap call to a web service to pass shipping data. Here is the request i'm sending so far:
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://weblabeling.gls-italy.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
<env:Body>
<ns1:AddParcel env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<!-- bof shipping array --->
<XMLInfoParcel>
<Info>
<SedeGls>XXXX</SedeGls>
<CodiceClienteGls>XXXXX</CodiceClienteGls>
<PasswordClienteGls>XXXXXX</PasswordClienteGls>
<Parcel>
<CodiceContrattoGls>XXXXXX</CodiceContrattoGls>
<RagioneSociale>XXXXXX</RagioneSociale>
<!-- other stuff here -->
</Parcel>
</Info>
</XMLInfoParcel>
<!-- eof shipping array --->
</ns1:AddParcel>
</env:Body>
</env:Envelope>
this is instead what webservice is asking me
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<AddParcel xmlns="http://weblabeling.gls-italy.com/">
<XMLInfoParcel>string</XMLInfoParcel>
</AddParcel>
</soap12:Body>
</soap12:Envelope>
I always get as response xml format error.
What is wrong? Shipping array is correct and match perfectly the request one.
Thanks in advance.
Edited:
Here is how i build xml:
//inseriamo i dati nei corretti array
$Label = array(
'XMLInfoParcel' => array(
'Info' => array(
'SedeGls' => $SedeGls,
'CodiceClienteGls' => $CodiceClienteGls,
'PasswordClienteGls' => $PasswordClienteGls,
'Parcel' => array(
'CodiceContrattoGls' => $cod_cont,
'RagioneSociale' => $rag_soc,
'Indirizzo' => $delivery_indirizzo,
'Localita' => $delivery_city,
'Zipcode' => $data['delivery_postcode'],
'Provincia' => $data['zone_code'],
'Bda' => '',
'DataDocumentoTrasporto' => '',
'Colli' => '1',
'Incoterm' => '',
'PesoReale' => '1,00',
'ImportoContrassegno' => $imp_cont,
'NoteSpedizione' => $data['customers_telephone'],
'TipoPorto' => 'F',
'Assicurazione' => $ass_ins,
'PesoVolume' => '',
'TipoCollo' => $tipo_collo,
'FrancoAnticipata' => '',
'RiferimentoCliente' => '',
'NoteAggiuntive' => '',
'CodiceClienteDestinatario' => '',
'Email' => '',
'Cellulare1' => $telefono_1,
'Cellulare2' => '',
'ServiziAccessori' => '',
'ModalitaIncasso' => $mod_inc
),),),
);
$dom = new DOMDocumentExt('1.0', 'utf-8');
$chiamta = $dom->loadArray($Label);
$dudy = $dom->saveXML();
@Iserni i put ---> only here, this is not in my code, i'm going to Test the online tool, i really don't see errors.
I still get error of xml format, any other clue guys?
Edited:
I just noticed my request has:
<ns1:AddParcel env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
while the required is:
<AddParcel xmlns="http://weblabeling.gls-italy.com/">
So i noticed also in envelope there is something different with namespaces. Could it be the problem?
WSDL seems to not work on gls server, they did not provide any info in documentation about it.
Edited:
Maybe i'm dumb but this is the request xml schema:

So now shall i place more whitespace before ? What do you think? and if so how?
<XMLInfoParcel>element look good. If you add the code how you create the request, especially adding that one is useful for your question.