WSDL validation in Eclipse fails for namespace - java

I've made a WSDL file and I intend to create top down web service out of it. Unfortunately, Eclipse throws this error:
"A problem occurred while running the WSDL validator for namespace http://schemas.xmlsoap.org/wsdl/"
I've made some research and it looks like it's happening because of some Eclipse wsdl-validation bug, explained here
Some guy there claims that he fixed this error with patch, and I've applied it, but the error stays and I'm starting to think that there's some problem with my wsdl file itself.
WebService is supposed to take a list(column) of ID's and return a 2-column table data based on those ID's.
Can you help me find out what is wrong with it?
Eclipse Java EE IDE for Web Developers.
Version: Mars.2 Release (4.5.2)
Build id: 20160218-0600
WTP 1.2.1.20150819-2220
Here's WSDL file:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="reb.ecm.ws.RebUtilsService"
xmlns="reb.ecm.ws.RebUtilsService"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:complexType name='DPList'>
<xsd:element
minOccurs='0'
maxOccurs='unbounded'
name='DP'
type='DP'/>
</xsd:complexType>
<xsd:complexType name='DP'>
<xsd:all>
<xsd:element
minOccurs='0'
maxOccurs='1'
name='DPID'
type='xsd:int'/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name='WSInfoList'>
<xsd:element
minOccurs='0'
maxOccurs='unbounded'
name='WSInfoItem'
type='WSInfoItem'/>
</xsd:complexType>
<xsd:complexType name='WSInfoItem'>
<xsd:all>
<xsd:element
minOccurs='0'
maxOccurs='1'
name='DPID'
type='xsd:int'/>
</xsd:all>
<xsd:all>
<xsd:element
minOccurs='0'
maxOccurs='1'
name='WSID'
type='xsd:int'/>
</xsd:all>
</xsd:complexType>
</wsdl:types>
<wsdl:message name="inMessage">
<wsdl:part name="DPList" type="DPList" />
</wsdl:message>
<wsdl:message name="outMessage">
<wsdl:part name="WSInfoList" type="WSInfoList" />
</wsdl:message>
<wsdl:portType name="RebUtilsServicePortType">
<wsdl:operation name="GetActualWSIDbyDPID" >
<wsdl:input message="inMessage" />
<wsdl:output message="outMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="RebUtilsServiceHTTPBinding"
type="RebUtilsServicePortType">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetActualWSIDbyDPID">
<wsdlsoap:operation soapAction=""/>
<wsdl:input>
<wsdlsoap:body use="literal" />
</wsdl:input>
<wsdl:output>
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="RebUtilsServicePorts">
<wsdl:port binding="RebUtilsServiceHTTPBinding" name="RebUtilsService">
<wsdlsoap:address
location="http://localhost:9084/RebUtilsService/RebUtilsServicePorts"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
UPDATE: There were no problem with Eclipse. At least patch, mentioned earlier fixed something.

Answer
Your schema is not properly defined. Please see the below image.
Kindly change it to your corrected datatype element which is defined in your schema definitions, Please change in Eclipse WSDL Design view.
Regenerate your client and let know the results.
You should have seperate XSD schema files and should be mapped based on your requirement, that's why it is failing and please have a look into the exploded design view.
General Rule
While creating a SOAP Service, Please define your required input/output XSD schemas
Using schema as in input you need to generate the WSDL file using your IDE/Maven/any build tool.
For easier manipulations/Edits, please choose Eclipse WSDL Editor.

Related

Failed to parse the WSDL

