This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 184980 - PolicyReference & Policy Operators
Summary: PolicyReference & Policy Operators
Status: RESOLVED WONTFIX
Alias: None
Product: webservices
Classification: Unclassified
Component: WSIT (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Martin Grebac
URL: http://java.net/jira/browse/WSIT-1415
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-26 12:23 UTC by ritzmann
Modified: 2016-07-07 09:54 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
WSDL (5.61 KB, text/xml)
2010-04-26 12:24 UTC, ritzmann
Details
broken WSDL (9.08 KB, text/xml)
2010-05-17 07:51 UTC, d039113
Details
corrected WSDL (10.02 KB, text/xml)
2010-05-17 07:51 UTC, d039113
Details
Sample project (44.62 KB, application/x-zip-compressed)
2010-05-17 07:52 UTC, d039113
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ritzmann 2010-04-26 12:23:20 UTC
Copied from https://wsit.dev.java.net/issues/show_bug.cgi?id=1415

When creating a ws-consumer using NetBeans 6.8 for a service using SSL with a 
username token for authentication, the security is not recgnized by NetBeans as 
the PolicyReference is not resolved when embedded in a Policy Tag,
i.e.:
<wsdl:binding name="W_TS_AMU_W10_S0_710_C711" type="tns:WSSE_ECHO">
 <wsp:Policy>
   <wsp:PolicyReference URI="#BN_BN_W_TS_AMU_W10_S0_710_C711"/>
 </wsp:Policy>

Let me give you two examples, one working, one is not working:

Working:

<wsdl:binding name="W_TS_AMU_W10_S0_710_C711" type="tns:WSSE_ECHO">
<!--wsp:Policy-->
		<wsp:PolicyReference URI="#BN_BN_W_TS_AMU_W10_S0_710_C711"/>
<!--/wsp:Policy-->
		<soap:binding transport="http://schemas.xmlsoap.org/soap/http" 
style="document"/>
		<wsdl:operation name="WSSE_ECHO">
			<soap:operation style="document"/>
			<wsdl:input>
				<soap:body use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
</wsdl:binding>

Not Working:
<wsdl:binding name="W_TS_AMU_W10_S0_710_C711" type="tns:WSSE_ECHO">
	<wsp:Policy>
			<wsp:PolicyReference 
URI="#BN_BN_W_TS_AMU_W10_S0_710_C711"/>
	</wsp:Policy>
	<soap:binding transport="http://schemas.xmlsoap.org/soap/http" 
style="document"/>
	<wsdl:operation name="WSSE_ECHO">
		<soap:operation style="document"/>
		<wsdl:input>
			<soap:body use="literal"/>
		</wsdl:input>
		<wsdl:output>
			<soap:body use="literal"/>
		</wsdl:output>
	</wsdl:operation>
</wsdl:binding>

According to WS Policy 1.5 [1] PolicyReference is an operator and as such is 
defined within a Policy element (see section 4.33 cited below).

<cite>
4.3.3 Policy Operators
Policies are used to convey a set of capabilities, requirements, and general 
characteristics of entities (see 1. Introduction). These are generally 
expressible as a set of policy alternatives. Policy operators (wsp:Policy, 
wsp:All and wsp:ExactlyOne elements) are used to group policy assertions into 
policy alternatives. To compactly express complex policies, policy operators 
MAY be recursively nested; that is, one or more instances of wsp:Policy, 
wsp:All, and/or wsp:ExactlyOne MAY be nested within wsp:Policy, wsp:All, and/or 
wsp:ExactlyOne.

The schema outline for the wsp:Policy element in the compact form is as follows:

(01) <wsp:Policy … >
(02)   ( <wsp:Policy …>…</wsp:Policy> |
(03)     <wsp:ExactlyOne>…</wsp:ExactlyOne> |         
(04)     <wsp:All>…</wsp:All> |
(05)     <wsp:PolicyReference … >…</wsp:PolicyReference> |
(06)     …
(07)   )* 
(08) </wsp:Policy>
</cite>

Please correct the behaviour in NetBeans/Metro

[1]http://www.w3.org/TR/ws-policy/
[2]http://www.w3.org/TR/ws-policy/#Policy_Operators
Comment 1 ritzmann 2010-04-26 12:24:40 UTC
Created attachment 98021 [details]
WSDL
Comment 2 d039113 2010-04-26 18:55:50 UTC
added me as cc
Comment 3 Martin Grebac 2010-04-28 13:39:34 UTC
Thanks for submission, will investigate. NB wsit plugin support for policy references is rather minimal right now, should be upgraded to higher level also wrt support of external references.
Comment 4 ritzmann 2010-05-10 07:56:42 UTC
d039113, could you please provide a sample with simpler policies to demonstrate the issue? It seems like NetBeans isn't actually able to read your policies in the first place.
Comment 5 d039113 2010-05-17 07:50:56 UTC
I prepared a set of files to reproeduce the issue:
1) broken.wsdl: This wsdl does not work with NetBeans 6.8
2) fixed.wsdl: Similar to the broken.wsdl, but corrected by commenting the wsp:Policy
		<!--wsp:Policy-->
		<wsp:PolicyReference URI="#BN_BN_W_TH_AMS_W10_S0_710_C710"/>
		<!--/wsp:Policy-->
3) WSDLTest.zip: a NetBeans 6.8 project containing a ws-proxy for each of the WSDL files. Please check the WebService References->Edit Web Service Attributes
Comment 6 d039113 2010-05-17 07:51:34 UTC
Created attachment 99069 [details]
broken WSDL
Comment 7 d039113 2010-05-17 07:51:54 UTC
Created attachment 99070 [details]
corrected WSDL
Comment 8 d039113 2010-05-17 07:52:11 UTC
Created attachment 99071 [details]
Sample project
Comment 9 Martin Balin 2016-07-07 09:54:02 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss