Results 1 to 7 of 7

Thread: Build own SOAP-Method for direct access to custom-module bean (class-file)

  1. #1
    TommyL is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    30

    Default Build own SOAP-Method for direct access to custom-module bean (class-file)

    hi everybody,

    im searching for a way to implement a own written SOAP Method to create records in custom modules. Sure I can use the set_entry() method to insert records, but i need access to the class-file of the custom module directly. Backgrund: I want use already written methods in the custommodule-class. for example I have a method in the moduleclass that creates a increment booking number, and this method i want to access from the SOAP method.

    i think it must be something like the availible soap method "create_contact()" - so where i can define custom SOAP methods and how to publish the new method in the wdsl?

    can anybody help - i hope so...
    thanks a lot - tommy


    SUGAR 5.0b
    PHP 5.2
    APACHE
    NUSOAP

  2. #2
    anna is offline Sugar Community Member
    Join Date
    Jan 2007
    Location
    USA
    Posts
    81

    Default Re: Build own SOAP-Method for direct access to custom-module bean (class-file)

    Check out the soap/SoapSugarUsers.php. This is where you would put your custom soap function and register it so it appears in the wsdl (just follow the structure of the already existing methods). If your new function requires a custom type to be passed or returned that cannot be covered by some of the defined structures, you can add the new type to soap/SoapTypes.php

    When you point your browser to /soap.php you should be able to see your new function in the generated wsdl file and it is ready to use by webservices.
    Let me know if you need more help, I have a couple of custom soap functions in my implementation, so I can provide more details if needed.

    Edit: just noticed you are using Sugar 5, I am not sure if anything changed regarding the soap interface, I am only familiar with 4.5

  3. #3
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Re: Build own SOAP-Method for direct access to custom-module bean (class-file)

    Anna, that's not good practice. This would break with the first update to that file.

    Unfortunately SugarCRM doesn't allow for customized SOAP functions. However, you can do this:

    1. Copy soap.php to custom_soap.php (somewhat safe)
    2. Add "require_once('custom/soap/SoapSugarCustom.php');" to that file, between the other ones
    3. Add your SOAP functions to custom/soap/SoapSugarCustom.php.
    4. Connect to soap_custom.php from now on
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

  4. #4
    TommyL is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    30

    Default Re: Build own SOAP-Method for direct access to custom-module bean (class-file)

    thanks thats whats what i need, you help me much, when you know the way then its simple.- thanks. tommy

  5. #5
    thymeit is offline Member
    Join Date
    Mar 2007
    Posts
    7

    Default Re: Build own SOAP-Method for direct access to custom-module bean (class-file)

    [QUOTE=TommyL]hi everybody,

    im searching for a way to implement a own written SOAP Method to create records in custom modules. Sure I can use the set_entry() method to insert records, ....

    .
    Hi you sound as if you know what you are doing. So I wonder if you could shed some light here.

    I have been trying to use the get and set to insert records into a custom module too, but I have not succeeded.

    when I use getallmodules() my custom built one does not display
    and when I use getmodulefields("key_testmod") I get an error 20: Module Does Not Exist

    I have uploaded it so that it exists in the modules directory, and I can see it and use it through the usual sugar interface.

    i have just upgraded to 5.0.0.c hoping this would enable it but alas no!

    I'm hoping it is just somehting simple, so please if anyone can point me in the right direction I would be very grateful. I've already spent quite some time on this.

    many thanks...

  6. #6
    purplewave is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    33

    Default Re: Build own SOAP-Method for direct access to custom-module bean (class-file)

    Thymeit, try going into Sugar's admin controls and selecting Repair Roles. I noticed that a couple of times when installing/updating new modules through the module loader, that SOAP access gets turned off (fails to get turned on?) for the new/changed module.

  7. #7
    thymeit is offline Member
    Join Date
    Mar 2007
    Posts
    7

    Default Re: Build own SOAP-Method for direct access to custom-module bean (class-file)

    Hi thanks for this purplewave,

    sorry for delay in getting back. I tried this but still no luck.

    however, it made me wonder if i have to specificslly allow access control in some way

    "Repairs Roles by adding all new modules that support Access Controls, and by adding any new Access Controls to existing modules"

    Can any body tell me whether thay have actaually used nusoap to update a custom built module? Is it actually possible? or am i hunting in vain for a solution that will never work?


    thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. HOWTO - Enhance ModuleBuilder generated modules to include AJAX
    By kenneth.thorman in forum Developer Tutorials
    Replies: 10
    Last Post: 2009-01-16, 05:53 PM
  2. SOAP access to custom built module
    By thymeit in forum Help
    Replies: 1
    Last Post: 2008-05-14, 09:34 AM
  3. Access Control List - Custom Module
    By kgeving in forum Help
    Replies: 1
    Last Post: 2007-04-06, 02:07 PM
  4. teams access control for custom module
    By stasdu in forum Developer Help
    Replies: 5
    Last Post: 2006-12-13, 01:22 PM
  5. PATCH: HTML Emails and Templates
    By funkypenguin in forum Downloads
    Replies: 2
    Last Post: 2005-05-31, 10:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •