Click here to Skip to main content
15,888,000 members
Home / Discussions / C#
   

C#

 
GeneralRe: MouseUp Event Not Firing After DoDragDrop Pin
Henry Minute14-Jul-09 9:03
Henry Minute14-Jul-09 9:03 
GeneralRe: MouseUp Event Not Firing After DoDragDrop Pin
Kevin Marois14-Jul-09 9:10
professionalKevin Marois14-Jul-09 9:10 
GeneralRe: MouseUp Event Not Firing After DoDragDrop Pin
Henry Minute14-Jul-09 10:10
Henry Minute14-Jul-09 10:10 
GeneralRe: MouseUp Event Not Firing After DoDragDrop [modified] Pin
Kevin Marois14-Jul-09 10:46
professionalKevin Marois14-Jul-09 10:46 
GeneralRe: MouseUp Event Not Firing After DoDragDrop Pin
Henry Minute14-Jul-09 12:06
Henry Minute14-Jul-09 12:06 
GeneralRe: MouseUp Event Not Firing After DoDragDrop Pin
Kevin Marois14-Jul-09 12:38
professionalKevin Marois14-Jul-09 12:38 
QuestionSetting an origin for BinaryReader Pin
SimpleData14-Jul-09 7:16
SimpleData14-Jul-09 7:16 
QuestionC# struct and NuSOAP(php) Pin
OptiPlex14-Jul-09 6:58
OptiPlex14-Jul-09 6:58 
Hello

Im trying to build a client in c# that talks with some remote (php)server with SOAP using the NuSOAP library.
Here im using a struct/object that will containt the user info of some user:
public struct UserProfile {
            public string username;
            public string password;
            public string email;
            public string site;
            public string signature;
            public int age;
            public int points;


And this is the PHP Code:
server->wsdl->addComplexType(
				'UserProfile',
				'complexType',
				'struct',
				'all',
				'',
				array(
					'username' => array('name' => 'username', 'type' => 'xsd:string'),
					'password' => array('name' => 'password', 'type' => 'xsd:string'),
					'email' => array('name' => 'email', 'type' => 'xsd:string'),
					'site' => array('name' => 'site', 'type' => 'xsd:string'),
					'signature' => array('name' => 'signature', 'type' => 'xsd:string'),
					'age' => array('name' => 'age', 'type' => 'xsd:int'),
					'points' => array('name' => 'username', 'type' => 'xsd:int'),
				)
);

$server->wsdl->addComplexType(
				'UserProfileArray',
				'complexType',
				'array',
				'',
				'SOAP-ENC:Array',
				array(),
				array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:UserProfile[]')),
				'tns:UserProfile'
);

$server->register("getUserProfile",
	array(),
	array('return' => 'tns:UserProfileArray'),
	$namespace,
	false,
	'rpc',
	false,
	'Get the user profile object'
);

function getUserProfile(){
	$profile['username'] = "user";
	$profile['password'] = "pass";
	$profile['email'] = "usern@ame";
	$profile['site'] = "u.com";
	$profile['signature'] = "usucsdckme";
	$profile['age'] = 111;
	$profile['points'] = time() / 2444;

	return $profile;
}


Now I already have a working login function, and I want to get the info about the logged in user but I dont know howto obtain these. This is what im using to get the userinfo:
string user = txtUser.Text;
string pass = txtPass.Text;
SimpleService.SimpleService service = new SimpleService.SimpleService();
if(service.login(user, pass)){
     //logged in

}

SoapApp.SimpleService.UserProfile[] user = service.getUserProfile(); // THIS LINE GIVES ME AN EXCEPTION

MessageBox.Show(user[0].username + "--" + user[0].points);


The getUserProfile() function produces an error:
System.Web.Services.Protocols.SoapException was unhandled
  Message="unable to serialize result"
  Source="System.Web.Services"


The article I used for this was from: http://www.sanity-free.org/125/php_webservices_and_csharp_dotnet_soap_clients.html[^]

The difference on what they are doing and what I try to do is that I only want to get one object returned instead of multiple 'MySoapObjects'.

I hope someone is familiar with this and could help me, thanks in advance!
Regards,
opx
AnswerRe: C# struct and NuSOAP(php) Pin
dataminers14-Jul-09 9:23
dataminers14-Jul-09 9:23 
GeneralRe: C# struct and NuSOAP(php) Pin
OptiPlex14-Jul-09 9:26
OptiPlex14-Jul-09 9:26 
GeneralRe: C# struct and NuSOAP(php) Pin
dataminers14-Jul-09 9:30
dataminers14-Jul-09 9:30 
GeneralRe: C# struct and NuSOAP(php) Pin
Almighty Bob21-Jul-09 2:11
Almighty Bob21-Jul-09 2:11 
AnswerRe: C# struct and NuSOAP(php) Pin
Almighty Bob21-Jul-09 2:06
Almighty Bob21-Jul-09 2:06 
QuestionImage (Bitmap) Brightness/Contrast Pin
lexx_zone14-Jul-09 6:55
lexx_zone14-Jul-09 6:55 
AnswerRe: Image (Bitmap) Brightness/Contrast Pin
vineas14-Jul-09 7:06
vineas14-Jul-09 7:06 
AnswerRe: Image (Bitmap) Brightness/Contrast Pin
Luc Pattyn14-Jul-09 7:09
sitebuilderLuc Pattyn14-Jul-09 7:09 
AnswerRe: Image (Bitmap) Brightness/Contrast Pin
lexx_zone14-Jul-09 8:38
lexx_zone14-Jul-09 8:38 
QuestionBest method for syntax highlighting Pin
WebMaster14-Jul-09 6:36
WebMaster14-Jul-09 6:36 
AnswerRe: Best method for syntax highlighting Pin
Luc Pattyn14-Jul-09 7:31
sitebuilderLuc Pattyn14-Jul-09 7:31 
GeneralRe: Best method for syntax highlighting [modified] Pin
WebMaster14-Jul-09 8:45
WebMaster14-Jul-09 8:45 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn14-Jul-09 15:19
sitebuilderLuc Pattyn14-Jul-09 15:19 
GeneralRe: Best method for syntax highlighting Pin
WebMaster14-Jul-09 20:47
WebMaster14-Jul-09 20:47 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 0:03
sitebuilderLuc Pattyn15-Jul-09 0:03 
GeneralRe: Best method for syntax highlighting Pin
WebMaster15-Jul-09 1:24
WebMaster15-Jul-09 1:24 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 1:43
sitebuilderLuc Pattyn15-Jul-09 1:43 

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.