- This topic has 10 replies, 3 voices, and was last updated 17 years, 9 months ago by tomeksz.
-
AuthorPosts
-
nvenkataraoMemberHi,
please let me know the steps ..how to generate the normal java code from WSDL file …..
if i generated using builtin XFire in the my eclipse …..that ordinary java class is generating elements with JAXBElement<stirng> ……….but i dont want like this i want only String variable……
please reply immediatley …..
Thanks in Advance
Riyad KallaMemberThis is how the wizard behaves. If you want to adjust this I suppose you can manually edit the files, but I don’t know how you would edit it.
tomekszMemberThats way jaxb works. Check jaxb documentation about customizing types.
nvenkataraoMemberwhere i need to check jaxb documentation.
tomekszMemberCan you post your wsdl ?
nvenkataraoMemberThanks for your response please look into below wsdl file …this was generated by myeclipse auto matically…..
<?xml version=”1.0″ encoding=”UTF-8″?>
<wsdl:definitions xmlns:soap11=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:soap12=”http://www.w3.org/2003/05/soap-envelope” xmlns:soapenc11=”http://schemas.xmlsoap.org/soap/encoding/” xmlns:soapenc12=”http://www.w3.org/2003/05/soap-encoding” xmlns:tns=”http://service.ws.rs.com” xmlns:wsdl=”http://schemas.xmlsoap.org/wsdl/” xmlns:wsdlsoap=”http://schemas.xmlsoap.org/wsdl/soap/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” targetNamespace=”http://service.ws.rs.com”>
<wsdl:types>
<xsd:schema attributeFormDefault=”qualified” elementFormDefault=”qualified” targetNamespace=”http://service.ws.rs.com”>
<xsd:complexType name=”GetCompanyRequest”>
<xsd:sequence>
<xsd:element minOccurs=”0″ name=”companyId” type=”xsd:int”/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name=”GetCompanyResponse”>
<xsd:sequence>
<xsd:element minOccurs=”0″ name=”addr” nillable=”true” type=”xsd:string”/>
<xsd:element minOccurs=”0″ name=”companyId” type=”xsd:int”/>
<xsd:element minOccurs=”0″ name=”companyName” nillable=”true” type=”xsd:string”/>
<xsd:element minOccurs=”0″ name=”error” nillable=”true” type=”xsd:string”/>
<xsd:element minOccurs=”0″ name=”state” nillable=”true” type=”xsd:string”/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name=”getComapanyInfoRequest”>
<wsdl:part name=”in0″ type=”tns:GetCompanyRequest”/>
</wsdl:message>
<wsdl:message name=”getComapanyInfoResponse”>
<wsdl:part name=”out” type=”tns:GetCompanyResponse”/>
</wsdl:message>
<wsdl:portType name=”GetCompanyInfoPortType”>
<wsdl:operation name=”getComapanyInfo”>
<wsdl:input message=”tns:getComapanyInfoRequest” name=”getComapanyInfoRequest”/>
<wsdl:output message=”tns:getComapanyInfoResponse” name=”getComapanyInfoResponse”/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name=”GetCompanyInfoHttpBinding” type=”tns:GetCompanyInfoPortType”>
<wsdlsoap:binding style=”rpc” transport=”http://schemas.xmlsoap.org/soap/http”/>
<wsdl:operation name=”getComapanyInfo”>
<wsdlsoap:operation soapAction=””/>
<wsdl:input name=”getComapanyInfoRequest”>
<wsdlsoap:body namespace=”http://service.ws.rs.com” use=”literal”/>
</wsdl:input>
<wsdl:output name=”getComapanyInfoResponse”>
<wsdlsoap:body namespace=”http://service.ws.rs.com” use=”literal”/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name=”GetCompanyInfo”>
<wsdl:port binding=”tns:GetCompanyInfoHttpBinding” name=”GetCompanyInfoHttpPort”>
<wsdlsoap:address location=”http://localhost:8080/mambo-webservice-test/services/GetCompanyInfo”/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
tomekszMemberThis jaxb behavior is caused by combination of minOccurs=”0″ nillable=”true” attributes , if you change one of them to e.g minOccurs=”1″, then jaxb should generate valid type instead of jaxbelement.
So if you have access to server side service then you can try to customize service to generate minOccure=”1″
or save wsdl to file and replace all minOccurs=”0″ with minOccours=”1″ and then generate client code.
nvenkataraoMemberThanks. I got it.
Is there any way to generate automatically minOccures=”1″ instead of customizing the service.
tomekszMemberThis wsdl is generated by XFire ? Then you can set these values per method using aegis mapping file or you can set this globally ( but i dont remember how, must check the source 🙂
nvenkataraoMemberYes you are correct, I mean that wsdl generated by XFire only.
I don’t find any mapping files over there….like you said aegis mapping files…..
I don’t know why your choosing XFire instead of Axis……is there any good advantages is there over Axis….
If you have any documentation can you please send out that link for me…
tomekszMemberSure there are advantages 🙂 But i don’t want to start any flame war here 🙂
Here is a link with the description how to customize wsdl with mapping files:
http://xfire.codehaus.org/Aegis+Binding -
AuthorPosts