473,503 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parameters aren't received by the .NET web service listener

Hello,

I have a .NET 2.0 web service that is consumed by a Delphi application.

The Delphi application calls a method from the .NET web service with
parameters.
Theses parameters are in the call message, which we can see through a HTTP
proxy. But the ASP.NET application does not received the parameter values, it
recevices only null values.
When tagging the ASP.NET method parameters with
<System.Xml.Serialization.XmlElement(Form:=System. Xml.Schema.XmlSchemaForm.Unqualified)>,
parameters are received, but the Delphi application requires that all
parameters are object, ie from a complex type.

Does anyone have an idea ?

Thanks.
Apr 25 '07 #1
3 5463
"Pierre" <Pi****@discussions.microsoft.comwrote in message
news:C4**********************************@microsof t.com...
Hello,

I have a .NET 2.0 web service that is consumed by a Delphi application.

The Delphi application calls a method from the .NET web service with
parameters.
Theses parameters are in the call message, which we can see through a HTTP
proxy. But the ASP.NET application does not received the parameter values,
it
recevices only null values.
When tagging the ASP.NET method parameters with
<System.Xml.Serialization.XmlElement(Form:=System. Xml.Schema.XmlSchemaForm.Unqualified)>,
parameters are received, but the Delphi application requires that all
parameters are object, ie from a complex type.

Does anyone have an idea ?

This sounds like a namespace issue. Which XML namespace are the parameters
in? You have not specified a namespace in your XmlElementAttribute.

What do you mean that Delphi requires "object"? I don't know Delphi, so I
don't know what you mean.

--

John Saunders [MVP]
Apr 25 '07 #2


"John Saunders [MVP]" wrote:
"Pierre" <Pi****@discussions.microsoft.comwrote in message
news:C4**********************************@microsof t.com...
Hello,

I have a .NET 2.0 web service that is consumed by a Delphi application.

The Delphi application calls a method from the .NET web service with
parameters.
Theses parameters are in the call message, which we can see through a HTTP
proxy. But the ASP.NET application does not received the parameter values,
it
recevices only null values.
When tagging the ASP.NET method parameters with
<System.Xml.Serialization.XmlElement(Form:=System. Xml.Schema.XmlSchemaForm.Unqualified)>,
parameters are received, but the Delphi application requires that all
parameters are object, ie from a complex type.

Does anyone have an idea ?


This sounds like a namespace issue. Which XML namespace are the parameters
in? You have not specified a namespace in your XmlElementAttribute.

What do you mean that Delphi requires "object"? I don't know Delphi, so I
don't know what you mean.

--

John Saunders [MVP]
The namespace is well defined in the ASP.NET web service on the class level
through the class attribute :

<System.Web.Services.WebService(Namespace:="http ://myweb.com/services/")_
Here is the request which is emitted by the Delphi consumer :

<?xml version="1.0"?>'#$D#$A'<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><NS1:MultiplyIntegers
xmlns:NS1="http://myweb.com/services/"><a xsi:type="xsd:int">30</a><b
xsi:type="xsd:int">25</b></NS1:MultiplyIntegers></SOAP-ENV:Body></SOAP-ENV:Envelope>

And here, the response of the ASP.NET webservice :

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><MultiplyIntegersResponse
xmlns="http://myweb.com/services/"><MultiplyIntegersResult>890</MultiplyIntegersResult></MultiplyIntegersResponse></soap:Body></soap:Envelope>

The 890 result means that a and b are empty in the ASP.NET webservice.

So, in this context, I added the XmlElement attribute for each parameters
(<System.Xml.Serialization.XmlElement(Form:=System .Xml.Schema.XmlSchemaForm.Unqualified)>).
At this point, parameters are well received by the ASP.NET web service
listener, but one the Delphi side, parameters aren't keep simple, as
explained above.
And so, to answer to the second point, when generating the proxy with the
WSDL file, Delphi sees complex data type even when a parameter is an int or a
string.
For example, for the multiplyinterger(a,b), Delphi exposes not a simple int
for a and b, but an object type in which there is a property named a and a
other one named b.

It is really bizarre. I ever thought that web services were universal, but
those compatibility issues are very perturbating.

Thanks for your help.

Pierre.

Apr 25 '07 #3
"Pierre" <Pi****@discussions.microsoft.comwrote in message
news:B9**********************************@microsof t.com...
>

"John Saunders [MVP]" wrote:
>"Pierre" <Pi****@discussions.microsoft.comwrote in message
news:C4**********************************@microso ft.com...
Hello,

I have a .NET 2.0 web service that is consumed by a Delphi application.

