Magento Forum

Can’t add Web Reference in .NET
 
frontier
Member
 
Total Posts:  41
Joined:  2008-04-17
 

When I try to add a web reference to a new .NET app it fails with the 2 error messages below.
I tried to reference both http://server/api/soap/?wsdl and http://server/api/?wsdl

Using the latest 1.1 Magento from the downloads page (downloaded yesterday) and Visual Studio 2005 SP1 and .NET 2.0.

Error 1 Custom tool error: Unable to import WebService/Schema. Unable to import binding ‘Mage_Api_Model_Server_HandlerBinding’ from namespace ‘urn:Magento’. Unable to import operation ‘call’. The ref syntax for groups is not supported with encoded SOAP. Please change definition of schema type ‘Struct’ from namespace ‘http://schemas.xmlsoap.org/soap/encoding/’: replace the group reference with local group declaration.  C:\Users\F\Documents\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\My Project\Settings.settings 1 1 WindowsApplication1

Error 2 Custom tool error: Unable to import WebService/Schema. Unable to import binding ‘Mage_Api_Model_Server_HandlerBinding’ from namespace ‘urn:Magento’. Unable to import operation ‘call’. The ref syntax for groups is not supported with encoded SOAP. Please change definition of schema type ‘Struct’ from namespace ‘http://schemas.xmlsoap.org/soap/encoding/’: replace the group reference with local group declaration.  C:\Users\F\Documents\Visual Studio 2005\Projects\Windows`````Application1\WindowsApplication1\Web References\Magento\Reference.map 1 1 WindowsApplication1

 
Magento Community Magento Community
Magento Community
Magento Community
 
boardwalk
Jr. Member
 
Total Posts:  23
Joined:  2008-05-30
Cornwall, UK
 

Hi

I am also having similar issues with the API,

I have just updated to 1.1.1 and still cannot consume the service from within either vb.net or Visual Fox Pro. I have managed to add as a registered service within VFP only by adding the username and password to the url which the web service is called from. From within VB I get -

Error 1 Custom tool error: Unable to import WebService/Schema. Unable to import binding ‘Mage_Api_Model_Server_HandlerBinding’ from namespace ‘urn:Magento’. Unable to import operation ‘call’. The ref syntax for groups is not supported with encoded SOAP. Please change definition of schema type ‘Struct’ from namespace ‘http://schemas.xmlsoap.org/soap/encoding/’: replace the group reference with local group declaration.  \Visual Studio 2005\Projects\DeviceApplication1\DeviceApplication1\Web References\web1\Reference.map 1 1 DeviceApplication1

From within VFP I get : -

Client:Loading the request into SoapReader failed. HRESULT=0x80070057: The parameter is incorrect.
- Client:Unspecified client error. HRESULT=0x80070057: The parameter is incorrect.

I think it may be a problem with Microsoft SOAP Toolkit as I am able to connect and use if using PHP on another server.

Does anyone have any ideas on how I can get past this problem?

Looking forward to some help or advice on this one please.

James

Boardwalk Surf Shop Newquay

 
Magento Community Magento Community
Magento Community
Magento Community
 
olivierlr
Jr. Member
 
Total Posts:  2
Joined:  2008-04-15
 

Hi,

