473,655 Members | 3,056 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.NET SOAP Serialisation vs. VAST interoperabilit y issues

Hi all!

I have a couple of questions regarding the SOAP serialized from classes
generated by Visual Studio from a wsdl. The SOAP server is written in
Smalltalk using the VisualAge Sst framework. There are some differences in
the SOAP messages constructed from the WSDL in the two products, and I need
help to better understand and control the .NET side

1. soapenc:Array

Whenever an element say "message" has maxoccurs unbounded, .NET uses
soapenc:array to represent the item. e.g:

<soapenc:Arra y " id="id6" soapenc:arrayTy pe="q7:message[1]">
<Item href="#id9"/>
</soapenc:Array>

where as the server will use normal XML representation of a repeated element

<message....
<message...
<message...

How do I instruct .NET to avoid wrapping these elements in an array?

2. id/#href
The above example also illustrates that EVERY complex child node in the
document, is created as a separate node and connected to the parent node via
href. In our case this is not neccesary since the message is guaranteed to be
a hierarchy and not a graph.
How do I instruct .NET to avoid using href?

Any help would be greatly appreciated. This is all down to my limited
knowledge of .NET, so be gentle with me ;-).

Regards

Martin Skarsaune, Norway


Feb 20 '06 #1
5 1267
I may have misunderstood your question - please tell me if I have.

But the .NET class that would represent this XML structure

<root>
<someOtherClass >...snip...</someOtherClass>
<someElement>bo o</someElement>
<repeatingEleme nt>string1</repeatingElemen t>
<repeatingEleme nt>string2</repeatingElemen t>
<repeatingEleme nt>string3</repeatingElemen t>
</root>

would look something like this (it uses .NET attributes to control the
serialization)

using System.Xml.Seri alization;

[XmlRoot("root")] // this controls the xml elements name
public class Root
{
[XmlElement("som eOtherClass")] // this changes the case of the types
name in XML
public SomeOtherClass OtherClass;

[XmlElement("som eElement")] // as above
public string SomeElement;

[XmlElement("rep eatingElement")] // as abovce
public string[] repeatingElemen ts; // this is an array marked
XmlElement - so it isn't wrapped
}

Does that help at all (at least part 1 of your query)?

Josh
http://www.thejoyofcode.com/

Feb 20 '06 #2
Hey Josh!

I believe so. I will look into it first thing tomorrow.

Thanks

"Josh Twist" wrote:
I may have misunderstood your question - please tell me if I have.

But the .NET class that would represent this XML structure

<root>
<someOtherClass >...snip...</someOtherClass>
<someElement>bo o</someElement>
<repeatingEleme nt>string1</repeatingElemen t>
<repeatingEleme nt>string2</repeatingElemen t>
<repeatingEleme nt>string3</repeatingElemen t>
</root>

would look something like this (it uses .NET attributes to control the
serialization)

using System.Xml.Seri alization;

[XmlRoot("root")] // this controls the xml elements name
public class Root
{
[XmlElement("som eOtherClass")] // this changes the case of the types
name in XML
public SomeOtherClass OtherClass;

[XmlElement("som eElement")] // as above
public string SomeElement;

[XmlElement("rep eatingElement")] // as abovce
public string[] repeatingElemen ts; // this is an array marked
XmlElement - so it isn't wrapped
}

Does that help at all (at least part 1 of your query)?

Josh
http://www.thejoyofcode.com/

Feb 20 '06 #3
Hi!

Thank you for you suggestion, but it seems like it doesn't work.
I suspect there is a difference between "normal" xml serialization and SOAP
serialization.

