I am using C# in VS2005 .Net, with a service which passes data to a proxy using a soap message. If all of the instance variables are strong typed, I have no problem, but I need to pass an instance variable which is held as an object. When I get the object in the proxy, it is an XmlNode[] with 2 elementsXmlNode[0] is an XmlAttribute, and XmlNode[1] is an XmlText. The XmlAttribute contains the correct information about the data type, and the XmlText contains the correct data.
I am looking for a way to have this return the correct data type with the data, instead of getting an XmlNode[].
I used test code similar to the following: - using System;
-
using System.Collections.Generic;
-
using System.Text;
-
using System.Xml.Serialization;
-
-
namespace MewtV2.SystemFrameworks.Data.Device
-
{
-
[Serializable()]
-
[System.ComponentModel.DesignerCategoryAttribute( "code" )]
-
[System.Diagnostics.DebuggerStepThrough()]
-
[System.ComponentModel.ToolboxItem( true )]
-
[XmlInclude( typeof( TestObject ) )]
-
public class TestObject
-
{
-
public object Test = 69;
-
-
public TestObject (int arg)
-
{
-
Test = arg;
-
}
-
}
-
}
-
-
-
In the service, I did the following:
-
TestObject ob = new TestObject(new TestData(72, "test string"));
-
SoapEnvelope replyEnvelope = MakeSoapEnvelope( DeviceServiceLiterals.DataReceivedResponseAction );
-
replyEnvelope.SetBodyObject( data );
-
replyEnvelope.Context.Addressing.To = new To( filter.Listener() );
-
SoapSender soapSender = new SoapSender( filter.Listener() );
-
soapSender.Send( replyEnvelope );
-
In the proxy, I have the following:
-
TestObject cmd = (TestObject)env.GetBodyObject(typeof(TestObject));
-
object ob = cmd.Test;
-
-
At this point, ob is an XmlNode[] instead of an integer.
-
2 1286
I do not trust passing any complex objects via SOAP. If you have to, then ensure that you use the smallest and most optimal packets possible. If there is a way send in a binary format instead of a large plain text xml packet, then this would be the way to go...
I do not trust passing any complex objects via SOAP. If you have to, then ensure that you use the smallest and most optimal packets possible. If there is a way send in a binary format instead of a large plain text xml packet, then this would be the way to go...
In this case, I have to pass a complex object, and I don't have the option of using a binary format due to the software specs.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mark C |
last post by:
I have a memory allocation problem in PHP using NuSOAP and the built in XML
parser. The code below is called in a loop and executed about 1900 times
before it failed. I am using nusoap.php,v 1.76 2004/06/25 13:17:56 snichol
Exp $. I am running PHP version 4.2.2 on RedHat 9.0
I presume I need to unallocated something other than the soapclient, but I'm
nor sure what. This is the code that is called in the loop and the error
message...
|
by: dont bother |
last post by:
Hey,
I have been trying to parse emails:
But I could not find any examples or snippets of
parsing emails in python from the documentation.
Google did not help me much too.
I am trying to understand the module 'email' and the
functions described there to parse email but seems
difficult.
Can anyone help me in locating some pointers or
snippets on this issue.
|
by: Karl |
last post by:
Hi everyone,
We developped a WebService with Visual Studio .Net and we faced an
authentication problem with a java client. My assumption is that this
is because cookies passed from client are misunderstood by the
framework.
Basically, these are the headers received from the client (I used a
packet sniffer to know exactly what we received from him before the
framework modifies it):
|
by: T.Horton |
last post by:
Currently in a VB6 application we are using SOAP to send an XML file
to another application. I have not been successfull in finding a way
to convert the code below to something similar in ASP.NET (VB.NET):
-----------
Dim Connector
Dim Serializer
Dim Reader
'On Error GoTo cleanUp
|
by: Marc |
last post by:
Hi!
I'm working with a C# client that calls a php web service. I've
created a wrapper to call the service using .NET wsdl tool (adding a
web reference).
The call to the server works fine, it is serialized correctly, and the
server returns a response (I've captured the response and it's
correct!) but when the .NET deserialize this response, it throws the
exception "System.InvalidOperationException: There is an error in XML
| |
by: Jacques Lebastard |
last post by:
Hi there,
I'm new to the SOAP PHP5 extension. It works fine for web service
methods that returns basic types (string,int,...). However, for methods
that return an object of a class I defined, I can't access the object,
though the SOAP response looks correct.
Here the received SOAP message :
Response:
|
by: irishdudeinusa |
last post by:
Hello Everyone,
I have been working a webservice where I can use it in other
applications that I am working on. However, I am running into a problem
with the data returned and I was wondering if someone could help.
This is the code for the method that I call
<WebMethod()Public Function GetZipCodes(ByVal iZipCode As Integer,
ByVal iMiles As Integer) As String
|
by: randy |
last post by:
Can some point me to a good example of parsing XML using C# 2.0?
Thanks
|
by: sebastian.mattar |
last post by:
HI there!
I am trying to consume a web service implemented in Perl (SOAP::Lite)
using VS Express 2008. I already implemented a client in java without
problems.
I succeeded in calling the web service, but the SOAP-Call returns a
complex type which is not handled correctly.
Invoke() throws an exception stating that an object of type
system.String can not be assigned to type RetDataType. Debugging shows
|
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...
|
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...
| |
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...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |