Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
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
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
Member 416962830-Mar-14 22:56 
GeneralRe: Connecting to a SOAP/XML Webservice Pin
Member 416962830-Mar-14 23:06
Member 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
Member 1043184229-Mar-14 21:10 
AnswerRe: replacing some part of image with small image at given xoordinate Pin
BillWoodruff30-Mar-14 0:03
professionalBillWoodruff30-Mar-14 0:03 
AnswerRe: replacing some part of image with small image at given xoordinate Pin
OriginalGriff30-Mar-14 4:53
mveOriginalGriff30-Mar-14 4:53 
QuestionHow to get Route Map from Bing Map ? Pin
Vijay Kanda29-Mar-14 20:03
Vijay Kanda29-Mar-14 20:03 
Generalneural network code +"SOM" Pin
maryammena28-Mar-14 20:26
maryammena28-Mar-14 20:26 
GeneralRe: neural network code +"SOM" Pin
Pete O'Hanlon28-Mar-14 21:55
mvePete O'Hanlon28-Mar-14 21:55 
GeneralRe: neural network code +"SOM" Pin
harold aptroot28-Mar-14 22:32
harold aptroot28-Mar-14 22:32 
QuestionValidate model on initial request Pin
nitin_ion28-Mar-14 19:02
nitin_ion28-Mar-14 19:02 
AnswerRe: Validate model on initial request Pin
Pete O'Hanlon28-Mar-14 22:26
mvePete O'Hanlon28-Mar-14 22:26 
GeneralRe: Validate model on initial request Pin
nitin_ion30-Mar-14 17:30
nitin_ion30-Mar-14 17:30 
GeneralRe: Validate model on initial request Pin
Pete O'Hanlon30-Mar-14 19:13
mvePete O'Hanlon30-Mar-14 19:13 
GeneralRe: Validate model on initial request Pin
nitin_ion30-Mar-14 19:15
nitin_ion30-Mar-14 19:15 
GeneralRe: Validate model on initial request Pin
Pete O'Hanlon30-Mar-14 20:26
mvePete O'Hanlon30-Mar-14 20:26 

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.