473,727 Members | 1,985 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.Ser ialization.XmlE lement(Form:=Sy stem.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 5478
"Pierre" <Pi****@discuss ions.microsoft. comwrote in message
news:C4******** *************** ***********@mic rosoft.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.Ser ialization.XmlE lement(Form:=Sy stem.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 XmlElementAttri bute.

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****@discuss ions.microsoft. comwrote in message
news:C4******** *************** ***********@mic rosoft.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.Ser ialization.XmlE lement(Form:=Sy stem.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 XmlElementAttri bute.

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.Ser vices.WebServic e(Namespace:="h ttp://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:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/"><NS1:Multiply Integers
xmlns:NS1="http ://myweb.com/services/"><a xsi:type="xsd:i nt">30</a><b
xsi:type="xsd:i nt">25</b></NS1:MultiplyInt egers></SOAP-ENV:Body></SOAP-ENV:Envelope>

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

<?xml version="1.0" encoding="utf-8"?><soap:Envel ope
xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"><soa p:Body><Multipl yIntegersRespon se
xmlns="http://myweb.com/services/"><MultiplyInte gersResult>890</MultiplyInteger sResult></MultiplyInteger sResponse></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.Se rialization.Xml Element(Form:=S ystem.Xml.Schem a.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 multiplyinterge r(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****@discuss ions.microsoft. comwrote in message
news:B9******** *************** ***********@mic rosoft.com...
>

"John Saunders [MVP]" wrote:
>"Pierre" <Pi****@discuss ions.microsoft. comwrote in message
news:C4******* *************** ************@mi crosoft.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.Ser ialization.XmlE lement(Form:=Sy stem.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 XmlElementAttri bute.

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.Ser vices.WebServic e(Namespace:="h ttp://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:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/"><NS1:Multiply Integers
xmlns:NS1="http ://myweb.com/services/"><a xsi:type="xsd:i nt">30</a><b
xsi:type="xsd:i nt">25</b></NS1:MultiplyInt egers></SOAP-ENV:Body></SOAP-ENV:Envelope>

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

<?xml version="1.0" encoding="utf-8"?><soap:Envel ope
xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"><soa p:Body><Multipl yIntegersRespon se
xmlns="http://myweb.com/services/"><MultiplyInte gersResult>890</MultiplyInteger sResult></MultiplyInteger sResponse></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.Se rialization.Xml Element(Form:=S ystem.Xml.Schem a.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 XmlElementAttri bute?

For example, for the multiplyinterge r(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
1655
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 ..NET because of the ease of use. However, each application has a significant percentage of code that is replicated in each application... true it is assembly based and not a big deal to include, but there must be a better way. We have our own...
2
1886
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 (exceptions) to the monitor thread. Of course, all works well on my box. Yesterday I installed the .NET Framework 1.1 on a new server and then installed my service. It appears that everything is starting but when I perform a netstat - a...
0
1301
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 getting several errors and not sure why or how to solve them does anyone have any help? How do I access the other file? ServerSocket.cs *This is where the main server start is so the" private bool m_bIsDisplayed = false;" had to go here so it...
6
1960
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 not working, the Service is in "Network Service".....i even tried "Local System" and also "Local Service" but the end result is , it is working only for Localhost connections and not for Remote Connections... the code for server is as follows..
4
6452
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 the "Listener Service" goes down I want the "Watcher Service" to receive a notification and perform a set action. To enable this communication I've written a separate assembly (that both services reference) that exposes two interfaces :...
3
10350
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 the service to query the db and return a value. This is for use with an IVR system. Basically, a customer will callin and request some account information and the service will need to qoery the db and return an answer to the customer through the...
2
1282
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 variable which is held as an object. When I get the object in the proxy, it is an XmlNode with 2 elementsXmlNode is an XmlAttribute, and XmlNode is an XmlText. The XmlAttribute contains the correct information about the data type, and the XmlText...
5
38832
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, I believe another set of eyes on the issue is merited. I am a MSSQL DBA and somewhat new to ORACLE; but I have read the administrators manual having a basic thorough level of knowledge (Tho' I am still learning) and understanding of how to...
2
1568
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 ......... It wasn't possible to start the service TimeServerService The reason for this it that OnStart doesn't return becuse it will stuck in a loop in the Start metod.
0
8891
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
9260
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
9120
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...
0
8103
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, 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...
0
6011
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
4521
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...
0
4786
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
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
3
2158
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.