473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

SOAP Authorization

Hey there.

I recently stumbled upon the "Projekt Deutscher Wortschatz" (project
german vocabulary) of the Leipzig Univesity, Germany, which is somewhat
similar to Princeton's WordNet project.
The Leipzig University provides a SOAP-based web interface that is
briefly described here >
http://wortschatz.uni-leipzig.de/axi...verviewServlet <

Since I never ever used SOAP programmatically I throught it would be a
nice idea to start right away with the "ServiceOverview" function they
provide.

So I fired up VS and added the WSDL file
http://wortschatz.uni-leipzig.de/axi...eOverview?wsdl
as a web reference.

The ping method works fine, but if I execute() the class, a
SoapException is fired stating that I should provide a username.
Since there is no function for that and the Java examples show that they
are not sent as a execute() argument, I'm not sure what to do.

I found a example on the net that introduced a CredentialCache to me,
which I tried to use, without success.

By now the code looks like this:

~~ snip ~~

using System.Net;
using Test.de.uni_leipzig.wortschatz;

namespace Test
{
class Program
{
static void Main(string[] args)
{
ServiceOverviewService sos =
new ServiceOverviewService();

CredentialCache cache = new CredentialCache();
cache.Add(
new Uri(sos.Url),
"Basic",
new NetworkCredential(
"anonymous",
"anonymous"
));
cache.Add(
new Uri(sos.Url),
"Digest",
new NetworkCredential(
"anonymous",
"anonymous"
));
sos.Credentials = cache;

RequestParameter param = new RequestParameter();
param.corpus = "services"; // whatever ...

ResponseParameter response = sos.execute(param);
}
}
}
~~ snap ~~

As I said, the execute() line throws the exception:

~~ snip ~~

System.Web.Services.Protocols.SoapException was unhandled
Message="Please enter a username!"
Source="System.Web.Services"
Actor=""
Lang=""
Node=""
Role=""
StackTrace:
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at
Test.de.uni_leipzig.wortschatz.ServiceOverviewServ ice.execute(RequestParameter
objRequestParameters) in I:\dev\EigeneSources\Test.root\Test\Test\Web
References\de.uni-leipzig.wortschatz\Reference.cs:line 84
at Test.Program.Main(String[] args) in
I:\dev\EigeneSources\Test.root\Test\Test\Program.c s:line 23
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

~~ snap ~~
There are plenty of examples on this using Java or Perl, both give
username and password within a SOAP connection object's constructor -
which I don't have in VS.
I tried to add the authentication to the URL so that it is
http://anonymous:anonymous@...etc...
without success.

Can anyone help me out with this?
Best regards,
Markus
Dec 21 '06 #1
4 3269
You are using "servlet" I realized. So what web server are you using? IIS?
If you not using IIS then I think it is a bit hard for VS to handle it.

chanmm

"Markus Mayer" <ne*******@defx.dewrote in message
news:O$*************@TK2MSFTNGP06.phx.gbl...
Hey there.

I recently stumbled upon the "Projekt Deutscher Wortschatz" (project
german vocabulary) of the Leipzig Univesity, Germany, which is somewhat
similar to Princeton's WordNet project.
The Leipzig University provides a SOAP-based web interface that is briefly
described here >
http://wortschatz.uni-leipzig.de/axi...verviewServlet <

Since I never ever used SOAP programmatically I throught it would be a
nice idea to start right away with the "ServiceOverview" function they
provide.

So I fired up VS and added the WSDL file
http://wortschatz.uni-leipzig.de/axi...eOverview?wsdl
as a web reference.

The ping method works fine, but if I execute() the class, a SoapException
is fired stating that I should provide a username.
Since there is no function for that and the Java examples show that they
are not sent as a execute() argument, I'm not sure what to do.

I found a example on the net that introduced a CredentialCache to me,
which I tried to use, without success.

By now the code looks like this:

~~ snip ~~

using System.Net;
using Test.de.uni_leipzig.wortschatz;

namespace Test
{
class Program
{
static void Main(string[] args)
{
ServiceOverviewService sos =
new ServiceOverviewService();

CredentialCache cache = new CredentialCache();
cache.Add(
new Uri(sos.Url),
"Basic",
new NetworkCredential(
"anonymous",
"anonymous"
));
cache.Add(
new Uri(sos.Url),
"Digest",
new NetworkCredential(
"anonymous",
"anonymous"
));
sos.Credentials = cache;

RequestParameter param = new RequestParameter();
param.corpus = "services"; // whatever ...

ResponseParameter response = sos.execute(param);
}
}
}
~~ snap ~~

As I said, the execute() line throws the exception:

~~ snip ~~

System.Web.Services.Protocols.SoapException was unhandled
Message="Please enter a username!"
Source="System.Web.Services"
Actor=""
Lang=""
Node=""
Role=""
StackTrace:
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at
Test.de.uni_leipzig.wortschatz.ServiceOverviewServ ice.execute(RequestParameter
objRequestParameters) in I:\dev\EigeneSources\Test.root\Test\Test\Web
References\de.uni-leipzig.wortschatz\Reference.cs:line 84
at Test.Program.Main(String[] args) in
I:\dev\EigeneSources\Test.root\Test\Test\Program.c s:line 23
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

