Solved

Problem with WSDL being consumed by SOAP in VB.NET

Posted on 2014-12-03
5
479 Views
Last Modified: 2016-03-02
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.
0
Comment
Question by:joduk777
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

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

Author Comment

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

Author Comment

by:joduk777
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."
0
 
LVL 11

Accepted Solution

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

Author Comment

by:joduk777
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

E-commerce is quite a gambling world, and you should never entrust your business to a lucky chance. In order to outrun your competitors in a race to attract as many customers as possible, you need to have a well thought-out strategy under your belt.…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now