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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

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

SOAP


Go to End


3 Posts   1825 Views

Avatar
kabo

Community Member, 1 Post

15 January 2008 at 10:48pm

Hi,

I'm building a website and need to pull stuff from a SOAP instead of a MySQL server. I'm kind of new to MVC but I figured I'll create a new pagetype and in there make a controller that will call my soap. And then in the .ss-file I'll call the controller.

<select name="category">
  	<% control getCategories($category) %>
  		<option value="$id">$name</option>
  	<% end_control %>
 </select>

$category is the category for which I want subcategories. The structure can be explained like this:

In my DB I have my top-level categories. I create a page for each top-level category and choose which category the current page represents using a "HasOneComplexTableField", pretty much like in tutorial #5.
Then, depending on which category I'm on I'll call my getCategories-controller with the current category as an argument.

I have 2 problems with this.
1. How do I get the data from the SOAP into the template? Does the <% control getCategories($category) %> expect a DataObject to be returned or can it handle arrays as well?
2. When I try the code I've done I get an error, but <% control getCategories(1) %> works fine. Do I have to make a new function for each top-level category (getCategoriesForLevelOne, getCategoriesForLevelTwo, etc.) and then have those functions call the getCategories function with a hardcoded argument (1, 2, etc.)? That seems kind of stupid...

Please advise! :)

P.S. Why can't I preview this post before I post it?

Avatar
Blackdog

Community Member, 156 Posts

12 June 2008 at 10:28am

Kabo, did you get anywhere with your SOAP stuff?

Avatar
Fuzz10

Community Member, 791 Posts

1 August 2008 at 9:24pm

subscribe...

Curious to hear about this as well....