| View previous topic :: View next topic |
| Author |
Message |
Broeden Guest
|
Posted: Wed Sep 06, 2006 1:23 am Post subject: Can’t send parameter via web services call |
|
|
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
} |
|
| Back to top |
|
 |
Bob Swart Guest
|
Posted: Wed Sep 06, 2006 1:28 am Post subject: Re: Can’t send parameter via web se rvices call |
|
|
Hi Broeden,
| Quote: | Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
|
Perhaps you should enable the ioDocument option in the Delphi Win32
import unit for the web service unit.
InvRegistry.RegisterInvokeOptions(TypeInfo(IWebShopSoap), ioDocument);
(where the IWebShopSoap should be the name of your soap interface.
Groetjes,
Bob Swart
--
Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
Blog: http://www.drbob42.com/blog - RSS: http://drbob42.com/weblog.xml
New Delphi 2006 Courseware e-books at http://www.eBob42.com/courseware |
|
| Back to top |
|
 |
Ray Crisp Guest
|
Posted: Mon Sep 18, 2006 5:54 pm Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
The key is to add an InvRegistry command into what is imported from the WSDL. The line you must add is:
InvRegistry.RegisterInvokeOptions(TypeInfo(ServiceSoap),[ioDefault, ioDocument, ioHasReturnParamNames, ioHasNamespace]);
This is added at the bottom in the initialization part. Also, very important, it must be the LAST InvRegistry command. It should come after the InvRegistry.RegisterInterface and InvRegistry.RegisterDefaultSOAPAction.
In your Delphi code, you drop down a HHTTPRIO object from the WebServices tab onto your form. You'll want to also add a USE to use the unit you imported from WSDL. The source would look like this:
procedure TForm1.Button1Click(Sender: TObject);
var
QSERVICE : ServiceSoap;
begin
QSERVICE := (HTTPRIO1 as ServiceSoap);
Memo1.Text := QSERVICE.WebProcedure('ABC','123');
end
Posted from http://www.topxml.com/renntp using reNNTP: the website based NNTP reader. |
|
| Back to top |
|
 |
daniel Guest
|
Posted: Wed Dec 06, 2006 9:12 am Post subject: Re: Can’t send parameter via web services call |
|
|
Thanks Bob!
Had the same problem. Works like a charm now :)
"Bob Swart" <b.swart (AT) chello (DOT) nl> wrote in message
news:44FDDE0B.5050608 (AT) chello (DOT) nl...
| Quote: | Hi Broeden,
Is it some kind of compatibility problem? I have tried to send a string
instead but it’s always null
Perhaps you should enable the ioDocument option in the Delphi Win32 import
unit for the web service unit.
InvRegistry.RegisterInvokeOptions(TypeInfo(IWebShopSoap), ioDocument);
(where the IWebShopSoap should be the name of your soap interface.
Groetjes,
Bob Swart
--
Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
Blog: http://www.drbob42.com/blog - RSS: http://drbob42.com/weblog.xml
New Delphi 2006 Courseware e-books at http://www.eBob42.com/courseware |
|
|
| Back to top |
|
 |
Very nice site! Good work Guest
|
Posted: Wed Feb 28, 2007 9:14 am Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
Very nice site! Good work. http://www.sessit.port5.com
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
Great site you http://phe Guest
|
Posted: Fri Mar 09, 2007 6:16 pm Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
Great site you http://phentermine0.phpbbx.de
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
Nice site you have! http: Guest
|
Posted: Mon Mar 12, 2007 8:12 am Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
Nice site you have! http://www.paradistc.org/giorgia-palmas
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
Du musst ein Fachmann sei Guest
|
Posted: Thu Mar 15, 2007 12:31 am Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
Du musst ein Fachmann sein - wirklich guter Aufstellungsort, den du hast! http://www.paradistc.org/liberi
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
pagine piuttosto informat Guest
|
Posted: Sat Mar 17, 2007 12:23 am Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
pagine piuttosto informative, piacevoli =) http://www.sanzkdni59.org/bikini
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
luogo grande:) nessun oss Guest
|
Posted: Sun Mar 18, 2007 3:49 pm Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
luogo grande:) nessun osservazioni! http://www.paradistc.org/sardinia
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
Great site! Good luck to Guest
|
Posted: Tue Mar 20, 2007 6:48 am Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
Great site! Good luck to it's owner! http://www.sanzkdni59.org/serie-a
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
Lavoro eccellente! ..ring Guest
|
Posted: Wed Mar 21, 2007 2:34 am Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
Lavoro eccellente! ..ringraziamenti per le informazioni..realmente lo apprezzo: D http://www.sanzkdni59.org/del-piero
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
Interessieren. SEHR inter Guest
|
Posted: Sat Mar 31, 2007 7:57 am Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
Interessieren. SEHR interessant! http://www.circumno3.org/sesso
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
Du musst ein Fachmann sei Guest
|
Posted: Sat Mar 31, 2007 8:13 am Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
Du musst ein Fachmann sein - wirklich guter Aufstellungsort, den du hast! http://www.circumno3.org/guerra
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
L'information interessant Guest
|
Posted: Sat Mar 31, 2007 4:10 pm Post subject: RE: Can’t send parameter via web services call |
|
|
| Quote: |
I’m trying to consume a web services (written I C#) via Delphi 2005.
The problem is that the parameter is not send. If I rewrite the web service not to expect any parameter everything works OK. But if I use an integer parameter the value send over is always 0.
Is it some kind of compatibility problem? I have tried to send a string instead but it’s always null
WebShop webservice imported using WSDL importer
Am I missing something obvious?
Delphi Code using D2005
procedure TForm2.Button1Click(Sender: TObject);
var myArticle: Article;
begin
myArticle := GetWebShopSoap.GetArticleNoPar; // Works
ShowMessage(myArticle.Name);
myArticle := GetWebShopSoap.GetArticle(1); // Does not Work
ShowMessage(myArticle.Name);
end;
C# code using VS2005 (simplified)
[WebMethod(Description = "Returns an article")]
public Article GetArticle(int articleNr)
{
Return GetArticle(articleNr); // articleNr always 0
}
[WebMethod(Description = "Returns an article")]
public Article GetArticleNoPar()
{
Return GetArticle(1);
}
|
L'information interessante que vous avez! I'am allant revenir bientot. http://www.qukeartiere90.org/valentino-rossi
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
|