The Delphi application calls a method from the .NET web service with
parameters.
Theses parameters are in the call message, which we can see through a
HTTP
proxy. But the ASP.NET application does not received the parameter
values,
it
recevices only null values.
When tagging the ASP.NET method parameters with
<System.Xml.Serialization.XmlElement(Form:=System. Xml.Schema.XmlSchemaForm.Unqualified)>,
parameters are received, but the Delphi application requires that all
parameters are object, ie from a complex type.

Does anyone have an idea ?


This sounds like a namespace issue. Which XML namespace are the
parameters
in? You have not specified a namespace in your XmlElementAttribute.

What do you mean that Delphi requires "object"? I don't know Delphi, so I
don't know what you mean.

--

John Saunders [MVP]

The namespace is well defined in the ASP.NET web service on the class
level
through the class attribute :

<System.Web.Services.WebService(Namespace:="http ://myweb.com/services/")>
_
Try also putting it on the XmlElement/XmlAttribute. I'm sure that the
namespace on WebService sets the targetNamespace for the WSDL, but I'm not
sure what else it does.
Here is the request which is emitted by the Delphi consumer :

<?xml version="1.0"?>'#$D#$A'<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><NS1:MultiplyIntegers
xmlns:NS1="http://myweb.com/services/"><a xsi:type="xsd:int">30</a><b
xsi:type="xsd:int">25</b></NS1:MultiplyIntegers></SOAP-ENV:Body></SOAP-ENV:Envelope>

And here, the response of the ASP.NET webservice :

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><MultiplyIntegersResponse
xmlns="http://myweb.com/services/"><MultiplyIntegersResult>890</MultiplyIntegersResult></MultiplyIntegersResponse></soap:Body></soap:Envelope>

The 890 result means that a and b are empty in the ASP.NET webservice.
Really? Why does it mean this? Could you have your service return -1 or
throw an exception if it sees empty parameters? That way we'd be sure this
is what was happening.
So, in this context, I added the XmlElement attribute for each parameters
(<System.Xml.Serialization.XmlElement(Form:=System .Xml.Schema.XmlSchemaForm.Unqualified)>).
At this point, parameters are well received by the ASP.NET web service
listener, but one the Delphi side, parameters aren't keep simple, as
explained above.
And so, to answer to the second point, when generating the proxy with the
WSDL file, Delphi sees complex data type even when a parameter is an int
or a
string.
Did you try using the DataType property of XmlElementAttribute?

For example, for the multiplyinterger(a,b), Delphi exposes not a simple
int
for a and b, but an object type in which there is a property named a and a
other one named b.

It is really bizarre. I ever thought that web services were universal, but
those compatibility issues are very perturbating.
Web Services _are_ universal. You'll find that if you send and receive SOAP
messages using XML and HTTP, then Web Services will work perfectly. The
problem comes in when we use these darned programming languages, development
tools and software platforms. Sometimes you have to figure out how _they_
expect to deal with Web Services.
--

John Saunders [MVP]
Apr 26 '07 #4

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

Similar topics

3
1633
by: Blitz Krieg | last post by:
Oh Great Gurus... The wisdom of DotNet-dom is needed... We have several applications in our test lab, that do not need peak performance, but consistent reporting. We have been using C# and VB...
2
1869
by: karl | last post by:
I have a windows service that kicks off a 'monitor' thread which in turn kicks off 4 additional threads. These 4 threads basically are listen on a designated socket and report back any errors...
0
1268
by: Tressa | last post by:
Sorry to be such a novice about this but..... I have a windows service. It contains two separate files. Both have the same namespace name. I need to pass "bDisplay" into the other file. I am...
6
1941
by: Chakkaradeep | last post by:
hi all, I have written a C# Service which is a Server accepting Clients,It is working fine when i connect from localhost but when i connect from any other machine to my machine , the service is...
4
6428
by: cmgarcia17 | last post by:
I have two windows services that I've written: the first is a "Listener Service" that listens for MSMQ Message delivery. The second is a "Watcher Service" that monitors the state of the first. If...
3
10300
by: jwpaco | last post by:
I am new to services and I have quite the task. I need a windows service that will, once started, open a socket and listen for client connections. When a connection is made, the client will want...
2
1271
by: NightHawk | last post by:
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...
5
38817
by: mivey4 | last post by:
Hi, First off, I am aware that this is a very heavily documented error and I have done my homework for throughly researching probable causes before deciding to post my problem here. At this point,...
2
1559
by: TonyJ | last post by:
Hello! Below I have the two methods OnStart and Start that are relevant to my question. If I do net start TimeServerService I will see something like Service TimeServerService starting...
0
7202
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
7278
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
7328
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
7458
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...
0
4672
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...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
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 ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.