Giter Club home page Giter Club logo

Comments (6)

georged avatar georged commented on May 24, 2024

Hi @billstennett

executeAction is for executing custom actions, it is not the Execute method that you are after. What you need to do is to build your own SOAP packet for AddListMembersListRequest. SoapRequestGenerator.php file already contains few requests, just follow the same flow.

The reason why we didn't build it is simply the volume. CRM has over 200 different requests, it wouldn't be feasible for us to try and cover all of them. We do encourage that people form the project and add new request types as needed.

You'd need to figure out the parameters, of course. Download CRM SDK (the latest downloadable version) and check out SoapLogger sample. It generates jscript but packets are all the same.

HTH
George

from php-crm-toolkit.

billstennett avatar billstennett commented on May 24, 2024

Thanks very much for the reply George.

I think I have the SOAP packet I need but I can't see how to send it. Should I use the "attemptSoapResponse()" function in Client.php? I did try playing around with it but not getting anywhere so far.

Also, I am struggling to see the actual XML response that is being sent to the server. I can see reference to a "$logger" in various parts of the library code but I can see no edocumentation on how to use it. Ist here a variable somewhere to set to get it to display messages or something similar?

I'd appreciate it if you are able to point me in the right direction with this.

Cheers,

Bill

from php-crm-toolkit.

georged avatar georged commented on May 24, 2024

Hi Bill,

actually, take a look at executeAction in Client.php module. This is something that you'd model your request after.

  • instead of generateExecuteActionRequest you'd want your custom generateAddListMemberListRequest where you do the SOAP formatting specific to that request
  • after you execute loadXml to get your response, you'd need to parse that response which will be serialized AddListMemberListResponse (usually there is nothing to parse if it's successful but there maybe some IDs returned - check the docs for that response)

$logger is a generic logging interface that gets attached when client is constructed. Whatever is your favorite logger, really depends on the environment.

HTH
George

from php-crm-toolkit.

billstennett avatar billstennett commented on May 24, 2024

Hi George,

so I have made progress on this and thought it might be interesting to share where I have got to so far. I am now able to add one or more contact to a marketing list. I found that I can use executeAction from client.php but adding a few lines of code to handle a field type of "ArrayOfguid". The additions are generic and it made me wonder if this is something that could be included in the library. The code I added was as follows:

case 'arrayofguid': $xmlType = 'ArrayOfguid'; $entity = $xmlValue; $xmlTypeNS = 'http://schemas.microsoft.com/2003/10/Serialization/Arrays'; $entityValue = $executeActionRequestDOM->createElement('c:value'); foreach ( $entity as $contact_guid ) { $entityValue->appendChild($executeActionRequestDOM->createElement( 'd:guid', $contact_guid )); }; // end foreach $xmlValue = null; break;

I was then able to call exectueAction as follows:

$result = $service->executeAction( 'AddListMembersList', array( array('key'=>'ListId', 'value' => $listguid, 'type' => 'guid'), array('key'=>'MemberIds', 'value' => $memberids, 'type' => 'arrayofguid') ), 'AddListMembersListRequest' );

Cheers,

Bill

from php-crm-toolkit.

georged avatar georged commented on May 24, 2024

Hi Bill,

cool, that's great! Can you create a pull request for the AddListMembersList implementation and we'll see what can be done about making it generic.

Thanks
George

from php-crm-toolkit.

billstennett avatar billstennett commented on May 24, 2024

Hi George

I have created a pull request with the changes I made to soaprequestsgenerator.php to handle the xml type "ArrayOfguid"

Cheers

Bill

from php-crm-toolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.