API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Newbie SOAP question

Hey you all...

I just don't get how to use the soapclient in php 5. (not the nusoap or similar)

Im trying to integrate e-conomic to PrestaShop, just a simple module.

I've managed to connect and I've accomplished pulling data from e-conomic by using some sample code in an earlier post.

So now im working on checking if a product number already exist in e-conomic so i can create it if response is NULL or whatever the response would be.

Been trying all kinds of possible ways to twist the request around.

Problem 1.
How do I format the variable?


In the example i've found the var was array but that was specificly pointed out in docs and as far as I know the docs said the var should be a string in this case. it also stated something about name.

been trying this around with no luck:
$this-client-Product_FindByNumber(array('name' = $ref))

The thing is, I get no error response when i run the first snippet. have no idea if this is correct couse my next problem is how to retrieve the response. tried this:


But get : Notice: Undefined property: stdClass::$Product_FindByNumberResult on line 39     NULL

I know there should be atleast one of the products in the loop that should return a product number as I've entered it manually.

Any wiz willing to point me in atleast some sort of direction on this? Searched all around for a simple explanation but all tutorials and articles just talks about headers, __getLastResponse etc. and how to setup a soap_server.

Ohh...I get 200's in response on __getLastResponseHeaders(), would that meen the request is formatted correctly or just connected to server?
created Dec 7, 2010 by inmortal
0% Accept Rate
Q 1 A 0 C 0

3 Answers

This is what I use to check if a product exits

                        $productHandle = $client-Product_FindByNumber(array(
                            'number' = utf8_encode($array2) ) )-Product_FindByNumberResult;
                            //print('Artnr existsbr/');
                        if ($productHandle) {
answered Dec 19, 2010 by Madman

How do you know which version of the soap you are using?
based to this link: https://www.e-conomic.com/secure/api1/E ... oup_GetAll,
you can use both Soap 1.1 and Soap 1.2.

how can you tell econmics that you will use version 1.2?

thanks. I'm a newbie on the api too.
answered Apr 2, 2011 by brjano
Hi again.
Sorry for late replay.

I have no idea how to check what soap i'm using, i just program and fix bugs =)
answered May 5, 2011 by Madman
Visma e-conomic A/S