Skip to main content

Help in uderstand how solve "ERROR: Policy for the service could not be obtained"

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
gets0ul
Offline
Joined: 2008-09-01

Hi, I'm trying to develop a client for a web service that uses https secure
connection and a certificate.

The policy configuration that I have in the client is this:

instead in the WSDL of the server part is this:

but when I'm trying to invoke the service from the client in the stack trace
I have :

GRAVE: Policy is null
22-feb-2013 9.50.22 com.sun.xml.wss.jaxws.impl.SecurityClientTube
processClientResponsePacket
GRAVE: WSSTUBE0025: Error in Verifying Security in the Inbound Message.
com.sun.xml.wss.impl.PolicyViolationException: ERROR: Policy for the service
could not be obtained
..
Exception in thread "main" javax.xml.ws.WebServiceException: WSSTUBE0025:
Error in Verifying Security in the Inbound Message.

Someone can help me in order to understand how solve this problem?
Thanks in advance!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kumar Jayanti Guest
Offline
Joined: 2011-04-02

can u send a small reproducible test case (server and client) that does not have all your code. I can then take a look.
On Feb 22, 2013, at 2:51 PM, carlog wrote:

> Hi, I'm trying to develop a client for a web service that uses https secure
> connection and a certificate.
>
> The policy configuration that I have in the client is this:
>
>
>
>
> storepass="changeit" type="JKS"
> location="C:\keystore_cle.jks" />
> type="JKS"
> location="C:\keystore_cle.jks" />
>
>
>
>
> instead in the WSDL of the server part is this:
>
>
>
>
>
>
>
>
>
>
>
>
>
> sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
>
>
>
>
>
>
>
>
>
>
> Name="To" />
> Name="attributiAutorizzativi" />
> Namespace="http://www.w3.org/2005/08/addressing" />
> />
> Namespace="http://www.w3.org/2005/08/addressing" />
> />
>
>
>
>
>
>
>
>
>
>
>
> but when I'm trying to invoke the service from the client in the stack trace
> I have :
>
> GRAVE: Policy is null
> 22-feb-2013 9.50.22 com.sun.xml.wss.jaxws.impl.SecurityClientTube
> processClientResponsePacket
> GRAVE: WSSTUBE0025: Error in Verifying Security in the Inbound Message.
> com.sun.xml.wss.impl.PolicyViolationException: ERROR: Policy for the service
> could not be obtained
> ..
> Exception in thread "main" javax.xml.ws.WebServiceException: WSSTUBE0025:
> Error in Verifying Security in the Inbound Message.
>
>
> Someone can help me in order to understand how solve this problem?
> Thanks in advance!
>
>
>
>
>