You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Isenor, Anthony" <An...@drdc-rddc.gc.ca> on 2007/08/01 15:01:56 UTC
Need help with OMElement
We have been trying to deploy a very simple web service using AXIS2 -
and obviously
we are missing something.
AXIS2 is up and running; TOMCAT running; and we have deployed a
Calculator service
and 4 other trivial services. Now we want to create a service that uses
OMElement. Our service code is:
import org.apache.axiom.om.OMElement;
public class OMTest {
public OMTest()
{
}
public OMElement echofoo(OMElement in)
{
return in;
}
}
Note the "in" parameter for the method echofoo.
The services.xml file is as follows:
<service name="OMTest">
<description>
All I ask is that OMElements just work!
</description>
<parameter name="ServiceClass" locked="false">OMTest</parameter>
<operation name="echofoo">
<messageReceiver
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
<actionMapping>urn:echo</actionMapping>
</operation>
</service>
The auto-generated wsdl from AXIS2 (obtained by going to
servicename?wsdl address)
is as shown at the end of this message. My two questions are:
1) Why don't I see an XML element named "in" as defined in the service
code?
2) How can I make "in" appear as an input parameter in the wsdl?
<wsdl:definitions xmlns:axis2="http://ws.apache.org/axis2"
xmlns:ns1="http://org.apache.axis2/xsd"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns0="http://ws.apache.org/axis2/xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
targetNamespace="http://ws.apache.org/axis2">
<wsdl:documentation>OMTest</wsdl:documentation>
<wsdl:types>
<xs:schema
xmlns:ns="http://ws.apache.org/axis2/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://ws.apache.org/axis2/xsd">
<xs:element name="echofoo">
<xs:complexType>
<xs:sequence>
<xs:element name="echofoo" nillable="true" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="echofooResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return" nillable="true" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="echofooMessage">
<wsdl:part name="part1" element="ns0:echofoo"/>
</wsdl:message>
<wsdl:message name="echofooResponse">
<wsdl:part name="part1"
element="ns0:echofooResponse"/>
</wsdl:message>
<wsdl:portType name="OMTestPortType">
<wsdl:operation name="echofoo">
<wsdl:input
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
message="axis2:echofooMessage" wsaw:Action="urn:echofoo"/>
<wsdl:output
message="axis2:echofooResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="OMTestSOAP11Binding"
type="axis2:OMTestPortType">
<soap:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="echofoo">
<soap:operation
soapAction="urn:echofoo" style="document"/>
<wsdl:input>
<soap:body
use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body
use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="OMTestSOAP12Binding"
type="axis2:OMTestPortType">
<soap12:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="echofoo">
<soap12:operation
soapAction="urn:echofoo" style="document"/>
<wsdl:input>
<soap12:body
use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body
use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="OMTestHttpBinding"
type="axis2:OMTestPortType">
<http:binding verb="POST"/>
<wsdl:operation name="echofoo">
<http:operation location="echofoo"/>
<wsdl:input>
<mime:content
type="text/xml"/>
</wsdl:input>
<wsdl:output>
<mime:content
type="text/xml"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="OMTest">
<wsdl:port name="OMTestSOAP11port_http"
binding="axis2:OMTestSOAP11Binding">
<soap:address
location="http://131.136.21.245:8080/axis2/services/OMTest"/>
</wsdl:port>
<wsdl:port name="OMTestSOAP12port_http"
binding="axis2:OMTestSOAP12Binding">
<soap12:address
location="http://131.136.21.245:8080/axis2/services/OMTest"/>
</wsdl:port>
<wsdl:port name="OMTestHttpport"
binding="axis2:OMTestHttpBinding">
<http:address
location="http://131.136.21.245:8080/axis2/services/OMTest"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Re: Need help with OMElement
Posted by Charitha Kankanamge <ch...@wso2.com>.
Isenor, Anthony wrote:
> We have been trying to deploy a very simple web service using AXIS2 -
> and obviously
>
> we are missing something.
>
> AXIS2 is up and running; TOMCAT running; and we have deployed a
> Calculator service
>
> and 4 other trivial services. Now we want to create a service that uses
>
> OMElement. Our service code is:
>
> import org.apache.axiom.om.OMElement;
>
> public class OMTest {
>
> public OMTest()
>
> {
>
> }
>
> public OMElement echofoo(OMElement in)
>
> {
>
> return in;
>
> }
>
> }
>
> Note the “in” parameter for the method echofoo.
>
> The services.xml file is as follows:
>
> <service name="OMTest">
>
> <description>
>
> All I ask is that OMElements just work!
>
> </description>
>
> <parameter name="ServiceClass" locked="false">OMTest</parameter>
>
> <operation name="echofoo">
>
> <messageReceiver
> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>
> <actionMapping>urn:echo</actionMapping>
>
> </operation>
>
> </service>
>
> The auto-generated wsdl from AXIS2 (obtained by going to
> servicename?wsdl address)
>
> is as shown at the end of this message. My two questions are:
>
> 1) Why don't I see an XML element named "in" as defined in the service
> code?
>
It seems there is an issue with schema generation when OMElements are
given as parameters. In order to clarify this issue, I just reported a
JIRA at https://issues.apache.org/jira/browse/AXIS2-3049
> 2) How can I make "in" appear as an input parameter in the wsdl?
>
> <wsdl:definitions xmlns:axis2="http://ws.apache.org/axis2"
> xmlns:ns1="http://org.apache.axis2/xsd"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:ns0="http://ws.apache.org/axis2/xsd"
>
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
>
> targetNamespace="http://ws.apache.org/axis2">
>
> <wsdl:documentation>OMTest</wsdl:documentation>
>
> <wsdl:types>
>
> <xs:schema xmlns:ns="http://ws.apache.org/axis2/xsd"
> attributeFormDefault="qualified" elementFormDefault="qualified"
> targetNamespace="http://ws.apache.org/axis2/xsd">
>
> <xs:element name="echofoo">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element name="echofoo" nillable="true" type="xs:anyType"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:element>
>
> <xs:element name="echofooResponse">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element name="return" nillable="true" type="xs:anyType"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:element>
>
> </xs:schema>
>
> </wsdl:types>
>
> <wsdl:message name="echofooMessage">
>
> <wsdl:part name="part1" element="ns0:echofoo"/>
>
> </wsdl:message>
>
> <wsdl:message name="echofooResponse">
>
> <wsdl:part name="part1" element="ns0:echofooResponse"/>
>
> </wsdl:message>
>
> <wsdl:portType name="OMTestPortType">
>
> <wsdl:operation name="echofoo">
>
> <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
> message="axis2:echofooMessage" wsaw:Action="urn:echofoo"/>
>
> <wsdl:output message="axis2:echofooResponse"/>
>
> </wsdl:operation>
>
> </wsdl:portType>
>
> <wsdl:binding name="OMTestSOAP11Binding" type="axis2:OMTestPortType">
>
> <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> style="document"/>
>
> <wsdl:operation name="echofoo">
>
> <soap:operation soapAction="urn:echofoo" style="document"/>
>
> <wsdl:input>
>
> <soap:body use="literal"/>
>
> </wsdl:input>
>
> <wsdl:output>
>
> <soap:body use="literal"/>
>
> </wsdl:output>
>
> </wsdl:operation>
>
> </wsdl:binding>
>
> <wsdl:binding name="OMTestSOAP12Binding" type="axis2:OMTestPortType">
>
> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
> style="document"/>
>
> <wsdl:operation name="echofoo">
>
> <soap12:operation soapAction="urn:echofoo" style="document"/>
>
> <wsdl:input>
>
> <soap12:body use="literal"/>
>
> </wsdl:input>
>
> <wsdl:output>
>
> <soap12:body use="literal"/>
>
> </wsdl:output>
>
> </wsdl:operation>
>
> </wsdl:binding>
>
> <wsdl:binding name="OMTestHttpBinding" type="axis2:OMTestPortType">
>
> <http:binding verb="POST"/>
>
> <wsdl:operation name="echofoo">
>
> <http:operation location="echofoo"/>
>
> <wsdl:input>
>
> <mime:content type="text/xml"/>
>
> </wsdl:input>
>
> <wsdl:output>
>
> <mime:content type="text/xml"/>
>
> </wsdl:output>
>
> </wsdl:operation>
>
> </wsdl:binding>
>
> <wsdl:service name="OMTest">
>
> <wsdl:port name="OMTestSOAP11port_http"
> binding="axis2:OMTestSOAP11Binding">
>
> <soap:address
> location="http://131.136.21.245:8080/axis2/services/OMTest"/>
>
> </wsdl:port>
>
> <wsdl:port name="OMTestSOAP12port_http"
> binding="axis2:OMTestSOAP12Binding">
>
> <soap12:address
> location="http://131.136.21.245:8080/axis2/services/OMTest"/>
>
> </wsdl:port>
>
> <wsdl:port name="OMTestHttpport" binding="axis2:OMTestHttpBinding">
>
> <http:address
> location="http://131.136.21.245:8080/axis2/services/OMTest"/>
>
> </wsdl:port>
>
> </wsdl:service>
>
> </wsdl:definitions>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org