0
votes
web services - wsimport giving parse error - Stack Overflow
Asked
Viewed 2k times
0

I am getting strange parsing error when I try to import a WSDL using wsimport.

Error:-

org.xml.sax.SAXParseException: Invalid WSDL file: expected 
{http://schemas.xmlsoap.org/wsdl/}definitions found definitions at line 1)

I checked the WSDL and I am also surprised the first element of it is not

<wsdl:definitions ...>

But rather:

<definitions   xmlns:soap="https://schemas.xmlsoap.org/wsdl/soap/" ...>

Could this be the problem? The web service is external, so I dont have any control over the WSDL. One thing I know is that it is generated by JAX-WS 2.1.5. Is it a customized WSDL that my wsimport tool is not able to understand? If yes please tell me how to resolve this problem. Thanks.

    0

    Based on this conversation, the 2.1.5 version of JAX-WS might have generated an incorrect WSDL and you are using wsimport from a newer version.

    5
    • Thanks Attila. I switch to jdk1.6.0_04 (from jdk1.6.0_31) and I am getting different error now expected "schemas.xmlsoap.org/wsdl" May 10 2012 at 21:13
    • Not sure I understand your comment
      – Attila
      May 10 2012 at 21:21
    • New error :- expected link definitions found link definitions at (lineLine number = 1 May 10 2012 at 21:21
    • I am sorry , somehow I am not able to format the text. But the problem is - WSDL is accessible by https and I have certificates installed in the jre\lib but wsimport not able to resolve the scema location, Thanks for helping me May 10 2012 at 21:24
    • I don't think I can help you with that one. You could post another question describing your new situation
      – Attila
      May 10 2012 at 21:24
    0

    Do you have following part in the first line of the wsdl?

    <definitions   ...   xmlns="http://schemas.xmlsoap.org/wsdl/">
    

    If not, add it and it should be fine. Reason would be, that the namespace declaration for the wsdl is missing.

      Your Answer

      By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

      Not the answer you're looking for? Browse other questions tagged or ask your own question.

       
      2

      2 Answers

      0
      votes

      Based on this conversation, the 2.1.5 version of JAX-WS might have generated an incorrect WSDL and you are using wsimport from a newer version.

      0
      votes

      Do you have following part in the first line of the wsdl?

      <definitions   ...   xmlns="http://schemas.xmlsoap.org/wsdl/">
      

      If not, add it and it should be fine. Reason would be, that the namespace declaration for the wsdl is missing.