Jump to content

c# Backslash to SOAP to MySQL DB

- - - - -

  • Please log in to reply
No replies to this topic

#1
PGP_Protector

PGP_Protector

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 253 posts
I've got a Path variable
string MyPath = "\\\\NetworName\\User\\Path\\";
string FileName="Test.bmp";
string FullName = MyPath+FileName;
That I Use for a Fixed path, now I can save my images with this without issue.
BMP.Save(FullName);
But when I send FullName to my SOAP Client, it appears as though the Backslashes are getting double parsed :cursing:
sent via the command SavePath(FullName);
So the Database ends up with "\NetworNameUserPathTest.bmp" vs \\NetworName\User\Path\Test.bmp"

Now I can "get around this" by making a Database File Path Name like
string DataBasePath = "\\\\\\\\NetworName\\\\User\\\\Path\\\\" + FileName & it gets saved correctly in the Database as \\Networkname\User\Path\Test.bmp" but I don't think this is the proper way to really fix it.

the PHP Code to save it is
		$DBCommand = "INSERT INTO Table (`Image`) VALUES('$ImagePath');";
		$db=mysql_connect(DBAddress,DBUser,DBPw);
		mysql_select_db('database',$db);
		mysql_query($Command);
		mysql_close($db);

but if I use SoapUI 4.0.0 to send the command, I only need to send the string from MyPath vs the string from DataBasePath. So the problem doesn't appear to be in the SOAP end, but how VC# is talking to the SOAP.

Is their another way to fix this & verify that it sends what is in the string?
The command that's called is

public static void SavePath(string Path)
        {
            SOAPInterface.SaveImagePath(Path);
        }





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users