this is crossposted from StackOverflow:
https://stackoverflow.com/questions/45072417/can-i-call-a-java-ws-security-enabled-web-service-with-perls-xmlcompile
I'm looking to call the following Java WS-Security enabled web service with XML::Compile, but I'm not certain that it can handle it.
For example I searched its CPAN repository for the tag 'EncryptedParts' and found nothing.
I see that it can handle signing with the use of XML::Compile::WSS::Signature but other than that I'm not sure how to proceed.
Is what I'm looking for possible with XML::Compile or even Perl?
<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http
+://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://bean.test.com/" xmlns
+:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xm
+lsoap.org/wsdl/soap/" name="MainWSClassService" targetNamespace="http
+://bean.test.com/">
<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" x
+mlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wss
+ecurity-utility-1.0.xsd" wsu:Id="MainWSClassPort_Fault_Policy"/>
<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" x
+mlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wss
+ecurity-utility-1.0.xsd" wsu:Id="MainWSClassPort_Input_Policy">
<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securi
+typolicy">
<sp:Body/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing
+"/>
<sp:Header Name="fmw-context" Namespace="http://xmlns.oracle.com/fmw/c
+ontext/1.0"/>
<sp:Header Name="SignatureConfirmation" Namespace="http://docs.oasis-o
+pen.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"/>
<sp:Header Name="SignatureConfirmation" Namespace="http://docs.oasis-o
+pen.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"/>
<sp:Header Name="SignatureConfirmation" Namespace="http://docs.oasis-o
+pen.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"/>
<sp:Header Name="SignatureConfirmation" Namespace="http://docs.oasis-o
+pen.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"/>
</sp:SignedParts>
<sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/sec
+uritypolicy">
<sp:Body/>
<sp:Header Name="fmw-context" Namespace="http://xmlns.oracle.com/fmw/c
+ontext/1.0"/>
</sp:EncryptedParts>
</wsp:Policy>
<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" x
+mlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wss
+ecurity-utility-1.0.xsd" wsu:Id="MainWSClassPort_Output_Policy">
<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securi
+typolicy">
<sp:Body/>
</sp:SignedParts>
<sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/sec
+uritypolicy">
<sp:Body/>
</sp:EncryptedParts>
</wsp:Policy>
<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" x
+mlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wss
+ecurity-utility-1.0.xsd" wsu:Id="wss11_username_token_with_message_pr
+otection_service_policy">
<sp:SymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/s
+ecuritypolicy">
<wsp:Policy>
<sp:ProtectionToken>
<wsp:Policy>
<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/
+ws/2005/07/securitypolicy/IncludeToken/Never">
<wsp:Policy>
<sp:RequireThumbprintReference/>
<sp:WssX509V3Token11/>
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:ProtectionToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic128/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Lax/>
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp/>
<sp:OnlySignEntireHeadersAndBody/>
</wsp:Policy>
</sp:SymmetricBinding>
<sp:SignedSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/200
+5/07/securitypolicy">
<wsp:Policy>
<sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2
+005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp:WssUsernameToken10/>
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SignedSupportingTokens>
<sp:Wss11 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypoli
+cy">
<wsp:Policy>
<sp:RequireSignatureConfirmation/>
<sp:MustSupportRefEncryptedKey/>
</wsp:Policy>
</sp:Wss11>
</wsp:Policy>
<types>
<xsd:schema>
<xsd:import namespace="http://bean.test.com/" schemaLocation="
+https://test.com:443/testWSS_context-root/MainWSClassPort?xsd=1"/>
</xsd:schema>
</types>
<message name="cancelTransfer">
<part name="parameters" element="tns:cancelTransfer"/>
</message>
<message name="cancelTransferResponse">
<part name="parameters" element="tns:cancelTransferResponse"/>
</message>
<message name="cancelDischarge">
<part name="parameters" element="tns:cancelDischarge"/>
</message>
<message name="cancelDischargeResponse">
<part name="parameters" element="tns:cancelDischargeResponse"/>
</message>
<message name="cancelAdmission">
<part name="parameters" element="tns:cancelAdmission"/>
</message>
<message name="cancelAdmissionResponse">
<part name="parameters" element="tns:cancelAdmissionResponse"/>
</message>
<message name="saveDischarge">
<part name="parameters" element="tns:saveDischarge"/>
</message>
<message name="saveDischargeResponse">
<part name="parameters" element="tns:saveDischargeResponse"/>
</message>
<message name="saveTransfer">
<part name="parameters" element="tns:saveTransfer"/>
</message>
<message name="saveTransferResponse">
<part name="parameters" element="tns:saveTransferResponse"/>
</message>
<message name="saveAdmission">
<part name="parameters" element="tns:saveAdmission"/>
</message>
<message name="saveAdmissionResponse">
<part name="parameters" element="tns:saveAdmissionResponse"/>
</message>
<portType name="MainWSClass">
<operation name="cancelTransfer">
<input message="tns:cancelTransfer"/>
<output message="tns:cancelTransferResponse"/>
</operation>
<operation name="cancelDischarge">
<input message="tns:cancelDischarge"/>
<output message="tns:cancelDischargeResponse"/>
</operation>
<operation name="cancelAdmission">
<input message="tns:cancelAdmission"/>
<output message="tns:cancelAdmissionResponse"/>
</operation>
<operation name="saveDischarge">
<input message="tns:saveDischarge"/>
<output message="tns:saveDischargeResponse"/>
</operation>
<operation name="saveTransfer">
<input message="tns:saveTransfer"/>
<output message="tns:saveTransferResponse"/>
</operation>
<operation name="saveAdmission">
<input message="tns:saveAdmission"/>
<output message="tns:saveAdmissionResponse"/>
</operation>
</portType>
<binding name="MainWSClassPortBinding" type="tns:MainWSClass">
<soap:binding style="document" transport="http://schemas.xmlsoap.o
+rg/soap/http"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004
+/09/policy" URI="#wss11_username_token_with_message_protection_servic
+e_policy" wsdl:required="false"/>
<operation name="cancelTransfer">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Input_Policy" wsdl:required
+="false"/>
</input>
<output>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Output_Policy" wsdl:require
+d="false"/>
</output>
</operation>
<operation name="cancelDischarge">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Input_Policy" wsdl:required
+="false"/>
</input>
<output>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Output_Policy" wsdl:require
+d="false"/>
</output>
</operation>
<operation name="cancelAdmission">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Input_Policy" wsdl:required
+="false"/>
</input>
<output>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Output_Policy" wsdl:require
+d="false"/>
</output>
</operation>
<operation name="saveDischarge">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Input_Policy" wsdl:required
+="false"/>
</input>
<output>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Output_Policy" wsdl:require
+d="false"/>
</output>
</operation>
<operation name="saveTransfer">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Input_Policy" wsdl:required
+="false"/>
</input>
<output>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Output_Policy" wsdl:require
+d="false"/>
</output>
</operation>
<operation name="saveAdmission">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Input_Policy" wsdl:required
+="false"/>
</input>
<output>
<soap:body use="literal"/>
<wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org
+/ws/2004/09/policy" URI="#MainWSClassPort_Output_Policy" wsdl:require
+d="false"/>
</output>
</operation>
</binding>
<service name="MainWSClassService">
<port name="MainWSClassPort" binding="tns:MainWSClassPortBinding">
<soap:address location="https://test.com:443/testWSS_context-r
+oot/MainWSClassPort"/>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/ad
+dressing">
<wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">
https://test.com:443/testWSS_context-root/MainWSClassPort
</wsa:Address>
<wsid:Identity xmlns:wsid="http://schemas.xmlsoap.org/ws/2006/02/a
+ddressingidentity">
<dsig:KeyInfo xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
<dsig:X509Data>
<dsig:X509Certificate>
MIIC0jCCAjsCCQC3l6TlmarTfzANBgkqhkiG9w0BAQUFADCBqTELMA1IxD
+zANBgNVBAgTBkFUVElDQTEPMA0GA1UEBxMGQVRIRU5TMUgwRgYDVQQKEz9Tb2NpYWwgSW
+5zdXJhbmNlIEluc3RpdHV0ZS1VbmlmaWVkIEluc3VyYW5jZSBGdW5kIGZvciBFbXBsb3l
+lZXMxHTAbBgNVBAsTFElLQS+RFzbqAYxkd7e6jaOUpOgdhiB2MlGivNIqG3rVdG0b8C0u
+V3qWePilnWZB+vnnakEJLQzt/w3JMsJpbU0q1yeUzHQIDAQABMA0GCSqGSIb3DQEBBQUA
+A4GBAC1fHcjN9OrAaE6cCoaezje1nEhfkR1MiUa27tctpDwcLZL4Xg0yHqbXmaLl3jffc
+QHnSdJuRS7tLiKmeM/ZaEIHWDGhjAyf6pG+ruWydmgZLGAki+evqZDh10j2rY0x7A5A
</dsig:X509Certificate>
<dsig:X509IssuerSerial>
<dsig:X509IssuerName>
CN=TEST CA, OU=TEST-E IT Division, O=XXX, L=XXX, ST=XX
+X, C=XX
</dsig:X509IssuerName>
<dsig:X509SerialNumber>1336456967</dsig:X509SerialNumber>
</dsig:X509IssuerSerial>
<dsig:X509SubjectName>
CN=xxx.test.com, OU=TEST-E IT Division, O=XXX, L=XXX, ST=X
+XX, C=XX
</dsig:X509SubjectName>
</dsig:X509Data>
</dsig:KeyInfo>
</wsid:Identity>
</wsa:EndpointReference>
</port>
</service>
</definitions>
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.