Our code looks like:
[System.Serializ ableAttribute()]
[System.Xml.Seri alization.SoapT ypeAttribute
(Namespace="htt p://www.company.com/Types")]
public partial class Responses {

private string[] answersField;

[XmlElement("ans wers")] /// <- Suggested by you
public string[] answers {
get {
return this.answersFie ld;
}
set {
this.answersFie ld = value;
}
}
...

When the soap message is sent it looks like:
...
<answers href="#id7" />
...
<soapenc:Arra y id="id7"
soapenc:arrayTy pe="xsd:string[2]">
<Item>A</Item>
<Item>B</Item>
</soapenc:Array>
...

but we would like:
<answers>A</answers>
<answers>B</answers>

regards,
Oystein

"Josh Twist" wrote:
I may have misunderstood your question - please tell me if I have.

But the .NET class that would represent this XML structure

<root>
<someOtherClass >...snip...</someOtherClass>
<someElement>bo o</someElement>
<repeatingEleme nt>string1</repeatingElemen t>
<repeatingEleme nt>string2</repeatingElemen t>
<repeatingEleme nt>string3</repeatingElemen t>
</root>

would look something like this (it uses .NET attributes to control the
serialization)

using System.Xml.Seri alization;

[XmlRoot("root")] // this controls the xml elements name
public class Root
{
[XmlElement("som eOtherClass")] // this changes the case of the types
name in XML
public SomeOtherClass OtherClass;

[XmlElement("som eElement")] // as above
public string SomeElement;

[XmlElement("rep eatingElement")] // as abovce
public string[] repeatingElemen ts; // this is an array marked
XmlElement - so it isn't wrapped
}

Does that help at all (at least part 1 of your query)?

Josh
http://www.thejoyofcode.com/

Feb 21 '06 #4
Hmm... the class you above XmlSerializes fine - so as you say there
must be something else going on.

How are your confirming what is going across the wire?

Also, Is the class above generated using WSDL.exe by pointing it at a
WSDL (or add web-reference in Visual Studio)?

Josh

Feb 21 '06 #5
> the class you above XmlSerializes fine
Do you mean like this:
<answers>A</answers>
<answers>B</answers>
How are your confirming what is going across the wire? The result is pasted directly from the Smalltalk server which writes out the
soap message as it comes over the wire before processing it.
Also, Is the class above generated using WSDL.exe by pointing it at a
WSDL (or add web-reference in Visual Studio)? It is generated by "add web-reference" in Visual Studio.

regards,
Oystein

"Josh Twist" wrote:
Hmm... the class you above XmlSerializes fine - so as you say there
must be something else going on.

How are your confirming what is going across the wire?

Also, Is the class above generated using WSDL.exe by pointing it at a
WSDL (or add web-reference in Visual Studio)?

Josh

Feb 21 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1620
by: Ulan | last post by:
Hello. How could I consume Web services created using c# with soap client written on c++6.0 ? I can't use .net on client app. Thanks in advance.
3
2371
by: Sai Kit Tong | last post by:
I posted for help on legacy code interface 2 days ago. Probably I didn't make it clear in my original mail. I got a couple of answers but none of them address my issues directly (See attached response). My first reply directed me to source code migration but I didn't have the source code. The second reply mentioned about .NET interoperability (PInvoke I think) but I MENTIONED THAT I COULDN'T FIND ANY DOCUMENTATION FROM MSDN LIBRARY BASED ON...
15
3076
by: MR | last post by:
i need to develop a SOAP client, Since I have never personally done one I would like to make sure that I am going about it correctly. The client is a Windows (probably 2k3) application that communicates over HTTPS SOAP. The remote server is Unix based and implements Axis, which I know nothing about What are the steps I need to create this client? I will be developing in C# and I have the XML schema of the SOAP messages. How do I get...
3
9791
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the response. As a result of seraching news groups I guessed that the SOAP response defines an array element in a way that causes the dotnet deserialization routines to put the content in a generic object array (object) BUT the content is supposed to...
0
4352
by: Matt Wood | last post by:
Hi, I have written a Web Service for a customer which expects a SOAP message with Document/Literal encoding, and uses RoutingStyle=SoapServiceRoutingStyle.RequestElement to route the SOAP body message to my Web Method. The Web Method expects a string as its parameter and then feeds that string to an XML deserializer which maps the XML elements contained within the string to my custom objects, then performs an insert/update on an SQL...
16
3177
by: MR | last post by:
my soap messages to a remote site are failing. as far as i can tell the only differences between what my SOAP message looks liek and what they want are in the SOAP envelope SInce they don't have a wsdl doc i created a localhost site based on their DTD documetns. How do I configure my site (and client proxy) to match thier envelope? Any help would be greatly appreciated thanks
52
5776
by: frankgerlach | last post by:
>From my simple performance tests of SOAP it seems that it is about ten times slower than binary object request protocols such as RMI, IIOP or SimpleORB. Is this also YOUR experience ?
1
930
by: JackieB | last post by:
I have done couple of Web Sevices with VS.NET 2003. Still I'm wondering that is my Web Service using SOAP or XML-RPC. This is basic question but how can I be sure that my Web Service is using SOAP and when it's using XML-RPC? Secondly, when should I use SOAP and when XML-RPC, are there any recommendations which protocol should be used in certain cases? Cheers!
2
6879
by: Reshma Prabhu | last post by:
Hi All. In Remoting, There are 4 combinations possible. HTTP -SOAP HTTP - Binary TCP - SOAP TCP - Binary. The above combinations are in increasing order of interoperability and in decreasing order of efficiency. Can any one please
0
8380
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8598
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.