I can see the functionality with SOAPUI (thanks for suggesting it) but am having trouble getting the results back from the XML. The XML call for information on a catalog item is <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento"><soapenv:Header/><soapenv:Body><urn:call soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><sessionId xsi:type="xsd:string">myID</sessionId><resourcePath xsi:type="xsd:string">catalog_product.info</resourcePath><args xsi:type="xsd:anyType">5</args></urn:call></soapenv:Body></soapenv:Envelope>
and the response (shortened) is
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://xml.apache.org/xml-soap"><SOAP-ENV:Body><ns1:callResponse><callReturn xsi:type="ns2:Map"><item><key xsi:type="xsd:string">product_id</key><value xsi:type="xsd:string">5</value></item><item><key xsi:type="xsd:string">sku</key><value xsi:type="xsd:string">800-0003</value></item><item><key xsi:type="xsd:string">name</key><value xsi:type="xsd:string">USB Connector</value></item></callReturn></ns1:callResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
My code makes the correct function call, but the result isn't parsing right
loResources = loservice.call(loSID, 'catalog_product.info', '5' )
? loResources.count
oItem = loResources.item[1]
? oItem.key
? oItem.value
loResources.count gives the correct number of Item entries, but the oItem object is not readable. I'm thinking the answer is in the ComArray functions, but I can't figure out what I'm doing wrong.
If I get this, perhaps I can then figure out how to pass in parameters more complex than a single ID value. I haven't gotten SOAPUI to accept any other type of parameters - the WSDL says "array" in its documentation.
Thanks,
Barbara
Thanks Rick,
I've successfully tested both your samples and a free weather.wsdl which gave me practice with arrays and multi-level functions. I couldn't get the second WSDL to work on my Magento site, but I do have some help on getting the correct pathing from the IT person running the site. Unfortunately NEITHER of us have any control over the actual WSDL and the functions called.
Thanks for the SOAPUI suggestion - I'll try that first. Magento's PHP samples aren't much help when it comes to passing parameters and getting info back.
Then I'll concentrate on getting the second WSDL to map/generate correctly.
Barbara
Hi Barbara,
You can import multiple WSDL files into seperate proxies. If they are separate WSDLs each WSDL will map to a separate proxy class.
I recommend you take a look at SoapUI (free) to test your web service to make sure it works and you get the values right. Once you know it works then try running it through the generated proxies.
Complex objects etc. passed through the proxy generator can be complex - since you need to coax types to properly work between Fox and .NET, so making sure that the right values are availalble takes out one area of potential failure out of the equation.
+++ Rick ---
I'm trying to access a Magento ecommerce site. The basic WSDL URL I was given logs in and produces a session ID as expected. However, all other functions go through a "Call()" function which passes the session ID, the function (eg Sales_Order_List) I want plus any arguments and supposedly returns an object.
If the argument is a single string (such as a sales order ID) the code has no errrors, but the resulting object is empty, "Display Object" shows a class tree of "unknown type" and nothing else.
The actual source code has multiple WSDL.XML files in multiple directories. The one used in generating shows Session ID, Login and Call functions. Another WSDL.XML file in a different directory shows all Sales functions, etc. Is there a way to get all of these functions loaded? I'm not even sure the "Call" function is working when it SAYS it is, since the result is blank.
I'm completely unfamiliar with SOAP - what I know I've learned from the help files and some of it is confusing to a novice.... Any suggestions would be appreciated.
Barbara Paltiel