/home/mjc1/public_html/test/delivery_test2.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php 
 
//Data, connection, auth
 
 
$url "http://ediweb.ilogen.com/iLOGEN.EDI.WebService/W_CSharpServer.asmx"// asmx URL of WSDL

 // xml post structure

 
$xml_post_string "<?xml version='1.0' encoding='utf-8'?>
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
  <soap:Body>
    <W_CSharp_NTx_Get_RcvDivCd xmlns='http://ediweb.ilogen.com/iLOGEN.EDI.WebService/'>
      <userID>30950755</userID>
      <passWord>1234</passWord>
      <strAddr>´ë±¸½Ã ºÏ±¸ Ä§»ê³²·Î 215 </strAddr>
    </W_CSharp_NTx_Get_RcvDivCd>
  </soap:Body>
</soap:Envelope>"
;   // data from the form, e.g. some ID number

    
$headers = array(
                 
"Content-type: text/xml;charset=\"utf-8\"",
                 
"Accept: text/xml",
                 
"Cache-Control: no-cache",
                         
"Pragma: no-cache",
                 
"SOAPAction:\"http://ediweb.ilogen.com/iLOGEN.EDI.WebService/W_CSharp_NTx_Get_RcvDivCd\"",                 
                 
"Content-length: ".strlen($xml_post_string),
             ); 
//SOAPAction: your op URL


     // PHP cURL  for https connection with auth
     
$ch curl_init();
     
curl_setopt($chCURLOPT_SSL_VERIFYPEER1); // ¼­¹ö ÀÎÁõ¼­ÀÇ À¯È¿¼º °Ë»ç
     
curl_setopt($chCURLOPT_URL$url); // url ÁöÁ¤Çϱâ
     
curl_setopt($chCURLOPT_RETURNTRANSFERfalse); // ¿äû °á°ú´Â ¹®ÀÚ¿­·Î ¹Ýȯ¼³Á¤
     
curl_setopt($chCURLOPT_HTTPAUTHCURLAUTH_ANY); // »ç¿ëÇϴ HTTP ÀÎÁõ¹æ¹ý 
     
curl_setopt($chCURLOPT_POSTtrue); // HTTP POST
     
curl_setopt($chCURLOPT_POSTFIELDS$xml_post_string); // the SOAP request
     
curl_setopt($chCURLOPT_HTTPHEADER$headers); // HTTP Çì´õÀÇ ¼³Á¤ ¹è¿­

     // converting
     
$response curl_exec($ch); 
     
curl_close($ch);

     
//var_dump($response);

     // converting
     //$response1 = str_replace("<soap:Body>","",$response);
     //$response2 = str_replace("</soap:Body>","",$response1);

     // convertingc to XML
     //$parser = simplexml_load_string($response2);
     // user $parser to get your data out of XML response and to display it. 



/*
     $ch = curl_init();
curl_setopt ($ch, CURLOPT_HEADER, FALSE);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt ($ch, CURLOPT_HTTPGET, TRUE);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$xml = curl_exec($ch);

curl_close($ch);
var_dump($xml);*/

 
?>