2012-07-06 4 views
0

나는 ipayment (Germany) 용 SOAP를 사용하여 지불 시스템을 만들려고 노력하고 있으며 그 문서에서 다음 SOAP 요청으로 두 번째 코드 예제에 표시된 응답을 얻을 수 있다고 설명합니다. 서버에서Grails로 SOAP 클라이언트 요청

<?xml version="1.0" encoding="ISO-8859-1"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<SOAP-ENV:Body> 
    <capture> 
    <accountData> 
    <accountId>99999</accountId> 
    <trxuserId>99999</trxuserId> 
    <trxpassword>0</trxpassword> 
    <adminactionpassword> 
     5cfgRT34xsdedtFLdfHxj7tfwx24fe</adminactionpassword> 
    </accountData> 
    <origTrxNumber>1-25949395</origTrxNumber> 
    <transactionData> 
    <trxAmount>119</trxAmount> 
    <trxCurrency>EUR</trxCurrency> 
    </transactionData> 
    </capture> 
</SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

그리고 예를 들어 응답

<?xml version="1.0" encoding="ISO-8859-1"?> 
<SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<SOAP-ENV:Body> 
    <ns1:captureResponse 
    xmlns:ns1="https://ipayment.de/service_v3/binding"> 
    <ipaymentReturn> 
    <status>SUCCESS</status> 
    <successDetails> 
     <retTransDate>25.07.08</retTransDate> 
     <retTransTime>17:08:08</retTransTime> 
     <retTrxNumber>1-25949407</retTrxNumber> 
     <retAuthCode></retAuthCode> 
    </successDetails> 
    <addressData> 
     <addrStreet>Ernst-Frey-Str. 9</addrStreet> 
     <addrCity>Karlsruhe</addrCity> 
     <addrZip>76135</addrZip> 
     <addrCountry>DE</addrCountry> 
    </addressData> 
    <addresscheckResult>UNCHECKED</addresscheckResult> 
    <paymentMethod>VisaCard</paymentMethod> 
    <trxPaymentDataCountry>US</trxPaymentDataCountry> 
    </ipaymentReturn> 
    </ns1:captureResponse> 
</SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

이다 그러나 나는 어떻게 Grails는 그림과 같이 요청을 만드는 아무 생각이 없습니다. Spring WS 플러그인을 사용하려고하지만 문서의 샘플 코드는 전혀 도움이되지 않습니다. 몇 가지 예나 아이디어에 대한 정보를 알고 있습니까? WSDL 스키마는 https://ipayment.de/service/3.0/?wsdl 에 있습니다.

답변

2

WS에 대한 인증에 쿠키가 필요하지 않은 경우 (및 쿠키가 :-) 안되는 경우) groovy-wslite은 SOAP 요청을 생성하는 데 유용한 라이브러리입니다.

또 다른 방법은 필요한 경우 투어 정확한 요청을 만들고 쿠키를 처리 할 수있는 HTTPBuilder을 사용하는 것입니다 (당신이 할 수 wslite으로하지만, 좀 더 작품에)

+0

덕분에 도움이되었습니다. – ufucuk

0

스크립트 경우, 팁은 수 Groovy에서 직접 컬 (사용 가능하다면)을 사용하십시오. 그것은 꽤 강력하고, 다루기 쉬우 며 한 줄짜리로 할 수 있습니다.

예 : "컬 -d \"$ {페이로드}의 Content-Type \ "\ -H". 텍스트/XML을 \ "은 $가 {wsUrl}는"execute.text 페이로드는 요청 인 경우 (포함을 비누 봉투).