Click here to Skip to main content
11,720,374 members (80,818 online)
   

C#

 
GeneralRe: L'Exception ArgumentException was not Operated Pin
Pete O'Hanlon1-Apr-14 4:15
protectorPete O'Hanlon1-Apr-14 4:15 
GeneralRe: L'Exception ArgumentException was not Operated Pin
MINDONGO1-Apr-14 4:36
memberMINDONGO1-Apr-14 4:36 
GeneralRe: L'Exception ArgumentException was not Operated Pin
Pete O'Hanlon1-Apr-14 4:47
protectorPete O'Hanlon1-Apr-14 4:47 
AnswerRe: L'Exception ArgumentException was not Operated Pin
MINDONGO1-Apr-14 5:02
memberMINDONGO1-Apr-14 5:02 
GeneralRe: L'Exception ArgumentException was not Operated Pin
Richard Deeming31-Mar-14 6:13
professionalRichard Deeming31-Mar-14 6:13 
GeneralRe: L'Exception ArgumentException was not Operated Pin
MINDONGO1-Apr-14 5:30
memberMINDONGO1-Apr-14 5:30 
AnswerRe: L'Exception ArgumentException was not Operated Pin
MINDONGO1-Apr-14 5:33
memberMINDONGO1-Apr-14 5:33 
AnswerRe: L'Exception ArgumentException was not Operated Pin
remiki2-Apr-14 23:44
memberremiki2-Apr-14 23:44 
QuestionJquery Easy UI DataGrid not show after publish Pin
nurealam30-Mar-14 22:56
membernurealam30-Mar-14 22:56 
AnswerRe: Jquery Easy UI DataGrid not show after publish Pin
Pete O'Hanlon31-Mar-14 0:44
protectorPete O'Hanlon31-Mar-14 0:44 
Questionhow to create bill in c#, sql Pin
Member 1071135730-Mar-14 16:46
memberMember 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
memberMember 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
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:

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 ()
support using 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:

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
AnswerRe: Connecting to a SOAP/XML Webservice Pin
V.30-Mar-14 22:48
professionalV.30-Mar-14 22:48 
GeneralRe: Connecting to a SOAP/XML Webservice Pin
Member 416962830-Mar-14 22:56
memberMember 416962830-Mar-14 22:56 
GeneralRe: Connecting to a SOAP/XML Webservice Pin
Member 416962830-Mar-14 23:06
memberMember 416962830-Mar-14 23:06 
GeneralRe: Connecting to a SOAP/XML Webservice Pin
V.30-Mar-14 23:08
professionalV.30-Mar-14 23:08 
Questionreplacing some part of image with small image at given xoordinate Pin
Member 1043184229-Mar-14 21:10
memberMember 1043184229-Mar-14 21:10 
AnswerRe: replacing some part of image with small image at given xoordinate Pin
BillWoodruff30-Mar-14 0:03
memberBillWoodruff30-Mar-14 0:03 
AnswerRe: replacing some part of image with small image at given xoordinate Pin
OriginalGriff30-Mar-14 4:53
protectorOriginalGriff30-Mar-14 4:53 
QuestionHow to get Route Map from Bing Map ? Pin
Vijay Kanda29-Mar-14 20:03
memberVijay Kanda29-Mar-14 20:03 
Generalneural network code +"SOM" Pin
maryammena28-Mar-14 20:26
membermaryammena28-Mar-14 20:26 
GeneralRe: neural network code +"SOM" Pin
Pete O'Hanlon28-Mar-14 21:55
protectorPete O'Hanlon28-Mar-14 21:55 
GeneralRe: neural network code +"SOM" Pin
harold aptroot28-Mar-14 22:32
memberharold aptroot28-Mar-14 22:32 
QuestionValidate model on initial request Pin
nitin_ion28-Mar-14 19:02
membernitin_ion28-Mar-14 19:02 
AnswerRe: Validate model on initial request Pin
Pete O'Hanlon28-Mar-14 22:26
protectorPete O'Hanlon28-Mar-14 22:26 
GeneralRe: Validate model on initial request Pin
nitin_ion30-Mar-14 17:30
membernitin_ion30-Mar-14 17:30 
GeneralRe: Validate model on initial request Pin
Pete O'Hanlon30-Mar-14 19:13
protectorPete O'Hanlon30-Mar-14 19:13 
GeneralRe: Validate model on initial request Pin
nitin_ion30-Mar-14 19:15
membernitin_ion30-Mar-14 19:15 
GeneralRe: Validate model on initial request Pin
Pete O'Hanlon30-Mar-14 20:26
protectorPete O'Hanlon30-Mar-14 20:26 
GeneralRe: Validate model on initial request Pin
BobJanova31-Mar-14 0:48
memberBobJanova31-Mar-14 0:48 
GeneralRe: Validate model on initial request Pin
Pete O'Hanlon31-Mar-14 1:21
protectorPete O'Hanlon31-Mar-14 1:21 
GeneralRe: Validate model on initial request Pin
BobJanova31-Mar-14 2:18
memberBobJanova31-Mar-14 2:18 
AnswerRe: Validate model on initial request Pin
Dave Kreskowiak31-Mar-14 2:14
mvpDave Kreskowiak31-Mar-14 2:14 
QuestionRouting event to particular control Pin
samaruf28-Mar-14 16:24
membersamaruf28-Mar-14 16:24 
QuestionTiff Image Copied with extra bytes Pin
cravi8528-Mar-14 10:50
membercravi8528-Mar-14 10:50 
AnswerRe: Tiff Image Copied with extra bytes Pin
Ravi Bhavnani28-Mar-14 11:00
professionalRavi Bhavnani28-Mar-14 11:00 
GeneralRe: Tiff Image Copied with extra bytes Pin
cravi8528-Mar-14 18:26
membercravi8528-Mar-14 18:26 
GeneralRe: Tiff Image Copied with extra bytes Pin
cravi8528-Mar-14 18:38
membercravi8528-Mar-14 18:38 
GeneralRe: Tiff Image Copied with extra bytes Pin
Ravi Bhavnani29-Mar-14 4:37
professionalRavi Bhavnani29-Mar-14 4:37 
GeneralRe: Tiff Image Copied with extra bytes Pin
BobJanova31-Mar-14 0:35
memberBobJanova31-Mar-14 0:35 
GeneralRe: Tiff Image Copied with extra bytes Pin
cravi8531-Mar-14 17:21
membercravi8531-Mar-14 17:21 
AnswerRe: Tiff Image Copied with extra bytes Pin
Dave Kreskowiak28-Mar-14 13:02
mvpDave Kreskowiak28-Mar-14 13:02 
GeneralRe: Tiff Image Copied with extra bytes Pin
cravi8528-Mar-14 18:39
membercravi8528-Mar-14 18:39 
GeneralRe: Tiff Image Copied with extra bytes Pin
Dave Kreskowiak29-Mar-14 3:29
mvpDave Kreskowiak29-Mar-14 3:29 
GeneralRe: Tiff Image Copied with extra bytes Pin
cravi8529-Mar-14 3:39
membercravi8529-Mar-14 3:39 
GeneralRe: Tiff Image Copied with extra bytes Pin
Dave Kreskowiak29-Mar-14 3:59
mvpDave Kreskowiak29-Mar-14 3:59 
GeneralRe: Tiff Image Copied with extra bytes Pin
cravi8529-Mar-14 5:01
membercravi8529-Mar-14 5:01 
GeneralRe: Tiff Image Copied with extra bytes Pin
Dave Kreskowiak29-Mar-14 19:53
mvpDave Kreskowiak29-Mar-14 19:53 

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

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


Advertise | Privacy | Mobile
Web03 | 2.8.150901.1 | Last Updated 4 Sep 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid