How to send class from PHP or Zend Framework to WCF service?

General discussion on PHP
Post Reply
przemek_kompix
Posts: 2
Joined: Fri Dec 21, 2012 3:46 pm

How to send class from PHP or Zend Framework to WCF service?

Post by przemek_kompix » Fri Dec 21, 2012 3:46 pm

Hello

I wrote WCF service which be called directly from PHP or Zend Framework.

When operation contract wants simple argument like String everything works fine. For example:

[OperationContract]
ComplexClass Znajdz(String simpleArgument);

Then calling from
$client = new Zend_Soap_Client("http://URL/?wsdl");
$client ->setSoapVersion(SOAP_1_1);

$parameter = array(
'simpleArgument' => "myValue",
);
print_r( $client->Add($parameter ));

And ComplexClass is returned to PHP script.

But when I try to use function where ComplexClass is argument, function are calling with null argument.

What should I look for?

Regards
Przemysław Staniszewski

rampog
Posts: 56
Joined: Mon May 04, 2009 12:15 pm

Re: How to send class from PHP or Zend Framework to WCF serv

Post by rampog » Thu Dec 27, 2012 2:10 pm

actually php doesn't have any concern either it is WCF or not,
it concern that soap server are integrated through with wsdl or not.
so you have to be able map which call class mapping if parameter not simple like just a string,int
so you have build your own object base on complex type or stdclass to generate parameter

przemek_kompix
Posts: 2
Joined: Fri Dec 21, 2012 3:46 pm

Re: How to send class from PHP or Zend Framework to WCF serv

Post by przemek_kompix » Fri Jan 04, 2013 1:47 pm

Hi

I found and tested good solution

social [dot] msdn [dot] microsoft [dot] com/Forums/en-US/wcf/thread/884fe36c-a7a2-4cc7-b34a-b0fd3f464579

Best Regards
Przemysław Staniszewski

Post Reply