I am trying to generate src from wsdl using following tutorial but getting exception while wsimport.
http://www.mkyong.com/webservices/jax-ws/jax-ws-wsgen-tool-example/
wsimport -keep -verbose
http://localhost:7001/poc-war/ServerInfoService?wsdl
Getting following error :
C:\Program Files\Java\jdk1.8.0_102\bin>wsimport -keep -verbose http://localhost:7001/poc-war/ServerInfoService?wsdl
parsing WSDL...
[ERROR] Server returned HTTP response code: 504 for URL: http://localhost:7001/poc-war/ServerInfoService?wsdl
Failed to read the WSDL document: http://localhost:7001/poc-war/ServerInfoService?wsdl, because 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not <wsdl:definitions>.
[ERROR] Could not find wsdl:service in the provided WSDL(s):
At least one WSDL with at least one service definition needs to be provided.
Failed to parse the WSDL.
ServerInfoService?wsdl
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws.mkyong.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="ServerInfoService" targetNamespace="http://ws.mkyong.com/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://ws.mkyong.com/" targetNamespace="http://ws.mkyong.com/">
<xsd:complexType name="getIpAddressResponse">
<xsd:sequence>
<xsd:element minOccurs="0" name="return" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="getIpAddress"/>
<xsd:element name="getIpAddressResponse" type="ns0:getIpAddressResponse"/>
<xsd:element name="getIpAddress" type="ns0:getIpAddress"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="getIpAddress">
<wsdl:part element="tns:getIpAddress" name="parameters"/>
</wsdl:message>
<wsdl:message name="getIpAddressResponse">
<wsdl:part element="tns:getIpAddressResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="ServerInfo">
<wsdl:operation name="getIpAddress">
<wsdl:input message="tns:getIpAddress" name="getIpAddress"/>
<wsdl:output message="tns:getIpAddressResponse" name="getIpAddressResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ServerInfoServiceSoapBinding" type="tns:ServerInfo">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getIpAddress">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="getIpAddress">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getIpAddressResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ServerInfoService">
<wsdl:port binding="tns:ServerInfoServiceSoapBinding" name="ARMServicePortTypeImplPort">
<soap:address location="http://10.19.9.92:7001/poc-war/ServerInfoService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
This is a networking issue. You could open the wsdl in your browser copy and paste the text into a new .wsdl file and regenerate it from the hard drive URL vs a network URL.
I have had times where network security has made it impossible for me to reach WSDL's using some development tools so keeping a copy locally can work. I admit it is a work around at best but 502 is not easy to troubleshoot without a lot more information.

How to tell cxf to keep the wrapper types in methods?

In my WSDL I have an operation
<wsdl:operation name="theMethod">
<wsdl:input message="input1" name="input1"></wsdl:input>
<wsdl:output message="tns:classNumber1" name="classNumber1"></wsdl:output>
</wsdl:operation>
in my xsd, classNumber1 is a complex type and it is a wrapper for another type: classNumber2
<xs:complexType name="classNumber1">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="tns:classNumber2"/>
</xs:sequence>
</xs:complexType>
when I generate classes with cxf (I use cxf maven plugin), I expected that theMethod to return a ClassNumber1 but it was a ClassNumber2.
#WebMethod
#ResponseWrapper(localName="classNumber1" , className="com.model.ClassNumber")
public ClassNumber2 theMethod (Input1 input1){
...
}
Is there a way to tell cxf to generate the method with the wrapper CLassNumber1.
Thanks.
I find the solution in this doc, question "How can I switch my generated web service method calls from wrapper style to non wrapper-style (or vice-versa)?"
The solution to keep wrappers with cxf generation is to add a binding file in the pom.xml:
<defaultOptions>
<bindingFiles>
<bindingFile>${basedir}/src/main/resources/bindings.xjb</bindingFile>
</bindingFiles>
<noAddressBinding>true</noAddressBinding>
</defaultOptions>
In the binding file you set enableWrapperStyle to false:
<jaxws:bindings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://java.sun.com/xml/ns/jaxws"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
<enableWrapperStyle>false</enableWrapperStyle>
</jaxws:bindings>
Based on the information you have provided I have created a basic interface as shown below.
this works as per your expectation.
<xsd:complexType name="input1">
<xsd:sequence>
<xsd:element name="in" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ClassNumber1">
<xsd:sequence>
<xsd:element minOccurs="0" name="out" type="tns:ClassNumber2" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ClassNumber2">
<xsd:sequence>
<xsd:element name="out" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="input1">
<wsdl:part element="tns:input1" name="parameters" />
</wsdl:message>
<wsdl:message name="ClassNumber1">
<wsdl:part element="tns:ClassNumber1" name="parameters" />
</wsdl:message>
<wsdl:portType name="NewWSDLFile">
<wsdl:operation name="NewOperation">
<wsdl:input message="tns:input1" />
<wsdl:output message="tns:ClassNumber1" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NewWSDLFileSOAP" type="tns:NewWSDLFile">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="NewOperation">
<soap:operation soapAction="http://www.example.org/NewWSDLFile/NewOperation" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="NewWSDLFile">
<wsdl:port binding="tns:NewWSDLFileSOAP" name="NewWSDLFileSOAP">
<soap:address location="http://www.example.org/" />
</wsdl:port>
</wsdl:service>
Please check <wsdl:output message="tns:ClassNumber1" />
I believe you have given the wrong in your output information in your
<wsdl:message name="ClassNumber1">
<wsdl:part element="tns:ClassNumber1" name="parameters" />
</wsdl:message>
Hope this helps.

