By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
"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

P: n/a


"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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.