Problem with WSDL being consumed by SOAP in VB.NET

Posted on 2014-12-03
Last Modified: 2016-03-02

I am working on a 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:

The WSDL we are working with can be found here:

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.
Question by:joduk777
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 11

Expert Comment

ID: 40481211
can you post you code snippet, that is failing or write a test code to replicate it and post here?

Author Comment

ID: 40481386
First, I created a new windows form application and added a web reference with name magento19 using the URL of the WSDL.
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

        Catch ex As Exception

        End Try
    End Sub
End Class

Author Comment

ID: 40481402
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."
LVL 11

Accepted Solution

srikanthreddyn143 earned 500 total points
ID: 40481760
Can you use wsdl as  a service reference?

Author Comment

ID: 40482232
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.

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Magento slider issue 1 71
SSRS troubles 4 106
CRM 2016 Organization service not working 7 92
Survey branching tutorial 11 77
Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This video teaches users how to migrate an existing Wordpress website to a new domain.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question