Interoperability of JAX-WS hashmap and .NET dictionary

Im creating a JAX-WS webservice on Wildfly 8.0 and consuming it on a VS2013 C# project, what I can't figure out is how can I map a HashMap to .net Dictionary.
My question is, is there a way to create a JAX-WS webservice that is compatible with the .net Dictionary and its automatically converted by the "Add service reference"?
"Add service reference" advanced settings:
Test webservice:
#WebService
#SOAPBinding(style = SOAPBinding.Style.RPC)
#BindingType(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
public class Test
{
#WebMethod
public HashMap<String, Pojo> echoMap(String input)
{
return new HashMap<String, Pojo>();
}
}
Generated WSDL:
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws.aiko.com/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="TestService" targetNamespace="http://ws.aiko.com/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.aiko.com/" targetNamespace="http://ws.aiko.com/" version="1.0">
<xs:element name="facility" type="tns:pojo"/>
<xs:complexType name="pojo">
<xs:sequence>
<xs:element minOccurs="0" name="Name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="echoMapResponse">
<wsdl:part name="return">
</wsdl:part>
</wsdl:message>
<wsdl:message name="echoMap">
<wsdl:part name="arg0" type="xsd:string">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="Test">
<wsdl:operation name="echoMap">
<wsdl:input message="tns:echoMap" name="echoMap">
</wsdl:input>
<wsdl:output message="tns:echoMapResponse" name="echoMapResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TestServiceSoapBinding" type="tns:Test">
<soap12:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="echoMap">
<soap12:operation soapAction="" style="rpc"/>
<wsdl:input name="echoMap">
<soap12:body namespace="http://ws.aiko.com/" use="literal"/>
</wsdl:input>
<wsdl:output name="echoMapResponse">
<soap12:body namespace="http://ws.aiko.com/" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TestService">
<wsdl:port binding="tns:TestServiceSoapBinding" name="TestPort">
<soap12:address location="http://localhost:8080/app/Test"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I don't think HashMap is interoperable; it also isn't a Java xml type known to JAXB (the framework which turns SOAP XML into java instances which is probably why it's not described in the WSDL.
You can use the tips in this post to provide an adapter Java class which tells the JAXB runtime how to convert your HashMap into an xml structure.
However, I doubt this will be natively consumed by a .Net client as Dictionary. You could try to produce the xml structure described in this article from your Java adapter in the hopes that it will be interpreted as Dictionary.

xs:import causing problems in wsimport and Metro runtime?

I've been working for a few days on a problem with a WSDL we've defined. We are using wsimport to generate code from the WSDL and then using that to run a service. During WSImport, 2 elements cannot be resolved somehow which throws warnings. Runtime however, these warnings turn into errors and we cannot run our service. How can we get rid of these warnings and therefore errors?
All pointers will be greatly appreciated.
We are using Metro 2.3 and Java 7.
The WSDL is using xsds from the HR-XML specification, but I trimmed them down to display the problem clearer.
wsimport is reporting:
MacBook-Pro-van-Martin:WSDL-problem sunsear$ wsimport -Xnocompile -s generated "file:DummyService.wsdl"
parsing WSDL...
[WARNING] src-resolve: Cannot resolve the name 'hr:Assignment' to a(n) 'element declaration' component.
line 14 of file:xsd/AssignmentRequestElement.xsd
[WARNING] src-resolve: Cannot resolve the name 'hr:HumanResource' to a(n) 'element declaration' component.
line 15 of file:xsd/AssignmentRequestElement.xsd
Generating code...
WSimport is complaining about hr:Assignment and hr:HumanResource which are referenced in the AssignmentRequestElement.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://personnel.services.com/services/2013-10"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:hr="http://ns.hr-xml.org/2007-04-15"
targetNamespace="http://personnel.services.com/services/2013-10"
elementFormDefault="qualified" version="2013-10">
<xsd:import namespace="http://ns.hr-xml.org/2007-04-15" schemaLocation="HR-XML-2_5/SIDES/Assignment.xsd"/>
<xsd:import namespace="http://ns.hr-xml.org/2007-04-15" schemaLocation="HR-XML-2_5/SIDES/HumanResource.xsd"/>
<xsd:element name="AssignmentRequestElement">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="hr:Assignment"/>
<xsd:element ref="hr:HumanResource" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
HumanResource looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://ns.hr-xml.org/2007-04-15"
targetNamespace="http://ns.hr-xml.org/2007-04-15" elementFormDefault="qualified" version="2007-04-15">
<xsd:complexType name="HumanResourceType">
<xsd:sequence>
<xsd:element name="HumanResourceId" type="xsd:string" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="HumanResource" type="HumanResourceType"/>
</xsd:schema>
Assignment looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://ns.hr-xml.org/2007-04-15" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ns.hr-xml.org/2007-04-15" elementFormDefault="qualified" version="2007-04-15">
<xsd:complexType name="AssignmentType">
<xsd:sequence>
<xsd:element name="AssignmentId" type="xsd:string" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="Assignment" type="AssignmentType"/>
</xsd:schema>
For completeness, this is the WSDL itself:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns="http://personnel.services.com/services/2013-10"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:hr="http://ns.hr-xml.org/2007-04-15" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://personnel.services.com/services/2013-10">
<wsdl:types>
<xsd:schema
elementFormDefault="qualified">
<xsd:import namespace="http://ns.hr-xml.org/2007-04-15"
schemaLocation="xsd/HR-XML-2_5/CPO/Acknowledgement.xsd"/>
<xsd:import namespace="http://personnel.services.com/services/2013-10"
schemaLocation="xsd/AssignmentRequestElement.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="AssignmentRequest">
<wsdl:documentation>A generic request of type Assignment (A) or Assignment+HumanResource (A+HR).
</wsdl:documentation>
<wsdl:part name="input" element="tns:AssignmentRequestElement"/>
</wsdl:message>
<wsdl:message name="Response">
<wsdl:documentation>A generic response of type Acknowledgement.</wsdl:documentation>
<wsdl:part name="output" element="hr:Acknowledgement"/>
</wsdl:message>
<wsdl:portType name="DummyService">
<wsdl:operation name="ProcessAssignment">
<wsdl:documentation>ProcessAssignment is used to send details of an Assignment
The request message is an Assignment (A) or
an Assignment+HumanResource (A+HR) message.
</wsdl:documentation>
<wsdl:input message="tns:AssignmentRequest"/>
<wsdl:output message="tns:Response"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SoapServiceHttpBinding" type="tns:DummyService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ProcessAssignment">
<wsdlsoap:operation soapAction="https://dummy.personnel.services.com/ws/DummySoapService/ProcessAssignment"
style="document"/>
<wsdl:input>
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DummySoapService">
<wsdl:port name="DummyServicesEndpoint" binding="tns:SoapServiceHttpBinding">
<wsdlsoap:address location="https://dummy.personnel.services.com/ws/DummySoapService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
The WSDL and XSDs are correct according to SoapUI and XMLSpy, they validate messages correctly.
The wsdl and xsds can be downloaded here:
https://www.dropbox.com/sh/t8klaoodjfsd772/G2MBGZxLE_
You have assigned 2 different schema-locations to the same namespaces URL. That could be the reason of this error, because now wsimport does not know where to search for hr: objects.
<xsd:import namespace="http://ns.hr-xml.org/2007-04-15" schemaLocation="HR-XML-2_5/SIDES/Assignment.xsd"/>
<xsd:import namespace="http://ns.hr-xml.org/2007-04-15" schemaLocation="HR-XML-2_5/SIDES/HumanResource.xsd"/>
Have a look at this stackoverflow question for solving this problem:
SAXParseException; src-resolve: Cannot resolve the name '...' to a(n) 'type definition' component

Not able to generate the stubs/java skeletons from the WSDL

I have written a WSDL to generate the Stubs and skeleton but my skeletons are not getting generated in the eclipse. I am using Helios version of Eclipse.
Can any one tell what is the issue with WSDL?
I want to use Axis 2. I tried to generate the skeleton using wsdl2java also but it gives compilation issues in the generated classes. I am not able to attach the file here so I am pasting it here.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:impl="http://DefaultNamespace"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="Test" targetNamespace="http://DefaultNamespace">
<wsdl:types>
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://DefaultNamespace" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://xml.apache.org/xml-soap" />
<xsd:element name="serviceMethod">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="vo" type="impl:MyVo" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="MyVo">
<xsd:sequence>
<xsd:element name="name" nillable="false" type="xsd:string" />
<xsd:element name="params" nillable="true"
type="apachesoap:Map" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="serviceMethodResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="serviceMethodReturn" type="impl:MyVo" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://DefaultNamespace" />
<xsd:complexType name="mapItem">
<xsd:sequence>
<xsd:element name="key" nillable="true" type="xsd:anyType" />
<xsd:element name="value" nillable="true" type="xsd:anyType" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Map">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0"
name="item" type="apachesoap:mapItem" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="serviceMethodRequest">
<wsdl:part element="impl:serviceMethod" name="parameters" />
</wsdl:message>
<wsdl:message name="serviceMethodResponse">
<wsdl:part element="impl:serviceMethodResponse" name="parameters" />
</wsdl:message>
<wsdl:portType name="Test">
<wsdl:operation name="serviceMethod">
<wsdl:input message="impl:serviceMethodRequest" name="serviceMethodRequest" />
<wsdl:output message="impl:serviceMethodResponse" name="serviceMethodResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TestSOAP" type="impl:Test">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="serviceMethod">
<soap:operation soapAction="http://DefaultNamespace/serviceMethod" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Test">
<wsdl:port binding="impl:TestSOAP" name="MyWebService">
<soap:address location="http://localhost:8080/Temp/services/MyService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
That's a problem with your install.
Download and verify axis2 and the axis2 eclipse plugins, make sure you've set up your AXIS2_HOME class paths.
Sometimes it stops working for me too, and then I have to go and reinstall everything. Don't bother making bug reports to Eclipse or Apache, they are always closed as "WORKSFORME".
Steps to produce code from your wsdl:
Create a dynamic web project.
Create your wsdl file.
Right-click on your wsdl file, select Web Services -> Generate Java Bean Skeleton
Click Finish
The Axis2 libraries, facets, and generated code will be added to your project automagically, and there will be no compilation problems.
I had the same problem. I believe maven folder structure is causing it. I created a new project without maven and it worked. Added maven later. Also check source folders at "Java Build Path". If it is missing you will need to add it.
I was facing the same trouble but now it has been solved. The problem is if you have a method that 'THROWS SOME KIND OF EXCEPTION', then it will cause the problem. Hence instead of throwing the error, try using try-catch block statement.

Categories