Reputation: 53
I'm building a SOAP client for sending information to a SOAP service defined with a WSDL. When posting data to the service in SoapUI, I'm able to omit the fields I don't have values for, but in PHP I'm getting a fatal error.
Is there a way to have SOAPClient in PHP omit fields? The object I'm passing to SOAPClient looks like this:
Kunde Object
(
[kundenr] => 1008911
[contact_id] => 10941
[kundenavn] =>
[organisasjonsnr] =>
[addresse] => Addresse Object
(
[postadresse1] =>
[postadresse2] =>
[postadresse3] =>
[postadresse] =>
[gateadresse1] =>
[gateadresse2] =>
[gateadresse3] =>
[gateadresse] =>
[county] =>
[kommunenr] =>
[stat] =>
[postnr] =>
[poststed] =>
[landkode] =>
[land] =>
[adresslayout] =>
)
[kontakt] => Kontakt Object
(
[tlfnr] =>
[tlfbeskrivelse] =>
[faxnr] =>
[faxbeskrivelse] =>
[mailadresse] =>
[webadresse] =>
)
[person] => Person Object
(
[customerId] =>
[personId] =>
[contact_id] =>
[fornavn] =>
[etternavn] =>
[brukernavn] =>
[epost] =>
[tlf] =>
[kundetype] => 40
[addresse] => Addresse Object
(
[postadresse1] =>
[postadresse2] =>
[postadresse3] =>
[postadresse] =>
[gateadresse1] =>
[gateadresse2] =>
[gateadresse3] =>
[gateadresse] =>
[county] =>
[kommunenr] =>
[stat] =>
[postnr] =>
[poststed] =>
[landkode] =>
[land] =>
[adresslayout] =>
)
)
[faultmsg] => Faultmsg Object
(
[Type] =>
[Melding] =>
[Detalj] =>
)
[avdeling] =>
[kundetype] => 40
[informasjon] =>
[aktiv] =>
[stopputsendelse] =>
[aco_kunde] =>
[uf_kunde] =>
[gan_kunde] =>
[kunde] => 10941
)
I would like to for instance omit the Kunde->kundenavn property from the object, but that gives me this fatal error:
[13-Aug-2012 07:01:50] PHP Fatal error: SOAP-ERROR: Encoding: object has no 'kundenavn' property in...
Upvotes: 2
Views: 240
Reputation: 3065
You may be suffering from PHP Bug #50997: SOAP Error when trying to submit 2nd Element of a choice
Or it may be required field in the WSDL so you're stuck with it either way most likely. Sorry!
Upvotes: 1