473,473 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VB.NET - Multiple parameters with the same name in a WebMethod

4 New Member
Hi,

I'm building a VB.Net webMethod that need to receive an already built Soap request, and that request cannot be changed, as it's already in use in our other server, so I'm stuck with it. Actually, the request is made from a PHP script on a Appache server, but the webmethod need to be on an IIS server, using preferably VB.Net.

The exact problem is that the call is built with two parameters, but they have the same names (soapVal). In PHP and Perl (the two language already using this request), they just call the parameters like an array, the names being insignificant.

I tried doing the same using an array having the same name as the parameters in the request, but that did not work. I also tried doing it with a ParamArray, but to no avail.

Is there a way to do this, or am I stuck in doing it in another language/technology?

Thanks in advance
Jan 30 '08 #1
5 2686
Plater
7,872 Recognized Expert Expert
Does it matter what you name the arguments on the VBNet side?
I'm not overly familiar with soap though.

Shouldn't
Expand|Select|Wrap|Line Numbers
  1. void SomeFunction(int a, int b)
  2.  
be the same as
Expand|Select|Wrap|Line Numbers
  1. void SomeFunction(int atemp, int btemp)
  2.  
Jan 30 '08 #2
elTonio
4 New Member
It's what I though, and how I programmed it at first. But when I tested it, I was faced with errors. My parameters are not populated, and the original parameters seem lost.

Here is the body part of the soap envelope I receive:
Expand|Select|Wrap|Line Numbers
  1. <SOAP-ENV:Body>
  2. <ns1:getInfo2 xmlns:ns1="http://www.mysite.com/Boutique/Gestion/ws/Commande">
  3. <soapVal xsi:type="xsd:int">2107</soapVal>
  4. <soapVal xsi:type="xsd:string">12345</soapVal>
  5. </ns1:getInfo2>
  6. </SOAP-ENV:Body>
Simply renaming the two parameters soapVal to different names, like soapVal and soapVal2, corrects everything. But it was made clear to me that it is not possible.

Any idea?
Jan 30 '08 #3
Plater
7,872 Recognized Expert Expert
Simply renaming the two parameters soapVal to different names, like soapVal and soapVal2, corrects everything. But it was made clear to me that it is not possible.
I take it whoever told you that was either some higher up who knows nothing about this stuff, or the guy who originally did it that way, and doesn't want to have to fix the very obvious mistake he made. Either way it is unfortunate for you.

I am still a bit unclear on some things though.
Like as a soap request you have to build that string yes? And then send it out TO the webservice?
Or do I have this backwards, and you are to be REPLACING the previous webservice and as such, must handle incoming soap requests of that type?
Jan 30 '08 #4
elTonio
4 New Member
Or do I have this backwards, and you are to be REPLACING the previous webservice and as such, must handle incoming soap requests of that type?
It's almost that. I'm not replacing an existing service, but replicating the effect of another one. It's for an e-payment application. Here is the structure:

I prepare the order on my site, and when ready I call the Apache server for the payment. I pass to it the transaction number. Then, the Apache server make a Soap call to get the other informations needed for the transaction: amount, taxe, kart content, etc. They pass to me two parameters: the original transaction number I sent them and a siteId. They then proceed with the credit verification (they obtain the credit card number on their own site), show the result to the client and once the transaction is complete they return him to my site.

They are already live, and they have several functioning applications, all in Perl or PHP, who implemented their own werbservices to listen to the payment server call.

My site was bought some months ago, with the IIS servers and technology. I now need (no choice) to use their payment server, and so need to replicate that function, without the possibility of adjusting the soap call.

Is it clearer?
Jan 30 '08 #5
elTonio
4 New Member
Finally, I ended up parsing the xml envelope and fetching the values directly in it, with the help of a regex function.
Feb 12 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
12
by: shank | last post by:
I'm trying to use online samples for submitting multiple records from ASP into a stored procedure. Failing! Through the below form, a user could be submitting many records at a time. I'm not...
5
by: Jeff | last post by:
We are using .Net and the wsdl Utility to generate proxies to consume web services built using the BEA toolset. The data architects on the BEA side create XML schemas with various entities in...
0
by: Peter Theill | last post by:
I have these two web services: namespace WebService1 { public class Service1 : System.Web.Services.WebService { public Service1() { } public string HelloWorld() {
1
by: MuZZy | last post by:
Hi, My problem is the following: i have a class like: class c{ public DataSet m_dsFirst; public DataSet m_dsSecond; public string m_sName; void c() {
4
by: =?Utf-8?B?QWw=?= | last post by:
Hello, I'm writing a service using VS2005 and C#. I've found that only the objects used as parameters in WebMethods get exported to proxy dlls and the Service Description. I'd like my service...
7
by: Sam Shrefler | last post by:
I'm working on creating a WebService / WebMethod to receive a record in real time from another system. The record contains about 20 fields. 10 of which aren't required. I was planning on just...
1
by: Glenn | last post by:
I am writing a Web Service in C# ASP.NET 2.0 that takes two optional parameters. One is an int and the other is a string. Below is the definition of the Web Method: public...
8
by: Rory Becker | last post by:
Hi All I have a need for an asp.net page to make a call to a server which it did not originate from when a button is clicked. A simple call to pass 2-3 params and return a result. I am happy...
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
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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.