Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #19506 > unrolled thread

CURL-PHP to Java-HTTPComponents

Started byLMario <lefalme@gmail.com>
First post2012-10-25 15:23 -0700
Last post2012-10-26 21:16 +0200
Articles 4 — 3 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  CURL-PHP to Java-HTTPComponents LMario <lefalme@gmail.com> - 2012-10-25 15:23 -0700
    Re: CURL-PHP to Java-HTTPComponents Jim Gibson <jimsgibson@gmail.com> - 2012-10-25 17:16 -0700
      Re: CURL-PHP to Java-HTTPComponents LMario <lefalme@gmail.com> - 2012-10-25 20:01 -0700
        Re: CURL-PHP to Java-HTTPComponents Joerg Meier <joergmmeier@arcor.de> - 2012-10-26 21:16 +0200

#19506 — CURL-PHP to Java-HTTPComponents

FromLMario <lefalme@gmail.com>
Date2012-10-25 15:23 -0700
SubjectCURL-PHP to Java-HTTPComponents
Message-ID<6c4cbf49-d97e-4bf8-9c8c-050943cf268d@googlegroups.com>
Somebody can help to me to rewrite to next CURL PHP code to Java HTTPComponents:

$process = curl_init('https://www.test.com/directory');
curl_setopt($process, CURLOPT_HTTPHEADER, array('Content-Type: text/xml', 'charset=utf-8'));
curl_setopt($process, CURLOPT_POSTFIELDS, $sob->saveXML());
curl_setopt($process, CURLOPT_SSLCERT, '123456789.cer');
curl_setopt($process, CURLOPT_SSLCERTPASSWD, "123456789");
curl_setopt($process, CURLOPT_RETURNTRANSFER, true);
curl_setopt($process, CURLOPT_POST, true);
curl_setopt($process, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($process, CURLOPT_SSL_VERIFYHOST, false);
$answer = curl_exec($process);
curl_close($process);

[toc] | [next] | [standalone]


#19507

FromJim Gibson <jimsgibson@gmail.com>
Date2012-10-25 17:16 -0700
Message-ID<251020121716390253%jimsgibson@gmail.com>
In reply to#19506
In article <6c4cbf49-d97e-4bf8-9c8c-050943cf268d@googlegroups.com>,
LMario <lefalme@gmail.com> wrote:

> Somebody can help to me to rewrite to next CURL PHP code to Java
> HTTPComponents:
> 
> $process = curl_init('https://www.test.com/directory');
> curl_setopt($process, CURLOPT_HTTPHEADER, array('Content-Type: text/xml',
> 'charset=utf-8'));
> curl_setopt($process, CURLOPT_POSTFIELDS, $sob->saveXML());
> curl_setopt($process, CURLOPT_SSLCERT, '123456789.cer');
> curl_setopt($process, CURLOPT_SSLCERTPASSWD, "123456789");
> curl_setopt($process, CURLOPT_RETURNTRANSFER, true);
> curl_setopt($process, CURLOPT_POST, true);
> curl_setopt($process, CURLOPT_SSL_VERIFYPEER, false);
> curl_setopt($process, CURLOPT_SSL_VERIFYHOST, false);
> $answer = curl_exec($process);
> curl_close($process);

If you google for "java curl", the first three hits are pretty much
your question. No idea if the answers are any good.

-- 
Jim Gibson

[toc] | [prev] | [next] | [standalone]


#19508

FromLMario <lefalme@gmail.com>
Date2012-10-25 20:01 -0700
Message-ID<e2680fdc-46b0-4e08-9822-32df612bb3b5@googlegroups.com>
In reply to#19507
Yes, you're right, but it seems the answers are incomplete because they do not handle the authentication nor the sending of string data (variable $sob) to the server nor SSL verification.

I hope somebody can help me with my post.

[toc] | [prev] | [next] | [standalone]


#19514

FromJoerg Meier <joergmmeier@arcor.de>
Date2012-10-26 21:16 +0200
Message-ID<1q2k7qn7mfylo.qbc2vkbdpeam.dlg@40tude.net>
In reply to#19508
On Thu, 25 Oct 2012 20:01:39 -0700 (PDT), LMario wrote:

> Yes, you're right, but it seems the answers are incomplete because they do not handle the authentication nor the sending of string data (variable $sob) to the server nor SSL verification.

> I hope somebody can help me with my post.

Show us what you've got that doesn't do what you want. For debugging, I can
recommend Wireshark, which would let you compare request A with request B
to see where your Java one doesn't look like the PHP one.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web