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 Jose Carlo Fabian <ca...@voxsant.com> on 2008/02/04 10:31:19 UTC
Problem with Retrieving the Values from the Client
Hello everyone. I am a beginner when it comes to creating web services
and I have encountered a problem that I cannot seem to find a solution
to. I have created a simple web service that adds a user based on the
parameters passed by the client. Now I can receive the xml(server side)
and can parse it but the problem is, the elements that I have declared
nillable=true, even if I have entered values in them, arrives to the
server without any values. Here is the wsdl for reference:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:voxsant" xmlns:impl="urn:voxsant"
xmlns:intf="urn:voxsant"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns1="http://model.voxsant">
<wsdl:types>
<schema targetNamespace="http://model.voxsant"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="User">
<sequence>
<element name="username" type="xsd:string"/>
<element name="password" type="xsd:string"/>
<element name="firstName" type="xsd:string"/>
<element name="middleInitial" type="xsd:string"/>
<element name="lastName" type="xsd:string"/>
<element name="country" nillable="true" type="xsd:string"/>
<element name="state" nillable="true" type="xsd:string"/>
<element name="city" nillable="true" type="xsd:string"/>
<element name="address1" nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0"
name="virtualNumbers" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="addUserRequest">
<wsdl:part name="in0" type="tns1:User">
</wsdl:part>
</wsdl:message>
<wsdl:message name="addUserResponse">
<wsdl:part name="addUserReturn" type="xsd:string">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="VoxsantService">
<wsdl:operation name="addUser">
<wsdl:input name="addUserRequest" message="impl:addUserRequest">
</wsdl:input>
<wsdl:output name="addUserResponse" message="impl:addUserResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="VoxsantServiceSoapBinding" type="impl:VoxsantService">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="addUser">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="addUserRequest">
<wsdlsoap:body use="literal"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:voxsant"/>
</wsdl:input>
<wsdl:output name="addUserResponse">
<wsdlsoap:body use="literal"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:voxsant"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="VoxsantServiceService">
<wsdl:port name="VoxsantService"
binding="impl:VoxsantServiceSoapBinding">
<wsdlsoap:address
location="http://localhost:8080/axis2/services/VoxsantService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
For the entries wherein I did not enter a nillable=true, their values
arrive, but for the other entries(country, state, virtual numbers etc),
I do not get the values even if my test client passes it to the ws. Does
anyone know where I went wrong? Would really appreciate any help, thanks
Carlo F.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
[axis2]Re: Problem with Retrieving the Values from the Client
Posted by Jose Carlo Fabian <ca...@voxsant.com>.
Hello Again,
I have just tried changing the wsdl from rpc to literal support but it
only gives out this error. The error happens when I try to call
WSDL2Java for generating the skeleton. Could there be a conflict since I
tried to generate the WSDL with Java2WSDL using apache axis?
[ERROR] No element type is defined for message addUserRequest
org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException:
No element type is defined for message
addUserRequest
so I looked around for an answer and one of the possible solutions was
appending the elements with xsd like this:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:voxsant"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:voxsant"
xmlns:intf="urn:voxsant"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://model.voxsant"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema targetNamespace="http://model.voxsant"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="User">
<sequence>
<xsd:element name="username" type="xsd:string"/>
<xsd:element name="password" type="xsd:string"/>
<xsd:element name="firstName" type="xsd:string"/>
<xsd:element name="middleInitial" type="xsd:string"/>
<xsd:element name="lastName" type="xsd:string"/>
<xsd:element name="country" nillable="true" type="xsd:string"/>
<xsd:element name="state" nillable="true" type="xsd:string"/>
<xsd:element name="city" nillable="true" type="xsd:string"/>
<xsd:element name="address1" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="unbounded" minOccurs="0"
name="virtualNumbers" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="addUserRequest">
<wsdl:part name="in0" type="tns1:User"/>
</wsdl:message>
<wsdl:message name="addUserResponse">
<wsdl:part name="addUserResponse" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="VoxsantService">
<wsdl:operation name="addUser">
<wsdl:input message="impl:addUserRequest" name="addUserRequest"/>
<wsdl:output message="impl:addUserResponse"
name="addUserResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="VoxsantServiceSoapBinding"
type="impl:VoxsantService">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="addUser">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="addUserRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="addUserResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="VoxsantServiceService">
<wsdl:port binding="impl:VoxsantServiceSoapBinding"
name="VoxsantService">
<wsdlsoap:address
location="http://localhost:8080/axis2/services/VoxsantService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
But still it gives out the same error problem. Is there a particular
point here that I am missing because right now I am stumped? Would
really appreciate any help. Thanks again in advance.
Carlo Fabian
Anne Thomas Manes wrote:
> Are you working with Axis or Axis2? (I'm guessing Axis) Which version?
>
> Older versions of Axis had some trouble supporting rpc/literal. You
> might want to use wrapped document/literal instead.
>
> One problem I see in the WSDL: You must remove the soapEncoding
> attribute from the <wsdlsoap:body> elements in your binding
> definitions. (You use that attribute only if use="encoded").
>
> Anne
>
> On Feb 4, 2008 4:31 AM, Jose Carlo Fabian <ca...@voxsant.com> wrote:
>
>> Hello everyone. I am a beginner when it comes to creating web services
>> and I have encountered a problem that I cannot seem to find a solution
>> to. I have created a simple web service that adds a user based on the
>> parameters passed by the client. Now I can receive the xml(server side)
>> and can parse it but the problem is, the elements that I have declared
>> nillable=true, even if I have entered values in them, arrives to the
>> server without any values. Here is the wsdl for reference:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <wsdl:definitions targetNamespace="urn:voxsant" xmlns:impl="urn:voxsant"
>> xmlns:intf="urn:voxsant"
>> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>> xmlns:apachesoap="http://xml.apache.org/xml-soap"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>> xmlns:tns1="http://model.voxsant">
>> <wsdl:types>
>> <schema targetNamespace="http://model.voxsant"
>> xmlns="http://www.w3.org/2001/XMLSchema">
>> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>> <complexType name="User">
>> <sequence>
>> <element name="username" type="xsd:string"/>
>> <element name="password" type="xsd:string"/>
>> <element name="firstName" type="xsd:string"/>
>> <element name="middleInitial" type="xsd:string"/>
>> <element name="lastName" type="xsd:string"/>
>> <element name="country" nillable="true" type="xsd:string"/>
>> <element name="state" nillable="true" type="xsd:string"/>
>> <element name="city" nillable="true" type="xsd:string"/>
>> <element name="address1" nillable="true" type="xsd:string"/>
>> <element maxOccurs="unbounded" minOccurs="0"
>> name="virtualNumbers" nillable="true" type="xsd:string"/>
>> </sequence>
>> </complexType>
>> </schema>
>> </wsdl:types>
>> <wsdl:message name="addUserRequest">
>> <wsdl:part name="in0" type="tns1:User">
>> </wsdl:part>
>> </wsdl:message>
>> <wsdl:message name="addUserResponse">
>> <wsdl:part name="addUserReturn" type="xsd:string">
>> </wsdl:part>
>> </wsdl:message>
>> <wsdl:portType name="VoxsantService">
>> <wsdl:operation name="addUser">
>> <wsdl:input name="addUserRequest" message="impl:addUserRequest">
>> </wsdl:input>
>> <wsdl:output name="addUserResponse" message="impl:addUserResponse">
>> </wsdl:output>
>> </wsdl:operation>
>> </wsdl:portType>
>> <wsdl:binding name="VoxsantServiceSoapBinding" type="impl:VoxsantService">
>> <wsdlsoap:binding style="rpc"
>> transport="http://schemas.xmlsoap.org/soap/http"/>
>> <wsdl:operation name="addUser">
>> <wsdlsoap:operation soapAction=""/>
>> <wsdl:input name="addUserRequest">
>> <wsdlsoap:body use="literal"
>> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> namespace="urn:voxsant"/>
>> </wsdl:input>
>> <wsdl:output name="addUserResponse">
>> <wsdlsoap:body use="literal"
>> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> namespace="urn:voxsant"/>
>> </wsdl:output>
>> </wsdl:operation>
>> </wsdl:binding>
>> <wsdl:service name="VoxsantServiceService">
>> <wsdl:port name="VoxsantService"
>> binding="impl:VoxsantServiceSoapBinding">
>> <wsdlsoap:address
>> location="http://localhost:8080/axis2/services/VoxsantService"/>
>> </wsdl:port>
>> </wsdl:service>
>> </wsdl:definitions>
>>
>>
>> For the entries wherein I did not enter a nillable=true, their values
>> arrive, but for the other entries(country, state, virtual numbers etc),
>> I do not get the values even if my test client passes it to the ws. Does
>> anyone know where I went wrong? Would really appreciate any help, thanks
>>
>> Carlo F.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>>
>
>
[axis2]Re: Problem with Retrieving the Values from the Client
Posted by Jose Carlo Fabian <ca...@voxsant.com>.
Hi Anne Thomas,
Thank you for replying. I forgot to write, I use axis2 to generate the
skeleton and I am also using Axis2 in my tomcat. thanks for the reply
and I will definitely try your suggestions just to check if my problem
improves. Will keep you updated, thanks again.
Carlo
Anne Thomas Manes wrote:
> Are you working with Axis or Axis2? (I'm guessing Axis) Which version?
>
> Older versions of Axis had some trouble supporting rpc/literal. You
> might want to use wrapped document/literal instead.
>
> One problem I see in the WSDL: You must remove the soapEncoding
> attribute from the <wsdlsoap:body> elements in your binding
> definitions. (You use that attribute only if use="encoded").
>
> Anne
>
> On Feb 4, 2008 4:31 AM, Jose Carlo Fabian <ca...@voxsant.com> wrote:
>
>> Hello everyone. I am a beginner when it comes to creating web services
>> and I have encountered a problem that I cannot seem to find a solution
>> to. I have created a simple web service that adds a user based on the
>> parameters passed by the client. Now I can receive the xml(server side)
>> and can parse it but the problem is, the elements that I have declared
>> nillable=true, even if I have entered values in them, arrives to the
>> server without any values. Here is the wsdl for reference:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <wsdl:definitions targetNamespace="urn:voxsant" xmlns:impl="urn:voxsant"
>> xmlns:intf="urn:voxsant"
>> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>> xmlns:apachesoap="http://xml.apache.org/xml-soap"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>> xmlns:tns1="http://model.voxsant">
>> <wsdl:types>
>> <schema targetNamespace="http://model.voxsant"
>> xmlns="http://www.w3.org/2001/XMLSchema">
>> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>> <complexType name="User">
>> <sequence>
>> <element name="username" type="xsd:string"/>
>> <element name="password" type="xsd:string"/>
>> <element name="firstName" type="xsd:string"/>
>> <element name="middleInitial" type="xsd:string"/>
>> <element name="lastName" type="xsd:string"/>
>> <element name="country" nillable="true" type="xsd:string"/>
>> <element name="state" nillable="true" type="xsd:string"/>
>> <element name="city" nillable="true" type="xsd:string"/>
>> <element name="address1" nillable="true" type="xsd:string"/>
>> <element maxOccurs="unbounded" minOccurs="0"
>> name="virtualNumbers" nillable="true" type="xsd:string"/>
>> </sequence>
>> </complexType>
>> </schema>
>> </wsdl:types>
>> <wsdl:message name="addUserRequest">
>> <wsdl:part name="in0" type="tns1:User">
>> </wsdl:part>
>> </wsdl:message>
>> <wsdl:message name="addUserResponse">
>> <wsdl:part name="addUserReturn" type="xsd:string">
>> </wsdl:part>
>> </wsdl:message>
>> <wsdl:portType name="VoxsantService">
>> <wsdl:operation name="addUser">
>> <wsdl:input name="addUserRequest" message="impl:addUserRequest">
>> </wsdl:input>
>> <wsdl:output name="addUserResponse" message="impl:addUserResponse">
>> </wsdl:output>
>> </wsdl:operation>
>> </wsdl:portType>
>> <wsdl:binding name="VoxsantServiceSoapBinding" type="impl:VoxsantService">
>> <wsdlsoap:binding style="rpc"
>> transport="http://schemas.xmlsoap.org/soap/http"/>
>> <wsdl:operation name="addUser">
>> <wsdlsoap:operation soapAction=""/>
>> <wsdl:input name="addUserRequest">
>> <wsdlsoap:body use="literal"
>> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> namespace="urn:voxsant"/>
>> </wsdl:input>
>> <wsdl:output name="addUserResponse">
>> <wsdlsoap:body use="literal"
>> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> namespace="urn:voxsant"/>
>> </wsdl:output>
>> </wsdl:operation>
>> </wsdl:binding>
>> <wsdl:service name="VoxsantServiceService">
>> <wsdl:port name="VoxsantService"
>> binding="impl:VoxsantServiceSoapBinding">
>> <wsdlsoap:address
>> location="http://localhost:8080/axis2/services/VoxsantService"/>
>> </wsdl:port>
>> </wsdl:service>
>> </wsdl:definitions>
>>
>>
>> For the entries wherein I did not enter a nillable=true, their values
>> arrive, but for the other entries(country, state, virtual numbers etc),
>> I do not get the values even if my test client passes it to the ws. Does
>> anyone know where I went wrong? Would really appreciate any help, thanks
>>
>> Carlo F.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>>
>
>
Re: Problem with Retrieving the Values from the Client
Posted by Anne Thomas Manes <at...@gmail.com>.
Are you working with Axis or Axis2? (I'm guessing Axis) Which version?
Older versions of Axis had some trouble supporting rpc/literal. You
might want to use wrapped document/literal instead.
One problem I see in the WSDL: You must remove the soapEncoding
attribute from the <wsdlsoap:body> elements in your binding
definitions. (You use that attribute only if use="encoded").
Anne
On Feb 4, 2008 4:31 AM, Jose Carlo Fabian <ca...@voxsant.com> wrote:
> Hello everyone. I am a beginner when it comes to creating web services
> and I have encountered a problem that I cannot seem to find a solution
> to. I have created a simple web service that adds a user based on the
> parameters passed by the client. Now I can receive the xml(server side)
> and can parse it but the problem is, the elements that I have declared
> nillable=true, even if I have entered values in them, arrives to the
> server without any values. Here is the wsdl for reference:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="urn:voxsant" xmlns:impl="urn:voxsant"
> xmlns:intf="urn:voxsant"
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:tns1="http://model.voxsant">
> <wsdl:types>
> <schema targetNamespace="http://model.voxsant"
> xmlns="http://www.w3.org/2001/XMLSchema">
> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> <complexType name="User">
> <sequence>
> <element name="username" type="xsd:string"/>
> <element name="password" type="xsd:string"/>
> <element name="firstName" type="xsd:string"/>
> <element name="middleInitial" type="xsd:string"/>
> <element name="lastName" type="xsd:string"/>
> <element name="country" nillable="true" type="xsd:string"/>
> <element name="state" nillable="true" type="xsd:string"/>
> <element name="city" nillable="true" type="xsd:string"/>
> <element name="address1" nillable="true" type="xsd:string"/>
> <element maxOccurs="unbounded" minOccurs="0"
> name="virtualNumbers" nillable="true" type="xsd:string"/>
> </sequence>
> </complexType>
> </schema>
> </wsdl:types>
> <wsdl:message name="addUserRequest">
> <wsdl:part name="in0" type="tns1:User">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="addUserResponse">
> <wsdl:part name="addUserReturn" type="xsd:string">
> </wsdl:part>
> </wsdl:message>
> <wsdl:portType name="VoxsantService">
> <wsdl:operation name="addUser">
> <wsdl:input name="addUserRequest" message="impl:addUserRequest">
> </wsdl:input>
> <wsdl:output name="addUserResponse" message="impl:addUserResponse">
> </wsdl:output>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="VoxsantServiceSoapBinding" type="impl:VoxsantService">
> <wsdlsoap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="addUser">
> <wsdlsoap:operation soapAction=""/>
> <wsdl:input name="addUserRequest">
> <wsdlsoap:body use="literal"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="urn:voxsant"/>
> </wsdl:input>
> <wsdl:output name="addUserResponse">
> <wsdlsoap:body use="literal"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="urn:voxsant"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="VoxsantServiceService">
> <wsdl:port name="VoxsantService"
> binding="impl:VoxsantServiceSoapBinding">
> <wsdlsoap:address
> location="http://localhost:8080/axis2/services/VoxsantService"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
>
> For the entries wherein I did not enter a nillable=true, their values
> arrive, but for the other entries(country, state, virtual numbers etc),
> I do not get the values even if my test client passes it to the ws. Does
> anyone know where I went wrong? Would really appreciate any help, thanks
>
> Carlo F.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org