Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throw new PolicyViolationException("ERROR: No security header found in the message"); #459

Open
9611667063 opened this issue Jul 11, 2024 · 0 comments

Comments

@9611667063
Copy link

9611667063 commented Jul 11, 2024

Hello @glassfishrobot @Tomas-Kraus
I am facing below issue
throw new PolicyViolationException("ERROR: No security header found in the message");
below is my wsdl

<!-- Types section -->
<types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
               elementFormDefault="qualified"
               targetNamespace="http://localhost:8000/ibis/ws/1698157283592/Webservice111">
        <xs:element name="sayHello" type="xs:string"/>
        <xs:element name="sayHelloResponse" type="xs:string"/>
    </xs:schema>
</types>

<!-- Messages -->
<message name="Header">
    <part name="messageAddressing" element="wsc:MessageAddressing"/>
</message>
<message name="sayHelloRequest">
    <part name="parameters" element="wsc:sayHello"/>
</message>
<message name="sayHelloResponse">
    <part name="parameters" element="wsc:sayHelloResponse"/>
</message>

<!-- PortType -->
<portType name="WebservicePortType">
    <operation name="sayHello">
        <input message="wsc:sayHelloRequest"/>
        <output message="wsc:sayHelloResponse"/>
    </operation>
</portType>

<!-- Binding -->
<binding name="WebserviceBinding" type="wsc:WebservicePortType">
    <wsp:PolicyReference URI="#WebserviceBindingPolicy"/>
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="sayHello">
        <soap:operation soapAction="sayHello"/>
        <input>
            <soap:header message="wsc:Header" part="messageAddressing" use="literal"/>
            <wsp:PolicyReference URI="#SigningSecurityPolicy"/>
            <soap:body use="literal"/>
        </input>
        <output>
            <wsp:PolicyReference URI="#EmptySecurityPolicy"/>
            <soap:body use="literal"/>
        </output>
    </operation>
</binding>

<!-- Service -->
<service name="Webservice">
    <port name="WebservicePort" binding="wsc:WebserviceBinding">
        <soap:address location="http://localhost:8000/ibis/ws/Webservice"/>
    </port>
</service>

<!-- Policies -->
<wsp:Policy wsu:Id="WebserviceBindingPolicy">
    <wsp:ExactlyOne>
        <wsp:All>
            <wsam:Addressing wsp:Optional="false"/>
            <sp:AsymmetricBinding>
                <wsp:Policy>
                    <sp:InitiatorToken>
                        <wsp:Policy>
                            <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
                                <wsp:Policy>
                                    <sp:WssX509V3Token10/>
                                    <sp:RequireThumbprintReference/>
                                </wsp:Policy>
                            </sp:X509Token>
                        </wsp:Policy>
                    </sp:InitiatorToken>
                    <sp:RecipientToken>
                        <wsp:Policy>
                            <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
                                <wsp:Policy>
                                    <sp:WssX509V3Token10/>
                                </wsp:Policy>
                            </sp:X509Token>
                        </wsp:Policy>
                    </sp:RecipientToken>
                      <sp:AlgorithmSuite signatureAlgorithm="SHA256withRSA">
                <wsp:Policy>
                    <sp:Basic256Sha256/>
                </wsp:Policy>
            </sp:AlgorithmSuite>
                    <sp:Layout>
                        <wsp:Policy>
                            <sp:Strict/>
                        </wsp:Policy>
                    </sp:Layout>
                    <sp:IncludeTimestamp/>
                    <sp:OnlySignEntireHeadersAndBody/>
                </wsp:Policy>
            </sp:AsymmetricBinding>
            <sp:Wss11>
                <wsp:Policy>
                    <sp:MustSupportRefIssuerSerial/>
                    <sp:MustSupportRefThumbprint/>
                    <sp:MustSupportRefEncryptedKey/>
                </wsp:Policy>
            </sp:Wss11>
            <sp:Trust13>
                <wsp:Policy>
                    <sp:MustSupportIssuedTokens/>
                    <sp:RequireClientEntropy/>
                    <sp:RequireServerEntropy/>
                </wsp:Policy>
            </sp:Trust13>
        </wsp:All>
    </wsp:ExactlyOne>
</wsp:Policy>

<wsp:Policy wsu:Id="SigningSecurityPolicy">
    <sp:SignedParts>
        <sp:Body/>
    </sp:SignedParts>
</wsp:Policy>

<wsp:Policy wsu:Id="EmptySecurityPolicy">
    <sp:EncryptedParts>
        <sp:Body/>
    </sp:EncryptedParts>
</wsp:Policy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant