File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes WSDL parse error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "WSDL parse error" Watch "WSDL parse error" New topic
Author

WSDL parse error

Sam Powell
Greenhorn

Joined: Nov 06, 2007
Posts: 7
Hi
I am using wsdl2java and seeing this parse error -




My WSDL looks like this -


I am using Axis2 1.5 version. Any help is appreciated.
Sam Powell
Greenhorn

Joined: Nov 06, 2007
Posts: 7
Anyone have any clue for this issue...hit a complete road block here... :
Shailesh Welankar
Ranch Hand

Joined: Dec 30, 2002
Posts: 35
Sam

Your WSDL looks incomplete to me. You may try this and let me know -
1. Add (define) the elements QuoteConfigRequest and QuoteConfigResponse within your <wsdl:types> tags.
Something like :
<xs:element name="QuoteConfigRequest ">
<xs:complexType>
<xs:sequence>
<xs:element name="requestID" type="xs:long"/>
</xs:sequence>
</xs:complexType>
</xs:element>

and
<xs:element name="QuoteConfigResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>


be sure to mention the targetNamespace value properly in the <xsd:schema> tag.

2. Your <wsdl:message> tags seem wrong (are you validating this WSDL file before running through wsdl2java??).
Change it to look something like:
<s0:message name="QuoteConfigRequest ">
<s0:part element="s1:QuoteConfigRequest " name="parameters"/>
</s0:message>
<s0:message name="QuoteConfigResponse">
<s0:part element="s1:QuoteConfigResponse" name="parameters"/>
</s0:message>

Hope this solves you issues and I was able to understand and explain your problems correctly.
Axis2 wsdl2java is pretty error proof for simple WSDLs like yours. Have your WSDL validated once before you send it to wsdl2java (if you are not already doing it) and you should not have any errors.


--Shailesh Welankar
SCDJWS 1.4 | SCBCD 5.0 | SCWCD 1.4 | SCJP 1.4 | Preparing for SCEA 5
Shailesh Welankar
Ranch Hand

Joined: Dec 30, 2002
Posts: 35

I am sorry, I overlooked the schemaLocation="../schema/QM.xsd" entry in your WSDL and assume that your type declarations in the xsd are proper.
In that case, disregard my point #1. You can have a look at point #2 and try it.
Sam Powell
Greenhorn

Joined: Nov 06, 2007
Posts: 7
Shailesh, thanks for looking into this.

I think the XSD file is defined correctly - Here's a snippet.


When I validate the WSDL file, this is the error message I am seeing.


As far as your #2 suggestion, are you saying that the <wsdl:message> is incorrect The "wsdl" prefix is defined in the WSDL as -xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/", Perhaps I am missing something here.

The weird thing is Axis 1.4 doesn't seem to complain about this WSDL while AXIS2 1.5 has trouble parsing the file
-Sam
Shailesh Welankar
Ranch Hand

Joined: Dec 30, 2002
Posts: 35

Just consider the "s0" that I mention as NS to be "wsdl" in your case (i did a copy-paste without find-replace)
What i wanted to say was change your code *based* on the entries in my point #2. So even the s1 NS prefix in my code should correspond to what you have.

Coming back to your issue, so the WSDL is definitely not validated, at least not to the liking of Axis2 v1.5.
We need to focus on that - But the WSDL validation error you are receiving certainly beats me!
One thing I can see in common with both the errors you have received is that some how v1.5 does not like the xsd defined externally ... can you try making the xsd declarations inline (as I have mentioned in my point#1) and give it a shot.
Sam Powell
Greenhorn

Joined: Nov 06, 2007
Posts: 7
Changing the "wsdl" prefix to "s0" didn't really help, still seeing the same error. However, I did go ahead and a qualifier(qm) for the message names



That seemed to help. I am able to generate the Java code, still haven't looked into the code to see if any mappings are different due to this new prefix.

Any idea why adding this prefix makes a difference to AXIS?
-Sam
Shailesh Welankar
Ranch Hand

Joined: Dec 30, 2002
Posts: 35
I have never tried this, but most probably, because you have both the NS "qm" and "qbm" pointing to the same location there might have been an ambiguity with Axis2. When you specifically mentioned the NS "qm" to it, Axis2 was OK with it and it generated the Java code.
Go ahead and work out with the client stub generated - I dont think there will be any major issues just by changing the NS which are the same anyways.
So I guess your issue is resolved?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I see that you somehow resolved the problem, but I would still recommend you to try the following:
In your XML schema, add a global element declaration for the messages:


Then in your <message> declaration, you refer to the global XML schema elements using the element attribute, not the type attribute:

Best wishes!
 
wood burning stoves
 
subject: WSDL parse error