Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

any luck with soap/v1/wsdl


Go to End
Reply


991 Views

Avatar
Bambii7

Community Member, 254 Posts

13 January 2010 at 6:45pm

Hi all. I've been tiring to play with SOAP all day with little luck.

The example code
$c = new SoapClient('http://mysite.com/soap/v1/wsdl');
echo $c->getXML("MyClassName", 99); // gets record #99 as xml

Was producing fatal errors.

I've tried creating a SoapClient in non WSDL mode. I don't really understand it all. But this appears to work. But I think the URI is wrong, and I don't know what the URI would be.

$c = new SoapClient(null,
array(
"location" => "http://localhost/ss/silverstripe-v2.3.4/soap/v1/wsdl",
"uri" => "",
'encoding' => SOAP_ENCODED,
'soap_version' => SOAP_1_1,
"style" => SOAP_RPC,
"use" => SOAP_ENCODED,
"exceptions"=>0,
)
);

When I visit the wsdl I see
definitions targetNamespace="http://localhost/ss/silverstripe-v2.3.4/SOAPModelAccess/wsdl"
Wouldn't I want to use SOAPModelAccess/wsdl instead of soap/v1/wsdl when setting up the soap client. It produces the same errors. But I remember reading something about using the same namespace as on the wsdl.

I'm using windows on my localhost, and PHP 5.2.6. There was a bug with windows PHP and SOAP but I think it's OK now. I've tried making a connection with a SilverStripe install on my Linux host, but exact same issue.