Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[11031] Re:Re:.import된 클래스에 데이터를 넘겨도...빈XML문서가 간다는 군요...확인가능하신지요(첨부)
SongDel [songpal] 1868 읽음    2006-11-03 21:10
델파이7입니다
다루어보신분 찾기 참 힘드네요




civilian,안영제 님이 쓰신 글 :
: 질문에 대한 답은 아닙니다만, XML-RPC도 델파이에서 구현 가능한데
: 굳이 C++ DLL을 쓰리려는 이유가....?
:
: SongDel 님이 쓰신 글 :
: : dll 소스 입니다
: : ........................................................................................................................
: : // WebServiceClient.cpp : Defines the entry point for the console application.
: : //
: :
: : #include "stdafx.h"
: :
: : #import "msxml4.dll"
: : using namespace MSXML2;
: :
: : int SubmitDocument_0602();
: :
: : int main(int argc, char* argv[])
: : {
: :     int retVal = SubmitDocument_0602();
: :     printf("%d\n", retVal);
: :
: :     return 0;
: : }
: :
: : int SubmitDocument_0602()
: : {
: :     printf("This is SubmitDocument function\n");
: :     printf("SubmitDocument Function is called\n");
: :
: :     CoInitialize(NULL);
: :
: :     IXMLHTTPRequestPtr pIXMLHTTPRequest = NULL;
: :     IXMLDOMDocumentPtr pIXMLDOMDocument = NULL;
: :
: :     HRESULT hr;
: :
: :     _bstr_t retString;
: :     _bstr_t reqString;
: :    
: :     reqString = L"<?xml version=\"1.0\" encoding=\"utf-8\"?>";
: :     reqString += L"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">";
: :     reqString += L"<soap:Body>";
: :     reqString += L"<SubmitDocument_0602 xmlns=\"http://schema.skico.com/WEIS/SAP/SKICO_0602\">";
: :     reqString += L"<SKICO_0602_Req>";
: :     reqString += L"<IM_CARWGHT>";
: :     reqString += L"<SHNUMBER>string</SHNUMBER>";
: :     reqString += L"<MNGST>string</MNGST>";
: :     reqString += L"<STSFD>string</STSFD>";
: :     reqString += L"<VEHICLE>string</VEHICLE>";
: :     reqString += L"<VWGHT>string</VWGHT>";
: :     reqString += L"<VWGDT>string</VWGDT>";
: :     reqString += L"<VWGTM>string</VWGTM>";
: :     reqString += L"<MWGHT>string</MWGHT>";
: :     reqString += L"<MWGDT>string</MWGDT>";
: :     reqString += L"<MWGTM>string</MWGTM>";
: :     reqString += L"<JWGHT>string</JWGHT>";
: :     reqString += L"<JWGDT>string</JWGDT>";
: :     reqString += L"<JWGTM>string</JWGTM>";
: :     reqString += L"</IM_CARWGHT>";
: :     reqString += L"</SKICO_0602_Req>";
: :     reqString += L"</SubmitDocument_0602>";
: :     reqString += L"</soap:Body>";
: :     reqString += L"</soap:Envelope>";
: :
: :
: :     try
: :     {
: :         hr = pIXMLHTTPRequest.CreateInstance(__uuidof(XMLHTTP40));
: :         SUCCEEDED(hr) ? 0 : throw hr;
: :
: :         hr = pIXMLDOMDocument.CreateInstance(__uuidof(DOMDocument40));
: :         SUCCEEDED(hr) ? 0 : throw hr;
: :
: :         // 전송하실 Data를 _bstr_t 타입으로 생성하셔서
: :         // pIXMLDOMDocument->loadXML function을 이용해 주십시오.
: :         // 전송하실 Data는 함께 드리는 워드 문서의 내용을 보신 후
: :         // 해당 웹 사이트의 MsgBody를 참조하셔서 생성하시면 됩니다.
: :         // request_109.xml 파일 또한 함께 첨부해 드리겠습니다.
: :
: :
: :         if (pIXMLDOMDocument->loadXML(reqString) != VARIANT_TRUE)
: :         {
: :             return -1;
: :         }
: :         else
: :         {
: :             printf("XML Load Success\n%s\n", (LPCSTR) pIXMLDOMDocument->xml);
: :         }
: :
: :         hr = pIXMLHTTPRequest->open("POST", "http://168.154.24.76/SKICO_0602/SKICO_0602.asmx");
: :         SUCCEEDED(hr) ? 0 : throw hr;
: :
: :         char dataLength[10];
: :         wsprintf(dataLength, "%d", (pIXMLDOMDocument->xml).length());
: :
: :         pIXMLHTTPRequest->setRequestHeader("SOAPAction", "http://schema.skico.com/WEIS/SAP/SKICO_0602/SKICO_0602/SubmitDocument_0602");
: :         pIXMLHTTPRequest->setRequestHeader("Content-Type", "text/xml; charset=utf-8");
: :         pIXMLHTTPRequest->setRequestHeader("Content-Length", dataLength);
: :
: :         pIXMLHTTPRequest->send(pIXMLDOMDocument->xml);
: :
: :         if (pIXMLHTTPRequest->status == 200 || pIXMLHTTPRequest->status == 202)
: :         {
: :             printf("Return Code: %d Success\n", pIXMLHTTPRequest->status);
: :         }
: :         else
: :         {
: :             printf("Return Code: %d Fail\n", pIXMLHTTPRequest->status);
: :         }
: :
: :         retString = pIXMLHTTPRequest->responseText;
: :
: :         printf("%s\n", (LPCSTR) retString);
: :     }
: :     catch (...)
: :     {
: :         printf("Error Occurred\n");
: :     }
: :
: :     if(pIXMLHTTPRequest)
: :         pIXMLHTTPRequest.Release();
: :
: :     if(pIXMLDOMDocument)
: :         pIXMLDOMDocument.Release();
: :
: :     CoUninitialize();
: :
: :     return 0;
: : }
: :
: :
: : ......................................

+ -

관련 글 리스트
11029 vc++코드를 dll로 만들어서 델파이에서 사용해야 합니다. 델파이에서 어떻게 해야 하나요(dll첨부) SongDel 1593 2006/11/02
11030     Re:vc++코드를 dll로 만들어서 델파이에서 사용해야 합니다. 델파이에서 어떻게 해야 하나요(dll첨부) civilian,안영제 2064 2006/11/03
11031         Re:Re:.import된 클래스에 데이터를 넘겨도...빈XML문서가 간다는 군요...확인가능하신지요(첨부) SongDel 1868 2006/11/03
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.