Comments (11)
I can confirm that this worked PERFECTLY!
THANK YOU SO MUCH!
from salesforce-rest-sdk.
Do you have the JMS Serializer installed? It should install with the SDK if you installed via composer require ae/salesforce-rest-sdk
from salesforce-rest-sdk.
from salesforce-rest-sdk.
Can you give code example to how you're instantiating it? I'm not able to reproduce this and am using it in a number of projects. The test suite is fully passing as well.
from salesforce-rest-sdk.
require "vendor/autoload.php";
use AE\SalesforceRestSdk\Rest\Client;
use AE\SalesforceRestSdk\AuthProvider\OAuthProvider;
$client = new Client(
new OAuthProvider( "xxxxxxxxxxxx",
"xxxxxxxxxxx",
"https://login.salesforce.com",
"xxxxxxxxxxx",
"xxxxxxxxx"
)
);
$sObjectClient = $client->getSObjectClient();
// Query for more stuff
$result = $sObjectClient->query("SELECT Id, Name FROM Account");
from salesforce-rest-sdk.
So the error you're getting doesn't make much sense. The model QueryResult
doesn't annotate using@jms\Serializer\Annotation\Type
, instead it uses @Serializer\Type
where use JMS\Serializer\Annotation as Serializer;
is the import.
It could be that you have a cached version or something? Not entirely sure there. Try removing the vendor folder and running composer install
again. Also try grabbing the newest version, too.
I hope that helps, it's a really strange error you're getting. But it looks like everything is correct in your initialization.
from salesforce-rest-sdk.
I deleted the vendor folder, and ran composer install.
same problem.
frustrating.
from salesforce-rest-sdk.
Ok I'll try to replicate your exact steps on my end. Really strange. Thanks for your patience.
from salesforce-rest-sdk.
Not at all! I appreciate you looking at this.
I don't want to waste your time on this. Dare I ask if there is a different library you think I should try use?
from salesforce-rest-sdk.
Well there's this one: https://github.com/developerforce/Force.com-Toolkit-for-PHP
But SF isn't really supporting PHP these days. jsforce.com is absolutely amazing and is everything I aspire this sdk to be, but it's only for JS, which is where SF seems to be pushing their DeveloperForce stuff towards.
But I'll let you know what I find out and see if I can get a fix for you.
I've been using this with another project that works with Symfony and Doctrine, called AE Connect. (https://github.com/advisors-excel-llc/AEConnect).
Also, I don't think I asked, which version of Composer and PHP are you using?
from salesforce-rest-sdk.
@ilanazbel I have an answer for you! A solution even!
Per schmittjoh/serializer#855 (comment):
Since you're not using a framework that takes care of your annotation registry like Symfony does, you have to do it yourself.
Replace this:
<?php
require "vendor/autoload.php";
With this:
$loader = require 'vendor/autoload.php';
\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, "loadClass"));
And it will work. Tested it myself using the code snippet you provided along with this change.
I hope this fixes any issues you may have. Feel free to share any feedback or comments or questions.
from salesforce-rest-sdk.
Related Issues (20)
- How to use replayId from Streaming API HOT 2
- Topic-level Extensions for the Streaming API
- Issue regarding topic subscribing HOT 2
- having trouble autoloading JMS package HOT 3
- Manually specify the Replay ID HOT 1
- Optional normalizeFieldName?
- Symfony 5 support HOT 2
- Packagist Support HOT 2
- Annotation error with Streaming API
- Runtime exception with Streaming API HOT 2
- Trouble with Replay Extension HOT 3
- Library license
- Possible to return SF response when Persisting object?
- trouble with streaming client
- Fatal Error When Running project HOT 4
- PHP 8 support HOT 3
- curl SSL certificate error HOT 1
- Can't unsubscribe after subscribe.
- how to increase results query? I need to get more than 1000..
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from salesforce-rest-sdk.