Webservice call from extended stored procedure

G

Guest

I'm trying to write an extended stored procedure that will call a webservice
First I wrote a console application and made the call

localhost::WsXpService* xsp = new localhost::WsXpService()
String* s = String::Copy(xsp->WsXpMethod2())

This works fine
But when I put the same code (same reference) into my XP procedure code I cannot even compile it?
What's wrong?
/Folke
 
S

Sven Carstensen

Hi Folke,

Folke said:
I'm trying to write an extended stored procedure that will call a webservice.
First I wrote a console application and made the call:

localhost::WsXpService* xsp = new localhost::WsXpService();
String* s = String::Copy(xsp->WsXpMethod2());

This works fine.
But when I put the same code (same reference) into my XP procedure code I cannot even compile it??
What's wrong??

What errors do you get?
How did you start/create your XP procedure project?

Bye,
SvenC
 
G

Guest

Created : VS .NET 2003 Visual C++ Extended Stored Procedure .dl

Compile Error
c:\Folke\VCNet\TestXP\proc.cpp(58): error C2061: syntax error : identifier 'WsXpService
c:\Folke\VCNet\TestXP\proc.cpp(58): error C2065: 'xsp' : undeclared identifie
c:\Folke\VCNet\TestXP\proc.cpp(58): error C2653: 'localhost' : is not a class or namespace nam
c:\Folke\VCNet\TestXP\proc.cpp(58): error C2653: 'localhost' : is not a class or namespace nam
c:\Folke\VCNet\TestXP\proc.cpp(58): error C2882: 'WsXpService' : illegal use of namespace identifier in expressio
c:\Folke\VCNet\TestXP\proc.cpp(59): error C2064: term does not evaluate to a function taking 1 argument
c:\Folke\VCNet\TestXP\proc.cpp(59): error C2065: 's' : undeclared identifie
c:\Folke\VCNet\TestXP\proc.cpp(59): error C2065: 'String' : undeclared identifie
c:\Folke\VCNet\TestXP\proc.cpp(59): error C2227: left of '->WsXpMethod2' must point to class/struct/unio
c:\Folke\VCNet\TestXP\proc.cpp(59): error C3861: 'xsp': identifier not found, even with argument-dependent looku
 
S

Sven Carstensen

Hi Folke,

Folke said:
Created : VS .NET 2003 Visual C++ Extended Stored Procedure .dll

Compile Error:
c:\Folke\VCNet\TestXP\proc.cpp(58): error C2061: syntax error : identifier 'WsXpService'
c:\Folke\VCNet\TestXP\proc.cpp(58): error C2065: 'xsp' : undeclared identifier
c:\Folke\VCNet\TestXP\proc.cpp(58): error C2653: 'localhost' : is not a class or namespace name
c:\Folke\VCNet\TestXP\proc.cpp(58): error C2653: 'localhost' : is not a class or namespace name
c:\Folke\VCNet\TestXP\proc.cpp(58): error C2882: 'WsXpService' : illegal
use of namespace identifier in expression
c:\Folke\VCNet\TestXP\proc.cpp(59): error C2064: term does not evaluate to a function taking 1 arguments
c:\Folke\VCNet\TestXP\proc.cpp(59): error C2065: 's' : undeclared identifier
c:\Folke\VCNet\TestXP\proc.cpp(59): error C2065: 'String' : undeclared identifier
c:\Folke\VCNet\TestXP\proc.cpp(59): error C2227: left of '->WsXpMethod2'
must point to class/struct/union
c:\Folke\VCNet\TestXP\proc.cpp(59): error C3861: 'xsp': identifier not
found, even with argument-dependent lookup


Did you enable "Use Managed Extensions" in your general project properties?
Did you add a "Web Reference" to the WebService? If yes, is the resulting
code ATL or CLR based? You can verify this by looking at the proxy in the
generated header: Is there an #include of <atlsoap.h> or using namespace
System::Web::Services?


HTH,
SvenC
 
G

Guest

Sven!
Thanks for all your help. The code below now compiles:
localhost::WsXpService* xsp = new localhost::WsXpService();
System::String __gc* gcstr;
gcstr = System::String::Copy(xsp->WsXpMethod2());
Not sure why I have to put th __gc after System::String ?? (Can I only have data on the managed heap?)
Now I'll try to get it to work at run-time!
/Folke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top