[H]ard|Forum

[H]ard|Forum (http://hardforum.com/index.php)
-   Webmastering & Programming (http://hardforum.com/forumdisplay.php?f=20)
-   -   Web services: Getting a C# program talking to a PHP server (http://hardforum.com/showthread.php?t=812041)

carl67lp 09-24-2004 10:22 AM

Web services: Getting a C# program talking to a PHP server
 
I've tried NuSOAP, I've tried the SOAP package built in to PHP, I've tried things in between--and still nothing seems to work.

I add the Web reference in VS.NET just fine. The closest I can seem to get is this error:

"Server found request content type to be 'text/html; charset=ISO-8859-1', but expected 'text/xml'."

I've poked around Google but can't seem to find anything that would match my situation. The most similar talks about SOAP::Lite, but that's not what I'm using. (In this case, I'm using NuSOAP.)

Is there something I'm missing? Is it simply impossible for a C# client (specifically, that bastardly PocketPC) to talk SOAP to a PHP server?

carl67lp 09-24-2004 01:24 PM

Well, in an effort to try to debug things, I did a PHP client. Here's the request and response:

[url]http://www.dev-alumni.wayne.edu/sandbox/results.txt[/url]

Something is obviously screwy, since I shouldn't be getting that kind of response.

Sgarissta 09-24-2004 04:27 PM

The text/html issue is an extremly nagging problem. It deals with the fact that your webservice (if you followed most of the PHP docs out there) is encoded as RPC/Encoded. While .NET will add a reference and build a client class, your PHP server will probably hose on it. Take a look at [url]http://www.pocketsoap.com/tcptrace/pt.aspx[/url] for a tool that will help you better see the response your PHP is sending.

While this will help you better debug the issue it will not solve it. The only solution to this I found was to manually write the WSDL document following the Document/Literal specification. I'd try and explain more but it's, well, strange. The only real examples of this that I could find out there, were in the PEAR::SOAP_Interop package. I'd REALLY recommend downloading it, and reading the WSDL examples for Document/Literal based webservices.

[edit] I also recommend that you make sure your variables are returned as data types defined in your WSDL, it makes the Doc/Lit translation from RPC/Enc much easier. (I don't know the NuSOAP pacakge so I can't explain much further)

carl67lp 09-24-2004 04:28 PM

There's that document/literal bit you were talking about. :)

I have the next two days off of work, so I'm going to try my best to [i]not[/i] think about this, but knowing me and how I approach a challenge, I'll probably work on it some this weekend.

carl67lp 09-30-2004 12:07 PM

I've done a Google for the document/literal stuff, but I haven't been able to come up with many hits. I looked into PocketSOAP as was suggested in another thread, but apparently this won't work since it's COM-based and that won't do on a Pocket PC (as I'm shooting for).

Here I was all excited by PocketSOAP and it looks like I'm back to square one.

Anyone have good links for doc/lit SOAP?


All times are GMT -5. The time now is 01:42 PM.

Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 2000 - 2009 KB Networks, Inc.