You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Schmülling,
Christian <Ch...@opitz-consulting.de> on 2008/06/19 12:37:23 UTC
Return parameter missing next generation
Hello.
I have a problem with generating java sources from wsdl file. I have a wsdl in document literal wrapped style. It's a synchronous service. All I want is a Java interface with a method with for my operation from service. My method has no return value. Instead I got a "holder" and a WebParam in mode INOUT.
What can I do with it? I can't find docs for it.
A method with a return value would be my favourite. How can I get it?
Here are some parts from my sources.
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://NS1"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:fault="http://NS2"
targetNamespace="http://NS1">
<wsdl:types>
<xsd:schema targetNamespace="http://NS1"
xmlns:daten="http://NS1/message" elementFormDefault="qualified">
<xsd:import namespace="http://NS1/message" schemaLocation="Daten.xsd"/>
<xsd:import namespace="http://NS2" schemaLocation="Fault.xsd"/>
<xsd:element name="request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Message" type="daten:MessageTyp"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="requestResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Message" type="daten:MessageTyp"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
...
</xsd:schema>
</wsdl:types>
<wsdl:message name="request">
<wsdl:part name="anfrage" element="tns:request"/>
</wsdl:message>
<wsdl:message name="requestResponse">
<wsdl:part name="antwort" element="tns:requestResponse"/>
</wsdl:message>
...
<wsdl:message name="Fault">
<wsdl:part name="parameters" element="fault:FaultFault"/>
</wsdl:message>
<wsdl:portType name="messagePortType">
<wsdl:operation name="request">
<wsdl:input name="request" message="tns:request"/>
<wsdl:output name="antwortAnzahlMitteilungen" message="tns:requestResponse"/>
<wsdl:fault name="fault" message="tns:Fault"/>
</wsdl:operation>
...
</wsdl:portType>
<wsdl:binding name="messageSOAP" type="tns:messagePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="request">
<soap:operation soapAction="http://NS3" style="document"/>
<wsdl:input name="request">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="antwortAnzahlMitteilungen">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="fault">
<soap:fault name="fault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
...
</wsdl:binding>
<wsdl:service name="NAME">
<wsdl:port name="messageSOAP" binding="tns:messageSOAP">
<soap:address location="http://a_location"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I can't see any error here. More then one validator means it is a valid wsdl.
In java I get the following sources for my porttype.
@WebService(targetNamespace = "http://NS1", name = "messagePortType")
public interface MessagePortType {
@ResponseWrapper(targetNamespace = "http://NS1", className = "package.RequestResponse", localName = "requestResponse")
@RequestWrapper(targetNamespace = "http://NS1", className = "package.Request", localName = "request")
@WebMethod(action = "http://NS3")
public void request(
@WebParam(targetNamespace = "http://NS1", mode = Mode.INOUT, name = "Message")
javax.xml.ws.Holder<package.message.MessageTyp> message
) throws Fault;
}
As you can see I get a method with a void return parameter. I expect a return parameter with type of package.message.MessageTyp.
Here some information about the frameworks: cxf 2.0.1, spring 2.5.3
I hope it's a simple beginner mistake und you can help me fast.
With best regards
Christian
Re: Return parameter missing next generation
Posted by Glen Mazza <gl...@verizon.net>.
Please see Step #7 here for an example of how to work with Holder, it's
rather simple: http://www.jroller.com/gmazza/date/20070929
Also, to switch between wrapper and non-wrapper styles (which I believe
has some relation to getting rid of Holder), see the next-to-last
question here:
http://cwiki.apache.org/CXF20DOC/wsdl-to-java.html
HTH,
Glen
2008-06-19 Schmülling, Christian wrote:
> Hello.
>
> I have a problem with generating java sources from wsdl file. I have a wsdl in document literal wrapped style. It's a synchronous service. All I want is a Java interface with a method with for my operation from service. My method has no return value. Instead I got a "holder" and a WebParam in mode INOUT.
>
> What can I do with it? I can't find docs for it.
>
> A method with a return value would be my favourite. How can I get it?
>
> Here are some parts from my sources.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:tns="http://NS1"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:fault="http://NS2"
> targetNamespace="http://NS1">
> <wsdl:types>
> <xsd:schema targetNamespace="http://NS1"
> xmlns:daten="http://NS1/message" elementFormDefault="qualified">
> <xsd:import namespace="http://NS1/message" schemaLocation="Daten.xsd"/>
> <xsd:import namespace="http://NS2" schemaLocation="Fault.xsd"/>
> <xsd:element name="request">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="Message" type="daten:MessageTyp"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="requestResponse">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="Message" type="daten:MessageTyp"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
> ...
>
> </xsd:schema>
> </wsdl:types>
>
> <wsdl:message name="request">
> <wsdl:part name="anfrage" element="tns:request"/>
> </wsdl:message>
> <wsdl:message name="requestResponse">
> <wsdl:part name="antwort" element="tns:requestResponse"/>
> </wsdl:message>
>
> ...
>
> <wsdl:message name="Fault">
> <wsdl:part name="parameters" element="fault:FaultFault"/>
> </wsdl:message>
>
> <wsdl:portType name="messagePortType">
> <wsdl:operation name="request">
> <wsdl:input name="request" message="tns:request"/>
> <wsdl:output name="antwortAnzahlMitteilungen" message="tns:requestResponse"/>
> <wsdl:fault name="fault" message="tns:Fault"/>
> </wsdl:operation>
>
> ...
>
> </wsdl:portType>
>
> <wsdl:binding name="messageSOAP" type="tns:messagePortType">
> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="request">
> <soap:operation soapAction="http://NS3" style="document"/>
> <wsdl:input name="request">
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="antwortAnzahlMitteilungen">
> <soap:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="fault">
> <soap:fault name="fault" use="literal"/>
> </wsdl:fault>
> </wsdl:operation>
>
> ...
>
> </wsdl:binding>
>
> <wsdl:service name="NAME">
> <wsdl:port name="messageSOAP" binding="tns:messageSOAP">
> <soap:address location="http://a_location"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
>
> I can't see any error here. More then one validator means it is a valid wsdl.
> In java I get the following sources for my porttype.
>
>
> @WebService(targetNamespace = "http://NS1", name = "messagePortType")
>
> public interface MessagePortType {
>
> @ResponseWrapper(targetNamespace = "http://NS1", className = "package.RequestResponse", localName = "requestResponse")
> @RequestWrapper(targetNamespace = "http://NS1", className = "package.Request", localName = "request")
> @WebMethod(action = "http://NS3")
> public void request(
> @WebParam(targetNamespace = "http://NS1", mode = Mode.INOUT, name = "Message")
> javax.xml.ws.Holder<package.message.MessageTyp> message
> ) throws Fault;
> }
>
>
> As you can see I get a method with a void return parameter. I expect a return parameter with type of package.message.MessageTyp.
> Here some information about the frameworks: cxf 2.0.1, spring 2.5.3
>
> I hope it's a simple beginner mistake und you can help me fast.
>
> With best regards
> Christian
AW: Return parameter missing next generation
Posted by Schmülling,
Christian <Ch...@opitz-consulting.de>.
Hi
Solution found:
Don’t name the elements identically.
<xsd:element name="request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Message" type="daten:MessageTyp"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="requestResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Message" type="daten:MessageTyp"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
The second element name=”Message” needs another name.
With best regards
Christian
--
Hello.
I have a problem with generating java sources from wsdl file. I have a wsdl in document literal wrapped style. It's a synchronous service. All I want is a Java interface with a method with for my operation from service. My method has no return value. Instead I got a "holder" and a WebParam in mode INOUT.
What can I do with it? I can't find docs for it.
A method with a return value would be my favourite. How can I get it?
Here are some parts from my sources.
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://NS1"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:fault="http://NS2"
targetNamespace="http://NS1">
<wsdl:types>
<xsd:schema targetNamespace="http://NS1"
xmlns:daten="http://NS1/message" elementFormDefault="qualified">
<xsd:import namespace="http://NS1/message" schemaLocation="Daten.xsd"/>
<xsd:import namespace="http://NS2" schemaLocation="Fault.xsd"/>
<xsd:element name="request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Message" type="daten:MessageTyp"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="requestResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Message" type="daten:MessageTyp"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
...
</xsd:schema>
</wsdl:types>
<wsdl:message name="request">
<wsdl:part name="anfrage" element="tns:request"/>
</wsdl:message>
<wsdl:message name="requestResponse">
<wsdl:part name="antwort" element="tns:requestResponse"/>
</wsdl:message>
...
<wsdl:message name="Fault">
<wsdl:part name="parameters" element="fault:FaultFault"/>
</wsdl:message>
<wsdl:portType name="messagePortType">
<wsdl:operation name="request">
<wsdl:input name="request" message="tns:request"/>
<wsdl:output name="antwortAnzahlMitteilungen" message="tns:requestResponse"/>
<wsdl:fault name="fault" message="tns:Fault"/>
</wsdl:operation>
...
</wsdl:portType>
<wsdl:binding name="messageSOAP" type="tns:messagePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="request">
<soap:operation soapAction="http://NS3" style="document"/>
<wsdl:input name="request">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="antwortAnzahlMitteilungen">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="fault">
<soap:fault name="fault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
...
</wsdl:binding>
<wsdl:service name="NAME">
<wsdl:port name="messageSOAP" binding="tns:messageSOAP">
<soap:address location="http://a_location"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I can't see any error here. More then one validator means it is a valid wsdl.
In java I get the following sources for my porttype.
@WebService(targetNamespace = "http://NS1", name = "messagePortType")
public interface MessagePortType {
@ResponseWrapper(targetNamespace = "http://NS1", className = "package.RequestResponse", localName = "requestResponse")
@RequestWrapper(targetNamespace = "http://NS1", className = "package.Request", localName = "request")
@WebMethod(action = "http://NS3")
public void request(
@WebParam(targetNamespace = "http://NS1", mode = Mode.INOUT, name = "Message")
javax.xml.ws.Holder<package.message.MessageTyp> message
) throws Fault;
}
As you can see I get a method with a void return parameter. I expect a return parameter with type of package.message.MessageTyp.
Here some information about the frameworks: cxf 2.0.1, spring 2.5.3
I hope it's a simple beginner mistake und you can help me fast.
With best regards
Christian