Avatar of joduk777
joduk777

asked on 

Problem with WSDL being consumed by SOAP in VB.NET

Hello,

I am working on a vb.net project that communicates with the Magento SOAP API v2.
We have been utilizing the API fine, however a new extension was installed on the Magento server which altered the WSDL we had previously consumed.  After the change, we successfully imported the new WSDL, though now it fails during initialization with the error message:

The XML element 'giftcardUpdateResponseParam' from namespace 'urn:Magento' references a method and a type.
Change the method's message name using WebMethodAttribute or change the type's root element using the XmlRootAttribute.


After googling for a bit, it seems this response is common if there are conflicts in the object names.  Reference:
http://softwareblog.morlok.net/2010/07/02/naming-collision-in-asmx-web-service/


The WSDL we are working with can be found here: http://magento19.blackbaudpos.com/index.php/api/v2_soap?wsdl=1

Can anyone help identify the problem and provide a solution so that this WSDL can be imported into VB.NET and the objects created in the reference.vb can be initiated properly?

Thank you.
Microsoft DevelopmentWeb ApplicationsWeb ServicesSOAP ProtocolMagento

Avatar of undefined
Last Comment
joduk777
Avatar of srikanthreddyn143
srikanthreddyn143

can you post you code snippet, that is failing or write a test code to replicate it and post here?
Avatar of joduk777
joduk777

ASKER

First, I created a new windows form application and added a web reference with name magento19 using the URL of the WSDL.
User generated image
This is the entire code needed to produce the error.
When the class that contains the line : Public Shared MagentoAPIConnection As New Magento19.MagentoService
is initialized, it throws the error.

Public Class Form1

    Public Shared MagentoAPIConnection As New Magento19.MagentoService
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
        Try

        Catch ex As Exception

        End Try
    End Sub
End Class
Avatar of joduk777
joduk777

ASKER

The inner exception shows "Method MagentoService.giftcardSendEmail can not be reflected."

The inner-inner exception shows "The XML element 'giftcardUpdateResponseParam' from namespace 'urn:Magento' references a method and a type. Change the method's message name using WebMethodAttribute or change the type's root element using the XmlRootAttribute."
ASKER CERTIFIED SOLUTION
Avatar of srikanthreddyn143
srikanthreddyn143

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of joduk777
joduk777

ASKER

Thank you.  I did a bit of research on this before implementing the changes.  As you suspected, loading the wsdl as a Service Reference eliminated the issue.
Microsoft Development
Microsoft Development

Most development for the Microsoft platform is done utilizing the technologies supported by the.NET framework. Other development is done using Visual Basic for Applications (VBA) for programs like Access, Excel, Word and Outlook, with PowerShell for scripting, or with SQL for large databases.

48K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo