Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » SOAP

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

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

Page: 1
Go to End
Author Topic: 1488 Views
  • kabo
    Avatar
    Community Member
    1 Post

    SOAP Link to this post

    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?

  • Blackdog
    Avatar
    Community Member
    156 Posts

    Re: SOAP Link to this post

    Kabo, did you get anywhere with your SOAP stuff?

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: SOAP Link to this post

    subscribe...

    Curious to hear about this as well....

    1488 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.