cancel
Showing results for 
Search instead for 
Did you mean: 

Error creating Webservice Client in JAVA for ABAP Webservice(WSDL file)

Former Member
0 Kudos

Hi all,

I have created a webservice from a funtion module in the backend.

Using soamanger I downloaded the wsdl file using "Open WSDL document for selected binding" link.

I tested this web service in backend and it is working fine.

Now I am trying to generate JAVA cilent for this webservice using Eclipse and Axis,but getting the following error

IWAB0399E Error in generating Java from WSDL:  WSDLException (at /wsdl:definitions/wsdl:portType/wsp:Policy): 

faultCode=INVALID_WSDL: Encountered unexpected element '{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy'.: 
    WSDLException (at /wsdl:definitions/wsdl:portType/wsp:Policy): faultCode=INVALID_WSDL: Encountered unexpected element 

'{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy'.:
    at com.ibm.wsdl.util.xml.DOMUtils.throwWSDLException(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parsePortType(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
    at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
    at java.lang.Thread.run(Unknown Source)

Please let me know,wat needs to be done for this error to get resolved

Thanks

Santhosh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I am also getting the same error while generating the client class from IBM Rational Application Developer IDE.

Here is the error I get.

WSDLException (at /wsdl:definitions/wsdl:portType/wsp:Policy): faultCode=INVALID_WSDL: Encountered unexpected element 'Policy'.:

[java] at com.ibm.wsdl.util.xml.DOMUtils.throwWSDLException(Unknown Source)

[java] at com.ibm.wsdl.xml.WSDLReaderImpl.parsePortType(Unknown Source)

[java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)

[java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

[java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

[java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

[java] at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)

[java] at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)

[java] at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)

[java] at java.lang.Thread.run(Thread.java:571)

Did you find out the cause of this issue?

Thanks & Regards,

Vijay

Former Member
0 Kudos

Hi Vijay,

IBM WSDL parsers don't seem to handle WSDL policies too well. This is why the previous poster also encountered the same error, I think the Axis framework started at IBM & should in theroy have an IBM WSDL parser.

Try using the standard (no ws policies) WSDL for client generation. Do this by changing the WSDL URL, replace the 'ws_policy' bit of the URL to 'standard'.

Regards, Trevor