homepage Welcome to WebmasterWorld Guest from 54.163.72.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

    
Parameters misplaced when soap function is called
ac1982




msg:4100293
 12:30 pm on Mar 18, 2010 (gmt 0)

I currently have a web service function in php that accepts a few parameters. When I call this function if I do not provide all the parameters, all my parameters are misplaced. See the following example:

function myWebService(param1, param2, param3, param4){}

//from .net using c#
calling myWebService :
param1 = "zxcxzc"
param2 = "zxcxzc"
param4 = "zxcxzc"

i did not pass param3, so when my function will get the parameters it will be like this:
param3 will have the contents of param4.

i have check and debug in .net everything seems find. Also i called this soap function using php and its fine. I notice that when i pass an empty string in a parameter it works properly but not when there is no parameter.

 

rocknbil




msg:4101079
 4:46 pm on Mar 19, 2010 (gmt 0)

I notice that when i pass an empty string in a parameter it works properly but not when there is no parameter.


Kind of answered your own question. :-) A function is not aware of what you're expecting, only what it receives. There is no "associative" flagging (that I know of.) So it just takes them in the order you pass them, like a list array. I don't do .net or c, but do a lot of other languages - when you pass to a function, you're probably doing

$some_result = some_function (1,2,3);

Leaving parameter 4 null.

$some_result = some_function (1,2,NULL,3);
$some_result = some_function (1,2,'',3);

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved