Can not call Java WSDL-WebService from C#?

D

Dominik

Hi there!

I am trying to invoke a method of a webservice that was created in
java. they provided a java client to test the service and everything
is fine, but I actually prefer C# :) So I add a reference to this
webservice:
http://wortschatz.uni-leipzig.de/axis/servlet/ServiceOverviewServlet


Regarding to the description at http://wortschatz.uni-leipzig.de/Webservices/
I have to set "anonymous" as user and password. As the service itself
doesn't provide parameters for that, I added it as ClientCredentials
like this:

Baseform.BaseformClient baseForm = new Baseform.BaseformClient();
baseForm.ClientCredentials.UserName.UserName = "anonymous";
baseForm.ClientCredentials.UserName.Password =
"anonymous";
baseForm.Open();


Which worked fine so far, but I am not able to a call the method,
because it always tells me that I have to enter a username as well
(altough I do with the ClientCredetials).

My guess is that there are some interop problems with Java WebServices
and C#, as I can proove that the service itself works, I would like to
know, how I can manage to call the service from C#??

Thank you,
Dominik
 
D

Dominik

* Dominik said:
Regarding to the description athttp://wortschatz.uni-leipzig.de/Webservices/
I have to set "anonymous" as user and password. As the service itself
doesn't provide parameters for that, I added it as ClientCredentials
like this:
Baseform.BaseformClient baseForm = new Baseform.BaseformClient();
baseForm.ClientCredentials.UserName.UserName = "anonymous";
baseForm.ClientCredentials.UserName.Password =
"anonymous";
baseForm.Open();
Which worked fine so far, but I am not able to a call the method,
because it always tells me that I have to enter a username as well
(altough I do with the ClientCredetials).

I assume you are using WCF (System.ServiceModel namespace)? Then Open()
doesn't trigger any communication, only the first call will, so the
behavior you experience is just natural.

Do you specify the "security" setting anywhere? With a BasicHttpBinding
(SOAP 1.1), this defaults to "none", so your username and password will
never be used. Try setting it to "Message" (or, maybe, "Transport" if
the service requires it, but i doubt that).

Regards, Felix

--
 Felix Palmen       (Zirias)  + [PGP] Felix Palmen <[email protected]>
 web:  http://palmen-it.de/ |            http://palmen-it.de/pub.txt
 my open source projects:     |   Fingerprint: ED9B 62D0 BE39 32F9 2488
 http://palmen-it.de/?pg=pro +                5D0C 8177 9D80 5ECF F683

I tried a WCF Service and a SOAP Service. Unfortuantelly I can not
tell exactly it requires this username and password, because the Java
Testclient that you can download from
http://wortschatz.uni-leipzig.de/axis/servlet/ServiceOverviewServlet
does somehow NOT trigger Fiddler to log the call, so I can not
reproduce it :-(

Is it working with you?
Dominik
 
D

Dominik

Do you specify the "security" setting anywhere? With a BasicHttpBinding

I also found an implementation using PHP, which looks pretty simply:
$client = new SoapClient("http://wortschatz.uni-leipzig.de/axis/
services/$service?wsdl", array('trace'=>1, 'exceptions' => 0,
'login'=>'anonymous', 'password'=>'anonymous'));

$result=$client->execute($request);

With the basicHttpBinding said:
and setting the name BUT it claims to have also a transport security
and HTTPS, which the service simply doesn't support ....
Can it be that difficult in C#??

thank you,
dominik
 

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