안녕하세요 혹시 성태님은... 가능하시지 않으실까.. 해서..
이렇게 여쭤보게 되네요...
soap 1.1 메세지 날려 주는 부분인데요..
이렇게 하여 날려 보았는데..
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("
http://www.taxcerti.or.kr/etax/mr/SubmitEtaxInvoiceService/5efba5c1-36a2-4e9c-af40-492b4f30fb28");
webRequest.Method = "POST";
webRequest.Headers.Add("SOAPAction", "\"
http://www.kec.or.kr/standard/Tax/TaxInvoiceSubmit\"");
webRequest.Headers.Add("Accept-Encoding", "gzip,deflate");
webRequest.Headers.Add("MIME-Version", "1.0");
webRequest.ContentType = "Multipart/Related;type=\"text/xml\";start=\"<SOAPPART>\"; boundary=\"" + boundary + "\" startinfo=\"application/soap+xml\"";
webRequest.KeepAlive = false;
ServicePointManager.Expect100Continue = false;
Stream requestStream = webRequest.GetRequestStream();
StringBuilder sbdata = new StringBuilder();
sbdata.Append("\r\n");
sbdata.Append("--"+boundary);
sbdata.Append("\r\n");
sbdata.Append("Content-Type:text/xml; charset=UTF-8;type=\"application/soap+xml\"");
sbdata.Append("\r\n");
sbdata.Append("Content-ID :<SOAPPART>" );
sbdata.Append("\r\n");
byte[] postHeaderBytes = Encoding.ASCII.GetBytes(sbdata.ToString());
requestStream.Write(postHeaderBytes, 0, postHeaderBytes.Length);
string strFileName = @"D:\Test\test.xml";
string text = System.IO.File.ReadAllText(strFileName);
byte[] xmlfile_byte = Encoding.ASCII.GetBytes(text);
requestStream.Write(xmlfile_byte, 0, xmlfile_byte.Length);
string strFileName2 = @"D:\Test\encryptedData_Test.ber";
FileStream fileStreamInput2 = File.OpenRead(strFileName2);
byte[] byteArray2 = new byte[fileStreamInput2.Length];
sbdata = new StringBuilder();
sbdata.Append("\r\n");
sbdata.Append("--" + boundary);
sbdata.Append("\r\n");
sbdata.Append("Content-Type : application/octet-stream ");
sbdata.Append("\r\n");
// sbdata.Append("Content-Transfer-Encoding: binary");
// sbdata.Append("\r\n");
sbdata.Append("Content-ID : <5efba5c1-36a2-4e9c-af40-492b4f30fb28>");
sbdata.Append("\r\n");
sbdata.Append("Content-Length: " + byteArray2.Length);
sbdata.Append("\r\n");
byte[] postHeaderBytes13 = Encoding.ASCII.GetBytes(sbdata.ToString());
requestStream.Write(postHeaderBytes13, 0, postHeaderBytes13.Length);
int bytesRead = 0;
while ((bytesRead = fileStreamInput2.Read(byteArray2, 0, byteArray2.Length)) != 0)
{
requestStream.Write(byteArray2, 0, bytesRead);
}
string boundary_sbdata ="\r\n";
boundary_sbdata = boundary_sbdata+"--" + boundary+"--";
byte[] postHeaderBytesz = Encoding.ASCII.GetBytes(boundary_sbdata.ToString());
requestStream.Write(postHeaderBytesz, 0, postHeaderBytesz.Length);
requestStream.Close();
StreamReader src = new StreamReader(webRequest.GetResponse().GetResponseStream());
Console.WriteLine(src.ReadToEnd());
src.Close();
응답부분에서는
200 떨어집니다. 기존에 해보셨던 분들은 200에 <DescriptionText>성공적으로 접수처리 되었습니다.처리결과는 익일 전송될예정입니다.</DescriptionText> 이게 의미 없다고 하시네요
검증부분에서도 결국 실행하면.. 실패라는 메세지만 우르르르
TC-SA-0001 HTTP Header field - 'Content-Type', 'type' 2013-05-10 19:56:55 실패
TC-SA-0002 SOAP Attachment - MIME Part 갯수, 'Content-Type', 'type' 2013-05-10 19:56:55 실패
TC-SA-0005 SOAP Message의 root-part가 UTF-8로 serialize 되었는지 검증한다. 2013-05-10 19:56:55 실패
TC-SA-0006 SOAP Message의 Envelope, Header, Body 정보를 검증한다. 실패
올 실패가 떨어집니다.
결국 그쪽에 전화를 해봤지만.. 결국 모르겠다고 도와주실수 없다고 하네요..
아우...
그런데 데이터를 보면
POST
http://www.taxcerti.or.kr/etax/mr/SubmitEtaxInvoiceService/5efba5c1-36a2-4e9c-af40-492b4f30fb28 HTTP/1.1
SOAPAction: "
http://www.kec.or.kr/standard/Tax/TaxInvoiceSubmit"
Accept-Encoding: gzip,deflate
MIME-Version: 1.0
Content-Type: Multipart/Related;type="text/xml";start="<SOAPPART>"; boundary="----=_Part_129961_2585692.1368180270520" startinfo="application/soap+xml"
Host: www.taxcerti.or.kr
Content-Length: 13356
Connection: Keep-Alive
------=_Part_129961_2585692.1368180270520
Content-Type:text/xml; charset=UTF-8;type="application/soap+xml"
Content-ID :<SOAPPART>
.........XML 데이터
------=_Part_129961_2585692.1368180270520
Content-Type : application/octet-stream
데이터
------=_Part_129961_2585692.1368180270520
날아가더군요.. 이유가 아무래도 제가 잘못 보내는거 아닌가 살펴보고 있는데..
[최초 등록일: ]
[최종 수정일: 5/10/2013]