473,385 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problem with SoapHttpClientProtocol Invoke()

Hello. I am having a problem with the SoapHttpClientProtocol recognizing a class hierarchy defined in my WSDL and schema. I am using VC#2008Express to import a WSDL from my SOAP server and build a basic client app. I have a base class A and a subclass B extending A. The WSDL defines an action that can be invoked that returns an instance of A. When queried, the server responds with an instance of the subclass B. However, the VC# client returns null, instead of the returned instance. I verified the server is returning the correct object with Wireshark, and with another soap package (soapUI reads it correctly). Can anyone suggest something that may be wrong here?

BTW, I saw an older post (12/2005) that seems to be related, where the solution seemed to be that the schema was defined without the elementFormDefault="qualified" attribute. Adding that fixed the problem for the poster. In my case, my schema does in fact have this attribute already.

Any help is greatly appreciated!
Dec 1 '08 #1
4 2803
Plater
7,872 Expert 4TB
So you have one side that returns an instance of B(which inherits from A).
And the other side expects an instance of A.
And they are not playing nice?
Is there any sort of type-casting that can be done?
I am on the whole unfamiliar with webservices and soap calls. Perhaps there is some sort of security setting or option field that tells it to no be so picky about what object type is returned to it?
Dec 1 '08 #2
Thanks for reply! Please let me know if I'm missing something obvious here.

Yes, that seems to be the situation. My server exposes its WSDL and schema, and I am using VC# to build a SOAP client to make a simple query to my server. When the VC# SOAP client gets an instance of B (which is also an instance of A by inheritance), it does not recognize that it got an instance of A and simply returns null. Unfortunately, I do not believe the server could typecast, because it is putting an XML fragment into the SOAP envelope, and it is not feasible to throw away the type information just to package it up as an instance of A. I am also not very familiar with the world of SOAP and web services, but would be happy to see exactly what you suggest, some sort of flag that would indicate not to require an instance only of A, but also to allow subclasses of A. Coming from the Java world, I would have expected this to happen automatically!
Dec 1 '08 #3
Plater
7,872 Expert 4TB
If you are building the client side, why not have it expect an instance of B instead of A?
Dec 1 '08 #4
Good question. Actually, we have provided the server side, and I have customers that are trying to build their own client side apps to interface with the server side. My client side app is just a simple proof of concept, read and print app. But to answer your question in general, the reason is that a client app would not necessarily know that the reply would be of type B. It is simply saying get this object, which I know is of type A. In fact, there are many different subclasses of A, not just the one. So it isn't possible to know ahead of time exactly what type to expect. You can see where something that should be a simple test has gotten far more complicated than it should have. :-)
Dec 2 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Brad Simon | last post by:
I have seen this problem posted, but the fix posted is not working for me, so I hope to get some help here. I am using the EMAB with all of the default settings, and no custom publisher. It...
1
by: Gregory Hassett | last post by:
Hi, I have a web service called GetComputerNameAndDescription which I can call from the main thread of my app. If I call it from a separate thread, however, it hangs on the call to Invoke() -- but...
3
by: | last post by:
I'm having trouble with the VB MathServiceClient sample in the SDK (v1.1). When I compiled the sample it created the proxy class file (MathService.wsdl). All other samples work OK, so I don't think...
0
by: umhlali | last post by:
I get the following exception when my VB.NET app calls a Java web service that returns an array of objects. The same call works for a single object though. So looks like there is no problem...
4
by: Jit Prasad | last post by:
I have a working client-side Vb.Net (.net v1.0) app that talks to a Webspere webservice on a windows 2000 server. The client side app runs on a citrix server, also a Windows 2000 server. The app...
2
by: Ken Andersson | last post by:
I'm developing a ASP.Net 2.0 web service. I am using windows XP sp2 version 5.1 When testing the service, I created a number of threads that access the web service at the same time. When I increase...
1
by: getobject | last post by:
I am building an ASP.Net site and wish to use a SharePoint to hold the information. I am trying to add an entry to a list using Sharepoint webservices and keep getting a SOAP exception. I have know...
0
by: goal2007 | last post by:
I built a apreject in .net in my local machine. Then I used the “Web Set UP” Project in VS2005 to deploy the project to another server. I have two issues: 1- each time I try to access an aspx page...
4
by: Jon | last post by:
I wrote a VS 2005 C# express programme that accesses a web service. It works fine when there's a direct connection to the internet, but on two different PCs with internet access via a proxy, I get...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.