tags:

views:

52

answers:

0

Hey all!

I'm having trouble sending a custom object thats defined as a datacontract in my WCF web service from PHP. I'm attempting to accomplish this via SOAP.

Here is what the dataContract looks like:

[DataContract]
    public class simplyCustomer
    {
        [DataMember]
        public int id;
        [DataMember]
        public string name;
        [DataMember]
        public string contact;
        [DataMember]
        public string street1;
        [DataMember]
        public string street2;
        [DataMember]
        public string city;
        [DataMember]
        ...
    }

So I have a function that takes simplyCustomer as parameter on WCF service. The php can receive simplyCustomer just fine using another function that returns one. However, if I call the one that accepts it using this code in PHP:

$retVal = $simplyService->__soapCall("addCustomer",array('parameters'=>$params));

The SOAP envelope that this call generates leaves the object NULL causing the WCF service to complain about null reference.

Here is the envelope that is generated:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/"&gt;&lt;SOAP-ENV:Body&gt;&lt;ns1:addCustomer/&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;

The parameters should be where addCustomer is but there's nothing there.

Any help would be greatly appreciated! Thanks!