SunQuest
           XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 16th, 2002, 10:32 AM
ghatzhat ghatzhat is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 361 ghatzhat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 9 m 5 sec
Reputation Power: 7
xml-rpc php/asp communication problem

i've been dabbling with xml-rpc in php and it's all gone swimmingly...

for an exercise, i wrote an xml-rpc server that receives a four digit integer from an xml message and gives it to the unix shell program "cal" (calendar). the xml response contains a lovely formatted calendar for the year.

(i've been using the xmlrpc.inc and xmlrpcs.inc from sourceforge)

with a php client talking to a php server, it is great... lovely calendar in the browser...

next step/the problem:
with an asp client talking to the same php server... it doesn't work...


i get back an error (abbrev.):
"XML error: no element found at line 1"

(i am using David Carter-Tod's xmlrpc.asp include)

i can however get my asp to talk to my asp (different service, mind, as windows doesn't have cal)

before i continue poking about with code and http and xml and server config etc, are there any known issues with this sort of a set up?
__________________
Little more than a playground for the bugs that live beneath us...

Reply With Quote
  #2  
Old July 31st, 2002, 12:30 AM
ghatzhat ghatzhat is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 361 ghatzhat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 9 m 5 sec
Reputation Power: 7
re-inspired...

i've just seen reemjacob's post on bigsean's thread... http://forums.devshed.com/showthrea...&threadid=40223 and i've been re-inpired to get this working...

however, my problems seem different to bigsean's... though I checked out the msxml2.dll that reemjacob mentioned to be sure...

here's some code:

the asp client:

<!--#include virtual="/xmlrpc/xmlrpc.asp" -->
<%
on error resume next
'if NOT Request.form("year") = "" then
Dim paramList(1)
paramList(0)=CInt("2002")

' WHAT AM I SENDING TO THE SERVER
Response.write("<pre>" & Replace(functionToXML("mdsxmlrpc.cal", paramList), "<", "<", 1, -1, 1) & "</pre>")



myresp = xmlRPC("http://florence/mds_serv/cal_s.php", "mdsxmlrpc.cal", paramList)
response.write(myresp & "<p>")


' WHAT I AM GETTING FROM THE SERVER
Response.write("<pre>" & Replace(serverResponseText, "<", "<", 1, -1, 1) & "</pre>")

'end if
%>

the php server:
PHP Code:
<?php
require("/webhome/florence/includes/xmlrpc.inc");
require(
"/webhome/florence/includes/xmlrpcs.inc");


$cal_sig=array(array($xmlrpcString$xmlrpcInt));

$cal_doc='When passed a four figure year, returns the
calendar for that year.'
;

function 
cal($dte) {
global 
$xmlrpcerruser;
    
// get the first param
    
$y=$dte->getParam(0);

    if (isset(
$y) && ($y->scalartyp()=="int") && ($y->scalarval()>=1000) && ($y->scalarval()<10000)) {
        
$cmd "cal ".$y->scalarval();
    }
    else {
        
$cmd "cal ".date("Y");
        
// parameter mismatch, complain
        //$err="A four-figure year is required.";
    
}
    
    
$fp popen($cmd"r");
        while (!
feof ($fp)) {
            
$cal .= fgets($fp69);
        }
    
pclose($fp);



    
// if we generated an error, create an error return response
    
if ($err) {
        return new 
xmlrpcresp(0$xmlrpcerruser$err);
    }
    else {
        
// otherwise, we create the right response
        // with the calendar
        
return new xmlrpcresp(new xmlrpcval($cal));
    }
    

// end function cal




$s=new xmlrpc_server(
            array(     
"mdsxmlrpc.cal" => array(    "function" => "cal",
                                 
"signature" => $cal_sig,
                                 
"docstring" => $cal_doc
                            
)
            )
);






?>



and the full error message:

<?xml version="1.0"?>
<methodCall>
<methodName>mdsxmlrpc.cal</methodName>
<params>
<param>
<value><int>2002</int></value>
</param>
</params>
</methodCall>


<?xml version="1.0"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>103</int></value>
</member>
<member>
<name>faultString</name>
<value><string>XML error: no element found at line 1</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>


if anyone has some ideas, i'd be glad to hear them...

i should point out again - the server works fine with a php client... and i can get an asp ("Hello world") client to talk to an asp server okay.

Reply With Quote
  #3  
Old September 30th, 2002, 07:16 AM
sbrassard sbrassard is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: NY
Posts: 3 sbrassard User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ASP / PHP XMLRPC

Ahhh HA! Finally someone else seems to be having the same set of troubles I am.

URL

Check it out..

At least its returning the xml response with the data wrapped in XML, but its generating basically the same error.

Reply With Quote
  #4  
Old September 30th, 2002, 07:23 AM
sbrassard sbrassard is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: NY
Posts: 3 sbrassard User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Errors im getting

Check the errors.zip file ive attached to see the errors im getting. BTW - im using keith devens XMLRPC library and my xml implementation is straight from here:

URL

-Steve
Attached Files
File Type: zip errors.zip (1.7 KB, 287 views)

Reply With Quote
  #5  
Old August 1st, 2003, 08:33 PM
nathanoj nathanoj is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: London (ish)
Posts: 2 nathanoj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
XML-RPC ASP client not talking to PHP Server

Hi,

I know this was over a year ago, but I've just hit exactly the same problem.

did you get any satisfaction getting your ASP client to talk to your PHP server ?

thanks,
Jonathan

Reply With Quote
  #6  
Old August 6th, 2003, 04:32 AM
nathanoj nathanoj is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: London (ish)
Posts: 2 nathanoj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

Did you ever get to the bottom of this PHP/ASP problem ? I've hit exactly the same thing you see !!!

thanks
URL

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > xml-rpc php/asp communication problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway