473,412 Members | 2,088 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,412 software developers and data experts.

.NET SOAP Serialisation vs. VAST interoperability 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:Array " id="id6" soapenc:arrayType="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 1239
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>boo</someElement>
<repeatingElement>string1</repeatingElement>
<repeatingElement>string2</repeatingElement>
<repeatingElement>string3</repeatingElement>
</root>

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

using System.Xml.Serialization;

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

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

[XmlElement("repeatingElement")] // as abovce
public string[] repeatingElements; // 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>boo</someElement>
<repeatingElement>string1</repeatingElement>
<repeatingElement>string2</repeatingElement>
<repeatingElement>string3</repeatingElement>
</root>

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

using System.Xml.Serialization;

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

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

[XmlElement("repeatingElement")] // as abovce
public string[] repeatingElements; // 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.SerializableAttribute()]
[System.Xml.Serialization.SoapTypeAttribute
(Namespace="http://www.company.com/Types")]
public partial class Responses {

private string[] answersField;

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

When the soap message is sent it looks like:
...
<answers href="#id7" />
...
<soapenc:Array id="id7"
soapenc:arrayType="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>boo</someElement>
<repeatingElement>string1</repeatingElement>
<repeatingElement>string2</repeatingElement>
<repeatingElement>string3</repeatingElement>
</root>

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

using System.Xml.Serialization;

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

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

[XmlElement("repeatingElement")] // as abovce
public string[] repeatingElements; // 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
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
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...
15
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...
3
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...
0
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...
16
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...
52
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
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...
2
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...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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,...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.