Can I make a php websevice in this case?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
monada
Forum Newbie
Posts: 2
Joined: Wed Apr 23, 2008 8:24 am

Can I make a php websevice in this case?

Post by monada »

I have a php project which its structure is:
Project_Folder/classes/some_classes.php files.
Project_Folder/pages/some_pages.php files that uses the above classes.

In few words:
this project made some transaction with MySQL database.

I use C# to manage some hardware and put the data I get from this hardware via SDK in a file.txt.
Then I read this file from one of the php pages.

So for make the php call this txt file I must call it's entire php script from c#.

I made a hellow world webservice with php and made a c# client to call it by following this article
http://sanity-free.org/125/php_webservi ... ients.html

the problem is this php page that want to I call it from c# as a webservice call many pages and classes in the project.
and every page in the project made some transaction with MySQL database.

can this page be a webservice without changing the other project pages.

because I tried this but I got this error
System.InvalidOperationException: Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.

Any one can help?
MadHatter
Forum Newbie
Posts: 1
Joined: Wed May 28, 2008 10:27 pm

Re: Can I make a php websevice in this case?

Post by MadHatter »

that usually happens when you have an error in your PHP script. try hitting the php page to see if there are any errors in your web service before attempting to bind to it in C#.
Post Reply