Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Aegis Module, Annotations
-
Labels:None
-
Environment:Xfire with JSR-181 Annotations and pre-defined WSDL.
-
Number of attachments :
Description
When @WebService.wsdlLocation is set XFire 1.2-RC returns appropriate WSDL but it does not bind data based on WSDL.
Below is an example that describes the issue.
----------------------------------------------------------------
I created a Example POJO which has id, firstName and lastName. Then added a demo service that returns this POJO.
Initially I generated WSDL using XFire and then customized it by removing firstName and lastName. Then added WSDL location to the annotation.
Now XFire returns the proper WSDL with only ID.
But when I call the service return data contains firstName and lastName as well. So the data binding does not acknowledge WSDL contract.
#################
Service
#################
@WebService(serviceName = "DemoService",wsdlLocation = "DemoService.wsdl")
public class DemoService {
@WebMethod
@WebResult(name = "Example")
public Example getExample()
}
#################
Value Object
#################
package com.webervice.demo;
public class Example {
String id;
String firstName;
String lastName;
public String getId()
{ return id; }public void setId(String id)
{ this.id = id; }public String getFirstName()
{ return firstName; }public void setFirstName(String firstName)
{ this.firstName = firstName; }public String getLastName()
{ return lastName; }public void setLastName(String lastName)
{ this.lastName = lastName; }}
############################
Web Service Response
############################
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<getExampleResponse xmlns="http://demo.webervice.com">
<Example>
<firstName>DemoFirst</firstName>
<id>testid1</id>
<lastName>DemoLast</lastName>
</Example>
</getExampleResponse>
</soap:Body>
</soap:Envelope>
############################
Custom WSDL
############################
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://demo.webervice.com" xmlns:tns="http://demo.webervice.com"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding"
xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified"
elementFormDefault="qualified" targetNamespace="http://demo.webervice.com">
<xsd:element name="getExample">
<xsd:complexType/>
</xsd:element>
<xsd:complexType name="Example">
<xsd:sequence>
<xsd:element minOccurs="0" name="id" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="getExampleResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="Example" nillable="true" type="tns:Example"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="getExampleResponse">
<wsdl:part name="parameters" element="tns:getExampleResponse"/>
</wsdl:message>
<wsdl:message name="getExampleRequest">
<wsdl:part name="parameters" element="tns:getExample"/>
</wsdl:message>
<wsdl:portType name="DemoServicePortType">
<wsdl:operation name="getExample">
<wsdl:input name="getExampleRequest" message="tns:getExampleRequest"/>
<wsdl:output name="getExampleResponse" message="tns:getExampleResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DemoServiceHttpBinding" type="tns:DemoServicePortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getExample">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getExampleRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getExampleResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DemoService">
<wsdl:port name="DemoServiceHttpPort" binding="tns:DemoServiceHttpBinding">
<wsdlsoap:address location="http://localhost:8001/DemoService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Hi
This issue is still not fixed in the 1.2.4 version. Are there any plans to fix it? FYI my problem is very similar. I want to reassign the name assigned to the elements of a complex type e.g
<xsd:complexType name="ArrayOfString">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
At runtime, the xml produced is:-
<string>LN_12176_2</string>
Which is not according to the wsdl.
Thanks