[jcifs] JCIFS not working with Apaches's XML-RPC?

Alexander Langer al at s-3.de
Tue Jun 29 13:30:15 GMT 2004


Okay, I'll try to explain:

At first I try to access a page with java.net.URL by myself. The request looks like this:

GET /rpc-server/pv.php HTTP/1.1
User-Agent: Java/1.4.2_03
Host: 192.168.0.44
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive

The response is:

HTTP/1.1 401 Access Denied
Server: Microsoft-IIS/5.0
Date: Tue, 29 Jun 2004 13:13:12 GMT
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
Connection: close
Content-Length: 4609
Content-Type: text/html

After that jCIFS seems to take over and sends another request:

GET /rpc-server/pv.php HTTP/1.1
User-Agent: Java/1.4.2_03
Host: 192.168.0.44
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Authorization: NTLM TlRMTVNTUAABAAAAB7IAoggACAAsAAAABAAEACgAAAAFAJMIAAAAD0FMRVhNQ1MtR01CSA==

GET /rpc-server/pv.php HTTP/1.1
User-Agent: Java/1.4.2_03
Host: 192.168.0.44:8080
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Authorization: NTLM TlRMTVNTUAADAAAAAAAAAEgAAAAAAAAASAAAAAAAAABIAAAAAAAAAEgAAAAAAAAASAAAAAAAAABIAAAABcKAogUAkwgAAAAP

..and gets (after a bunch of other headers and messages):

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Tue, 29 Jun 2004 13:13:13 GMT
Connection: close
X-Powered-By: PHP/4.3.4
Content-Length: 376
Content-Type: text/xml

[my requested data]


So far so good. After that there comes my XML-RPC request:

POST /rpc-server/pv-pbone.php HTTP/1.0
User-Agent: Apache XML-RPC 1.2-a3-dev
Host: 192.168.0.44
Content-Type: text/xml
Content-Length: 117

<?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>getPing</methodName><params></params></methodCall>

and the answer is:

HTTP/1.1 401 Access Denied
Server: Microsoft-IIS/5.0
Date: Tue, 29 Jun 2004 13:13:14 GMT
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
Content-Length: 4609
Content-Type: text/html

[error message]


XML-RPC tells me: 'Unexpected Response from Server:  Access Denied'
That's it. Nothing more than that. No second attempt, nothing :-(

Any idea?
  ----- Original Message ----- 
  From: eglass1 at comcast.net 
  To: Alexander Langer ; jcifs at lists.samba.org 
  Sent: Tuesday, June 29, 2004 2:19 PM
  Subject: Re: [jcifs] JCIFS not working with Apaches's XML-RPC?


  What errors are you seeing?  There are a couple of known issues with the NtlmHttpURLConnection (which I've been meaning to look at in more detail for awhile now).  POST requests appear to cause problems, and that would be a pretty big show-stopper for XML-RPC.  Also, many XML-RPC clients prefill the "Authorization" header rather than handling the 401 (i.e., they attach the HTTP Basic base-64 string to all requests instead of waiting until the first Unauthorized response).  This would likely cause conflicts on either their side or ours.

  Eric


    -------------- Original message -------------- 

    > Hi! 
    > 
    > My initial problem is accessing my XML-RPC server script (written in PHP) on 
    > IIS. It worked fine until I ran into the authorization issues. 
    > 
    > I tried JCIFS and accessing a page on IIS now works with authorization. 
    > Unfortunately it seems that Apache's XML-RPC library isn't able to make use of 
    > it, although a quick look at their sources revealed, that they're using the 
    > standard URL Java class. 
    > 
    > Has anyone some thoughts to share on this one, maybe some experience in getting 
    > XML-RPC to work with JCIFS? 
    > 
    > alex 
    > 
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the jcifs mailing list