Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Connecting to Magento using WCF
 
Ian_Intoscape
Jr. Member
 
Total Posts:  8
Joined:  2009-10-05
 

Hi all

I’m new to Magento, so I apologise in advance if this has been posted and answered elsewhere.  I’ve been looking through the forums, but so far unable to find anything that answers the question, so I might be ok…

I’m trying to connect to a Magento instance for a client using WCF and .NET 2.0 (with the extensions to the framework to support WCF pre 3.0), and at present, I can’t get Visual Studio to prepare a service reference for me.  I’m connecting to a client’s implementation, so I haven’t set it up myself, but the url I have been provided is to what seems to be the original WSDL, rather than the “v1.3” WSDL alluded to on the webservices-api introduction page.

I was wondering if anyone else had tried to integrate with Magento using WCF and whether or not it was possible without using the v1.3 WSDL - I have requested the client installs it, but I can’t guarantee it will be possible to trying to explore all avenues at the moment.

Any help greatly appreciated.

Thanks

Ian

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ian_Intoscape
Jr. Member
 
Total Posts:  8
Joined:  2009-10-05
 

Done some further digging since my last post and got in touch with the client regarding the 1.3 WSDL.  The same problem was happening with the new WSDL - when trying to generate a service reference with either Visual Studio or with svcutil, errors were being thrown left right and centre.  Since the newer WSDL was more advanced than the original, I’ve been looking over it to try and fix the errors and get a service reference to generate.

There appear to be a couple of errors that are stopping compiles against a strict parser such as is used by Visual Studio.

It appears it could be a bug, I may be wrong, but I’ll flag my findings....

Opening the WSDL in Visual studio to format it in a friendly way, there’s an apostrophe in a documentation element for customerGroupList, which may be causing some issues (line 1135 when opened in Visual Studio), and secondly, there is a trailing space in catalogProductGetSpecialPriceRequest, in part “storeview “, which needs to be changed to “storeview” (line 2405 in VS). 

After those changes have been made, it will create a service reference happily and more to the point it will work with the normal endpoint with trailing space included.

It’s not too pretty, but it does seem to work at the moment.  If there’s a better way of doing it, let me know!

 
Magento Community Magento Community
Magento Community
Magento Community
 
DenStoreKinge
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2009-09-14
 

Think there are still some bugs in this. I have used the 1.3 version and had to fix a few things myself, some of them have been fixed in the new 1.4 version (can’t remember the fix numbers).

In my experience there are also some problems loading data via the service, some fields contains null when they contain a value when using the API or asking directly in the DB (to check if there really is a value related to the record).

So for now, just edit whatever is required for making it work. I done that, it works on average basis.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ian_Intoscape
Jr. Member
 
Total Posts:  8
Joined:  2009-10-05
 

Is the 1.4 version on general release in Magento? 

I’m finding that a few things are not exposed in the WSDL as they are/were with plain soap.  Manufacturer for example is currently eluding me - I can see it on a soap output from the instance, but I can’t find it in my service reference or in the API docs on the Magento site.  Does anyone know if it’s a custom attribute, or if it has to be added to a product in some other way?

Cheers

Ian

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ian_Intoscape
Jr. Member
 
Total Posts:  8
Joined:  2009-10-05
 

I’m still trying to interact with Magento via webservices - some parts work well, others are a little flaky.  For example, when I upload a product, I then have to update it’s stock separately, unless I’m interpreting the objects wrongly.  Stock updating works fine in this way, other than setting of the “Stock Availability” dropdown on the inventory tab.  I’m sending is_in_stock set to 1, and is_in_stock_specified as true, but they seem to be having no effect in the UI.  Has anyone had any experience of this, or can anyone point me in the direction of the correct values to send if I am sending them incorrectly?

 
Magento Community Magento Community
Magento Community
Magento Community
 
DenStoreKinge
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2009-09-14
 

I’m out on a business travel, so I have not been doing much Magento lately. But we can’t be the only ones having these problems, I sense a lack of focus from the Magento team to take these WS matters seriously, despite it has a bright market ahead.

I have posted 2-3 issues recently, but have gotten 0 responses. The documentation (especially their samples) does not reflect the new object model usage imo, so I’m hoping they will give both the code and the documentation an extreme makeover soon.

When I get back I will start working on my tool again, so we should keep each other up-to-date on ideas and issues. You can start writing down the issues you have and mail them to me. I’ll then compare to their issue list and see if anything has been fixed or has been reported. if I find a way to get their attention, I’ll let you know.

 
Magento Community Magento Community
Magento Community
Magento Community
 
DenStoreKinge
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2009-09-14
 

Maybe you know how to solve this one?

http://www.magentocommerce.com/boards/viewthread/57597/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ian_Intoscape
Jr. Member
 
Total Posts:  8
Joined:  2009-10-05
 

I’ve added a reply to your other thread, I’ve been having the same problem, but haven’t yet found a solution to it.  I’ve added a bit more information about the error I was receiving and why that error is apparently generated, but as I say, I can’t find a resolution as yet.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kabojnk
Jr. Member
 
Total Posts:  1
Joined:  2009-09-18
 

Ian_Intoscape,

As pointed out, there is a typo in the WSDL service where an item called storeView was being written as “storeView “ (note the extra space).  This caused WCF to get all whacky.  One of the solutions, as mentioned above, would be to edit the WSDL file locally; however, I’ve just gone ahead and edited the offending file on the server that was causing the WCF woes. 

You can find the file at: /app/code/core/Mage/Catalog/etc/wsdl.xml on line 417:

<message name="catalogProductGetSpecialPriceRequest">
        <
part name="sessionId" type="xsd:string" />
        <
part name="product" type="xsd:string" />
        <
part name="storeView " type="xsd:string" />
</
message>

Simply remove the trailing space from “storeView “ to make it look like this:

<message name="catalogProductGetSpecialPriceRequest">
        <
part name="sessionId" type="xsd:string" />
        <
part name="product" type="xsd:string" />
        <
part name="storeView" type="xsd:string" />
</
message>

I’ve done it myself and generated the code with WCF.  There are still the 104 warnings being thrown, but it works.  I’ve already tested it. smile

I hope this helps!

 
Magento Community Magento Community
Magento Community
Magento Community
 
fireworks
Jr. Member
 
Total Posts:  18
Joined:  2009-10-11
 

Hi guys,

Speaking as a .NET developer that’s had to work on integrating with Java etc web services, when I run into these issues I usually use a product called SOAPUI that allows interaction with the service directly.  This cuts out the auto gen of Visual Studio and you can see what’s going on.

If the WSDL’s are not compliant with WS-I basic profile your going to have fun, and may need to actually do the SOAP interaction manually (i.e no service proxy, use the protocol libraries instead).

The key to the whole issue is usually the WSDL definition.  Everything else just reads that, and if the generator can’t read it well then your out of luck for the easy way.

Considering that the Magento team doesn’t seem to have SOA as a big priority, hence the bugs, I wouldn’t even use them until they are 100% stable.

I can’t think of a single instance in the past that you need WS for interoperability, that missing data would be acceptable.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top