BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can’t send parameter via web services call
Goto page 1, 2  Next
 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi WebServices SOAP
View previous topic :: View next topic  
Author Message
Broeden
Guest





PostPosted: Wed Sep 06, 2006 1:23 am    Post subject: Can’t send parameter via web services call Reply with 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);
}
Back to top
Bob Swart
Guest





PostPosted: Wed Sep 06, 2006 1:28 am    Post subject: Re: Can’t send parameter via web se rvices call Reply with quote



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





PostPosted: Mon Sep 18, 2006 5:54 pm    Post subject: RE: Can’t send parameter via web services call Reply with quote



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





PostPosted: Wed Dec 06, 2006 9:12 am    Post subject: Re: Can’t send parameter via web services call Reply with quote

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





PostPosted: Wed Feb 28, 2007 9:14 am    Post subject: RE: Can’t send parameter via web services call Reply with quote

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





PostPosted: Fri Mar 09, 2007 6:16 pm    Post subject: RE: Can’t send parameter via web services call Reply with quote

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





PostPosted: Mon Mar 12, 2007 8:12 am    Post subject: RE: Can’t send parameter via web services call Reply with quote

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





PostPosted: Thu Mar 15, 2007 12:31 am    Post subject: RE: Can’t send parameter via web services call Reply with quote

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





PostPosted: Sat Mar 17, 2007 12:23 am    Post subject: RE: Can’t send parameter via web services call Reply with quote

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





PostPosted: Sun Mar 18, 2007 3:49 pm    Post subject: RE: Can’t send parameter via web services call Reply with quote

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





PostPosted: Tue Mar 20, 2007 6:48 am    Post subject: RE: Can’t send parameter via web services call Reply with quote

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





PostPosted: Wed Mar 21, 2007 2:34 am    Post subject: RE: Can’t send parameter via web services call Reply with quote

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





PostPosted: Sat Mar 31, 2007 7:57 am    Post subject: RE: Can’t send parameter via web services call Reply with quote

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! Wink 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





PostPosted: Sat Mar 31, 2007 8:13 am    Post subject: RE: Can’t send parameter via web services call Reply with quote

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





PostPosted: Sat Mar 31, 2007 4:10 pm    Post subject: RE: Can’t send parameter via web services call Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi WebServices SOAP All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.