Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Policy problems with a WSDL file I'm trying to use...(I'm receiving an error about a WSDL file I'm using in a Dynamic Web Project with issues surrounding "wsp:Policy"...)
Policy problems with a WSDL file I'm trying to use... [message #701707] Mon, 25 July 2011 13:24 Go to next message
caseyburk is currently offline caseyburkFriend
Messages: 5
Registered: July 2011
Junior Member
Here's what I have in my development environment:
- Ant 1.6
- Axis2 1.5.2
- Eclipse Indigo
- Tomcat 6.0
- Everything is installed in C:\Program Files\Apache Software Foundation\* and I'm using localhost:8888 for testing and development.
- The WSDL I'm trying to consume uses the PESC specification (for whatever it's worth).

(If you need anymore details involving the environment I have, please let me know.)


Here's the issue I'm having at the moment:
I'm trying to consume a WSDL file using a TOP-DOWN approach (found on a page I can't link to due to being new to the forum), but when I do this, I get the following "WSDL Problem" error in the "Markers" tab:

Quote:
cvc-complex-type.5.2: In element 'wsp:Policy', attribute 'Id' is a Wild ID. But there is already an attribute 'Id' derived from ID among the {attribute uses}.


In my inexperienced Eclipse mind, it seems there's some sort of issue with the use of an id somewhere in the WSDL file or an alignment of an XSD schema element, but if that's the case, I'm a bit unsure about how to go about fixing this. I've noticed that the complete removal of the policy section in question seemingly solves the error altogether, but with the minor exception of removing pertinent security code (ha). So obviously, if there's a way to preserve the meat-and-potatoes, so-to-speak, I would like to.

The code in question is as follows:
<wsp:Policy wsu:Id="UsernameTokenSecurityPolicyPasswordOptional"
      xmlns:wsu="<LOCATION>/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsp:ExactlyOne>
          <wsp:All>
            <wsse:SecurityToken wsp:Usage="wsp:Required"
            xmlns:wsse="<LOCATION>/oasis-200401-wss-wssecurity-secext-1.0.xsd">
              <wsse:TokenType>wsse:UserNameToken</wsse:TokenType>
              <Claims>
                <SubjectName MatchType="wsse:Exact" />
                <UsePassword wsp:Usage="wsp:Optional" />
              </Claims>
            </wsse:SecurityToken>
          </wsp:All>
        </wsp:ExactlyOne>
      </wsp:Policy>


So what gives? Any information to help me out with all this is greatly appreciated and if you need any further information about anything, again, let me know. I'm new to consuming WSDL files--very new to it all--so I may have inadvertently left out some sort of important detail you might need. If so, I do apologize.
Re: Policy problems with a WSDL file I'm trying to use... [message #720677 is a reply to message #701707] Wed, 31 August 2011 04:18 Go to previous messageGo to next message
cu2sr is currently offline cu2srFriend
Messages: 5
Registered: August 2011
Junior Member
Did you ever get your questioned answered? I'm running into the same issue. I wasn't sure if it was unique to Eclipse or if it was my Wsdl, but it seems to be only with Eclipse.
Re: Policy problems with a WSDL file I'm trying to use... [message #720694 is a reply to message #720677] Wed, 31 August 2011 05:01 Go to previous messageGo to next message
caseyburk is currently offline caseyburkFriend
Messages: 5
Registered: July 2011
Junior Member
Surprisingly, no, and rest assured, I've tried everything ranging from IIRC chats to posting to blogs and other forums. It seems that this problem is either really simple to almost being obvious by most in our field, else, it's extremely rare and very unorthodox, requiring a skill set only 20-year vets could have.

In any event (and humor aside), I have come across a couple people in IIRC that seemed to believe that this issue is caused by the implied passing of parameters numbering more than those indicated by whatever DTDs a given document may have for said element in question. In other words, this "policy" element attempting to implement whatever form of security the DTD (or XSD?) document defines as being the proper number of parameters is possibly being incorrectly supplied (either in quantity or type). I hope this makes sense. Most seem to believe that this is caused by passing the incorrect number of parms, but if this is the case, I'm at a loss still because my personal code doesn't seem to fall in line with that explanation as I've tried to backtrack it to no avail.

If this isn't the true explanation, well, the only other thing I can think of is some sort of malformation of the required DTDs or overall schema definition itself. I'm by no means an XML guru--as a matter of fact, I prefer to avoid it altogether and stick with my PHP roots--but judging from everything I've researched, I think it's probably something to do with the first issue I just mentioned about implied parms.

Please let me know if you find out anything on your end.
Re: Policy problems with a WSDL file I'm trying to use... [message #721017 is a reply to message #720694] Wed, 31 August 2011 17:25 Go to previous messageGo to next message
cu2sr is currently offline cu2srFriend
Messages: 5
Registered: August 2011
Junior Member
I followed the suggestion here: charithaka.blogspot.com/2008/07/how-to-validate-wsdl-using-eclipse.html. Downloaded the latest version of Eclipse, started a new project, created a new WSDL and copy/pasted my service provider's WSDL into it. Of course it failed validation. After a couple of tweeks I came to the following conclusion:

The wsu:Id parameter is already defined in the policy dtd. My service provider is attempting to overload it by redefining the namespace (the part in red.)

<wsp:Policy wsu:Id="UsernameTokenSecurityPolicyPasswordOptional1" xmlns:wsu="http: // docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">

If I change the namespace to be the same as what's defined in the policy dtd it works. Or if I remove the code in red entirely, it works. Add this to your feedback and what I'm figuring is Eclipse isn't treating it as an overload, but as an additional parameter and saying, "Hey, you've already got something defined as wsu:Id." Where really what it should be doing is saying "Oh, I see this attribute has the same name as the previously defined one so it must replace it."

Other utilities I tried (SoapUI (www.soapui.org) and various online WSDL validators) had no problems with this so I think it's a bug with the Eclipse wtp.

The stupid thing, at least for me, is the old definition of wsu:Id is the exact same as the new one, so there's no reason to overload it. I've decided my workaround will be to download my service provider's WSDL and modify it by removing the attempt to overload wsu:Id. Otherwise, I would have to build my own policy dtd.

Thanks for your help.

Re: Policy problems with a WSDL file I'm trying to use... [message #721374 is a reply to message #701707] Thu, 01 September 2011 15:28 Go to previous message
cu2sr is currently offline cu2srFriend
Messages: 5
Registered: August 2011
Junior Member
I entered a bug with the WTP team. Their response.

Quote:
The validator is based on WSDL4J so this bug is against them. See sourceforge.net/projects/wsdl4j/
Previous Topic:Default XPath View
Next Topic:XPath Namespace Prefixes Problem
Goto Forum:
  


Current Time: Sat Dec 20 22:23:46 GMT 2014

Powered by FUDForum. Page generated in 0.01648 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software