~~ snap ~~
There are plenty of examples on this using Java or Perl, both give
username and password within a SOAP connection object's constructor -
which I don't have in VS.
I tried to add the authentication to the URL so that it is
http://anonymous:anonymous@...etc...
without success.

Can anyone help me out with this?
Best regards,
Markus
Dec 22 '06 #2
Chan Ming Man, 22.12.2006 11:42:
You are using "servlet" I realized. So what web server are you using?
IIS? If you not using IIS then I think it is a bit hard for VS to handle
it.
Hi,

It is not /my/ server, but as far as I know, it is driven by Java (on
Apache - but this is an assumption).

Regards,
Markus
Dec 22 '06 #3
Hi,
Am Thu, 21 Dec 2006 19:38:27 +0100 schrieb Markus Mayer:
Hey there.

I recently stumbled upon the "Projekt Deutscher Wortschatz" (project
german vocabulary) of the Leipzig Univesity, Germany, which is somewhat
similar to Princeton's WordNet project.
The Leipzig University provides a SOAP-based web interface that is
briefly described here >
http://wortschatz.uni-leipzig.de/axi...verviewServlet <

Since I never ever used SOAP programmatically I throught it would be a
nice idea to start right away with the "ServiceOverview" function they
provide.

So I fired up VS and added the WSDL file
http://wortschatz.uni-leipzig.de/axi...eOverview?wsdl
as a web reference.

The ping method works fine, but if I execute() the class, a
SoapException is fired stating that I should provide a username.
Since there is no function for that and the Java examples show that they
are not sent as a execute() argument, I'm not sure what to do.

I found a example on the net that introduced a CredentialCache to me,
which I tried to use, without success.

By now the code looks like this:

~~ snip ~~

using System.Net;
using Test.de.uni_leipzig.wortschatz;

namespace Test
{
class Program
{
static void Main(string[] args)
{
ServiceOverviewService sos =
new ServiceOverviewService();

CredentialCache cache = new CredentialCache();
cache.Add(
new Uri(sos.Url),
"Basic",
new NetworkCredential(
"anonymous",
"anonymous"
));
cache.Add(
new Uri(sos.Url),
"Digest",
new NetworkCredential(
"anonymous",
"anonymous"
));
sos.Credentials = cache;

RequestParameter param = new RequestParameter();
param.corpus = "services"; // whatever ...

ResponseParameter response = sos.execute(param);
}
}
}

[...]
There are plenty of examples on this using Java or Perl, both give
username and password within a SOAP connection object's constructor -
which I don't have in VS.
I tried to add the authentication to the URL so that it is
http://anonymous:anonymous@...etc...
without success.

Can anyone help me out with this?
Best regards,
Markus
look at this:
http://mark.michaelis.net/Blog/defau...?month=2005-03
and don't forget
http://forums.microsoft.com/msdn/sho...12770&siteid=1

Best regards
Ron
Dec 28 '06 #4
Ronald Siegel, 28.12.2006 19:07:
look at this:
http://mark.michaelis.net/Blog/defau...?month=2005-03
and don't forget
http://forums.microsoft.com/msdn/sho...12770&siteid=1

Best regards
Ron
I'll have a look at it! Thanks so far!
Markus
Jan 24 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mmorrison93 | last post by:
I have a question about adding a soap header to a soap request. I'm currently trying to consume a web service that requires that I place authorization information in the header. The proxy class...
6
by: john deviney | last post by:
I have a C#/.Net 1.1 client talking to a Java based web service. I need to insert a soap header on the client side which is expected on the server side. Currently, the Java ws provider, Axis, does...
1
by: Tony Stephens | last post by:
Hi, I've created a small forms based application in c# to test a vendor's product and the web service interface that it exposes. We have deployed two instances of the vendor product one which...
2
by: Kevin Eldridge | last post by:
Hi, I'm trying to call a java web service and i need some help in creating a custom SOAP header in c#. I need to access to a Web service that implements authorization policy, by using a session...
4
by: Joseph Geretz | last post by:
We use a Soap Header to pass a token class (m_Token) back and forth with authenticated session information. Given the following implementation for our Logout method, I vastly prefer to simply code...
6
by: John | last post by:
I'm trying to call a Webservice (Non-.NET) That requires the insertion of security credentials into the SOAP header. Up until know I've been creating Dynamic proxy classes to call web services and...
2
by: furrypop | last post by:
Hi, I'm trying to get the Perl SOAP::Lite examples to work on a Windows PC, running Apache 2.2.4. Apache is definitely serving CGI scripts, as I've tested a dummy Hello World thing. I'm also...
2
by: Enda Manni | last post by:
Hi, I have a gSoap Web Service written using C++, it uses SOAP username and password authentication. I also have a C# form client consuming the web service, all this was working fine until I...
3
by: Enda Manni | last post by:
Hi, I have a gSoap Web Service written using C++, it uses SOAP username and password authentication. I also have a C# form client consuming the web service, all this was working fine until...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.