webMethods 9.12 - create consumer with WS Policy

Hello guys,
I have wsdl from my partner and now try to connect as a consumer with his server.
In SoapUI everything works perfect (configuration in attachment).

Now I try to configure my service on IS server 9.12 with WS Policy, but there is a error:

I think the problem is in the ws-policy? I’m not sure is configured correctly. How ws-policy file should looks like?
Below my current version:


<wsp:Policy  Name="MyPolicyName"   wsu:Id="MyPolicyName"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
   <wsp:ExactlyOne>
      <wsp:All>
  			<sp:AsymmetricBinding>
				<wsp:Policy>
				      <sp:InitiatorToken>
						<wsp:Policy>
							<sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
								<wsp:Policy>
									<sp:WssX509V3Token10 />
									<sp:RequireIssuerSerialReference />  
								</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 />
									<sp:RequireIssuerSerialReference />  
								</wsp:Policy>
							</sp:X509Token>
						</wsp:Policy>
					</sp:RecipientToken>	
	
					<sp:AlgorithmSuite>
						<wsp:Policy>
							<sp:TripleDesRsa15 />
						</wsp:Policy>
					</sp:AlgorithmSuite>

					<sp:Layout>
						<wsp:Policy>
							<sp:Strict />
						</wsp:Policy>
					</sp:Layout>				

          <sp:OnlySignEntireHeadersAndBody />  		
				
				  </wsp:Policy>
			</sp:AsymmetricBinding>


			<sp:SupportingTokens>
				<wsp:Policy>
		
					<sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient" >
					
						<wsp:Policy>
							<sp:HashPassword />
						</wsp:Policy>
					</sp:UsernameToken>
				</wsp:Policy>
			</sp:SupportingTokens>

      <sp:SignedParts>  
        <sp:Body />  
      </sp:SignedParts>  


      </wsp:All>
  </wsp:ExactlyOne>
  </wsp:Policy>

In WSD on “Polices” tab I checked only “Input” value.


Solved!

WS Policy file is correct but the error was because of my IS default response handler.
That’s how override this handler:

  1. Create fake handler (empty flow).
  2. Register it using pub.soap.handler:registerWmConsumer
    (descriptiveName = , QNameList[0]/namespaceName = , QNameList[0]/localName = “Security”, handleResponseService = )
  3. Add to WSD (on “Handlers” tab)

Works perfect now!

List of registered handlers → pub.soap.handler:listConsumer
Remember that handlers are stored in memory. After every IS restart you should register it again.
I’ve added a new registerHandler service (with invoke registerWmCustomer) started automatically on every startup (right click on package → Properties → Startup/Shutdown services)

1 Like