Click here to Skip to main content
15,923,168 members
Home / Discussions / C#
   

C#

 
GeneralRe: L'Exception ArgumentException was not Operated Pin
remiki31-Mar-14 5:15
remiki31-Mar-14 5:15 
GeneralRe: L'Exception ArgumentException was not Operated Pin
Pete O'Hanlon31-Mar-14 5:25
mvePete O'Hanlon31-Mar-14 5:25 
GeneralRe: L'Exception ArgumentException was not Operated Pin
remiki31-Mar-14 5:42
remiki31-Mar-14 5:42 
GeneralRe: L'Exception ArgumentException was not Operated Pin
Pete O'Hanlon31-Mar-14 5:48
mvePete O'Hanlon31-Mar-14 5:48 
GeneralRe: L'Exception ArgumentException was not Operated Pin
Dave Kreskowiak31-Mar-14 17:47
mveDave Kreskowiak31-Mar-14 17:47 
GeneralRe: L'Exception ArgumentException was not Operated Pin
V.31-Mar-14 21:50
professionalV.31-Mar-14 21:50 
GeneralRe: L'Exception ArgumentException was not Operated Pin
remiki31-Mar-14 23:13
remiki31-Mar-14 23:13 
GeneralRe: L'Exception ArgumentException was not Operated Pin
V.31-Mar-14 23:27
professionalV.31-Mar-14 23:27 
GeneralRe: L'Exception ArgumentException was not Operated Pin
Dave Kreskowiak1-Apr-14 2:15
mveDave Kreskowiak1-Apr-14 2:15 
GeneralRe: L'Exception ArgumentException was not Operated Pin
Pete O'Hanlon1-Apr-14 2:53
mvePete O'Hanlon1-Apr-14 2:53 
GeneralRe: L'Exception ArgumentException was not Operated Pin
remiki1-Apr-14 4:03
remiki1-Apr-14 4:03 
GeneralRe: L'Exception ArgumentException was not Operated Pin
Pete O'Hanlon1-Apr-14 4:15
mvePete O'Hanlon1-Apr-14 4:15 
GeneralRe: L'Exception ArgumentException was not Operated Pin
remiki1-Apr-14 4:36
remiki1-Apr-14 4:36 
GeneralRe: L'Exception ArgumentException was not Operated Pin
Pete O'Hanlon1-Apr-14 4:47
mvePete O'Hanlon1-Apr-14 4:47 
AnswerRe: L'Exception ArgumentException was not Operated Pin
remiki1-Apr-14 5:02
remiki1-Apr-14 5:02 
GeneralRe: L'Exception ArgumentException was not Operated Pin
Richard Deeming31-Mar-14 6:13
mveRichard Deeming31-Mar-14 6:13 
GeneralRe: L'Exception ArgumentException was not Operated Pin
remiki1-Apr-14 5:30
remiki1-Apr-14 5:30 
AnswerRe: L'Exception ArgumentException was not Operated Pin
remiki1-Apr-14 5:33
remiki1-Apr-14 5:33 
AnswerRe: L'Exception ArgumentException was not Operated Pin
remiki2-Apr-14 23:44
remiki2-Apr-14 23:44 
QuestionJquery Easy UI DataGrid not show after publish Pin
nurealam30-Mar-14 22:56
nurealam30-Mar-14 22:56 
AnswerRe: Jquery Easy UI DataGrid not show after publish Pin
Pete O'Hanlon31-Mar-14 0:44
mvePete O'Hanlon31-Mar-14 0:44 
Questionhow to create bill in c#, sql Pin
Member 1071135730-Mar-14 16:46
Member 1071135730-Mar-14 16:46 
AnswerRe: how to create bill in c#, sql Pin
Peter Leow30-Mar-14 17:00
professionalPeter Leow30-Mar-14 17:00 
AnswerRe: how to create bill in c#, sql Pin
Mycroft Holmes30-Mar-14 19:24
professionalMycroft Holmes30-Mar-14 19:24 
QuestionConnecting to a SOAP/XML Webservice Pin
Member 416962830-Mar-14 0:59
Member 416962830-Mar-14 0:59 
Hello,

I am at my wits end and was hoping for some help if possible.

I have been asked to retrieve some data from a SOAP/XML webservice. No problem I thought, done that loads of times.

I was even given a working PHP example that returns the data I need - even easier I thought!

BUT, in my c# code I cannot get past authorisation!

This is the example PHP script that works perfectly...

PHP
<?php
try
{
    $soap_url = "http://108-168-196-91.mycitrixdemo.net/zdm/services/EveryWanDevice?wsdl";
    $client = new SoapClient(null, array(
'location' => $soap_url,
'uri' => "http://zdemo2.zenprise.com",
'login' => "Administrator",
'password'=> "xxxxx"));
    $properties=$client->getDeviceProperties("99000067296308",null);
    for($i=0;$i<count($properties);$i++) {
        printf ("name: %s, value: %s\n" , $properties[$i]->name, $properties[$i]->value);
    }
}
catch (Exception $e)
{
    print_r($e); exit;
}
?>


I tried passing the username and password as I have done before like this:

C#
ClassLibrary1.trev.DeviceServiceService test = new trev.DeviceServiceService();
            test.Credentials = new System.Net.NetworkCredential("Administrator", "xxxx", "citrix");
            test.getAllDevices();


And I get "Failed to Authenticate

Reading the documents it says...

Quote:
Service Authentication
2nd generation SOAP services provide WS-Security (<https: www.oasis-open.org="" committees="" wss="">)
support using WSS4J (<http: ws.apache.org="" wss4j="">). By default, the services require WSS
Username+Password authentication of a valid user with the required rights. Support for other WSS
features might be added in future releases.
NOTE: these services DO NOT use HTTP authentication, as the previous Device Manager web services


So, I then tried:

C#
EveryWan.DeviceServiceService service = new EveryWan.DeviceServiceService();
            UsernameToken userToken = new UsernameToken("Administrator", "xxxx", PasswordOption.SendPlainText);
            service.RequestSoapContext.Security.Tokens.Add(userToken);
            service.RequestSoapContext.Security.Elements.Add(new MessageSignature(userToken));



And still I get "Failed to Authenticate" Confused | :confused:

I just don't understand what I need to do to talk to this API?

The PHP works fine! but I cannot replicate it in c#.

Can anyone see what I am doing wrong please?

Any help would be much appreciated!

Thanks

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.