I am also having similar issues with the API.
I’m creating a proxy class with wsd (in dos command. )
I’m saving magento.wsdl (copy the file xml with ie http://www.magentohost/api/?wsdl
and generated the proxy.cs.
connecting with login an key and get sessionid ->ok

help me for create a new customer

 
Magento Community Magento Community
Magento Community
Magento Community
 
bobbrodie
Sr. Member
 
Avatar
Total Posts:  132
Joined:  2008-04-02
Philadelphia, PA
 

I’m also having this problem. I’ve seen solutions but I don’t want to edit core files. Any suggestions?

 
Magento Community Magento Community
Magento Community
Magento Community
 
frontier
Member
 
Total Posts:  41
Joined:  2008-04-17
 

To get it to work with 1.1 it sounds like you have to edit core files.. no thanks, I’ll wait! wink

There was something in the release notes about a web services fix in 1.2, but I have not tested this version yet. Has anyone else tested 1.2 with .NET?

Also, there is another thread about this issue here..
http://www.magentocommerce.com/boards/viewthread/13108/

 
Magento Community Magento Community
Magento Community
Magento Community
 
frontier
Member
 
Total Posts:  41
Joined:  2008-04-17
 

Just tested on my fresh 1.1.3 install, I can now add the web reference, but cannot find it in the object browser.

When I right click on the reference in the Solution Explorer and do Update Web Reference, I get an error popup with this message..

Property value is not valid.

(the details are)
The custom tool ‘MSDiscoCodeGenerator’ failed.  Unable to import binding ‘Mage_Api_Model_Server_HandlerBinding’ from namespace ‘urn:Magento’.

So still not working with .NET out of the box, as far as I can tell. :-(

 
Magento Community Magento Community
Magento Community
Magento Community
 
alex999
Jr. Member
 
Total Posts:  8
Joined:  2009-01-17
 

Hi,
something new on that topic?
Not working in VS2005, VS2008; Magento 1.2.0.3.

The strange thing is, it worked a few days ago in a VS 2008 project. After opening the project some days later, without modifications I can’t update the web reference. Therefore it’s not longer working!?

Have a nice time,
Alex

 
Magento Community Magento Community
Magento Community
Magento Community
 
frontier
Member
 
Total Posts:  41
Joined:  2008-04-17
 

alex999: Sounds exactly like the behavior I had 1 post above you.. it adds without error, but it doesn’t really work. As far as I know nothing has changed since 1.1, but I have heard that they are working on this problem now, it affects all SOAP clients not just .NET. eg. Java can’t connect either.

I heard some people are able to get it to work with minimal mods using the XML-RPC.NET library instead. http://www.xml-rpc.net/

In terms of what I needed it for.. I don’t think they have the API finished for creating orders yet anyway.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MG-Giuseppe
Jr. Member
 
Total Posts:  8
Joined:  2009-02-05
Italy - (PU)
 

Hello to everybody
I’m having the same problem too !

I’ve tried to use both “Add web reference” inside Visual Studio
and the command line Wsld.exe command.

From Visual studio I get the method list but no “webservice name” is filled !

From Wsld field I’ve got some “sintax error”

Seems that the sintax of the xml returned from Magento is illformed.

I’ll wait for any update on thi matters

Bye
Giuseppe

 
Magento Community Magento Community
Magento Community
Magento Community
 
frontier
Member
 
Total Posts:  41
Joined:  2008-04-17
 

Information about the problem and the workarounds can be found in the comments here..
http://www.magentocommerce.com/blog/comments/magento-core-api/

 
Magento Community Magento Community
Magento Community
Magento Community
 
thE_iNviNciblE
Sr. Member
 
Avatar
Total Posts:  220
Joined:  2008-01-09
Oldenburg
 

i’ve also tried the wsdl tool ..

wsdl /l:vb /protocol:SOAP http://www.yourserver.de

i’ll try this comment from the blog

--------------------------cadessi ------------------------

That’s because the generated wsdl file is not compliant with WS-I Basic Protocol 1.1. To overcome this, edit the “wsdl.xml” file in “magento\app\code\core\Mage\Api\etc” (DO NOT forget to backup first):

Replace

<wsdl:types >

with

<wsdl:types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"
schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" >
<xsd:complexType name="FixedArray">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[]">
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
</wsdl:types>

And then, for every <wsdl:part> that contains

xsd:arrayType="xsd:anyType" type="soapenc:Array"

remove

xsd:arrayType="xsd:anyType"

and replace

type="soapenc:Array"

with

type="typens:FixedArray"

I hope the Magento Team will solve this problem by regenerating the wsdl file with some other WS-I compliant tool.
--------------------------------------------------

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