3
soap4r을 사용하여 SOAP :: Header :: SimpleHandler를 사용하려고 시도했지만 보내는 메시지에 사용자 정의 헤더를 넣으려고했으나 제대로 작동하지 않습니다.soap4r 사용자 정의 헤더
<ServiceContext xmlns="http://context.core.datamodel.fs.documentum.emc.com/">
<Identities xsi:type="RepositoryIdentity" userName="_USER_" password="_PWD_" repositoryName="_DOCBASE_" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</ServiceContext>
:
내가 반환하는 데 필요한
<n1:ServiceContext xmlns:n1="http://context.core.datamodel.fs.documentum.emc.com/"
env:mustUnderstand="0">
<n1:Identities>
<n1:Username>username</n1:Username>
<n1:Password>password</n1:Password>
<n1:Docbase>Test</n1:Docbase>
</n1:Identities>
</n1:ServiceContext>
은 다음과 같다 :
class ServiceContext < SOAP::Header::SimpleHandler
NAMESPACE = "http://context.core.datamodel.fs.documentum.emc.com/"
def initialize()
super(XSD::QName.new(NAMESPACE, 'ServiceContext'))
XSD::QName.new(nil, "Identities")
end
def on_simple_outbound
username = "username"
password = "password"
docbase = "Test"
return {"Identities" => {"Username" => username, "Password" => password, "Docbase" => docbase}}
end
end
반환하는 방법이 속성보다는 같은 하위 요소를 포함 얻을 수
도움을 주시면 대단히 감사하겠습니다.