On trying out the url as
http://localhost:8080/axis2/services/ProductService/products/xyz/abc the
service method is being invoked, but the input argument is null ; now i've 2
questions: 

1. Assuming that xyz and abc are being interpreted correctly, why is the
complextype object not getting created with the attribute values populated?
2. If accountType is an optional input parameter, how will the URL be? -- it
looks like i need to invoke the URL that exactly matches the whttp:location
pattern always, since the
http://localhost:8080/axis2/services/ProductService/products/xyz gives
StringINdexOutofBounds exception

Expecting some responses for this to help me proceed..






strutsAwhile wrote:
> 
> Hi,
> I need to create a REST service that will allow users to search a product
> repository giving the product parameters as input. Going by REST concepts,
> i defined a method with signature : 
> String getProducts(SearchCriteria criteria) 
> which takes in the criteria and returns the matching products as XML (ie
> String).
> 
> SearchCriteria is a javabean that has the product parameters which are all
> String attributes. After java2wsdl (wv = 2) , it appears like:
> 
>             <xs:complexType name="SearchCriteria">
>                 <xs:sequence>
>                     <xs:element minOccurs="0" name="accountType"
> nillable="true" type="xs:string"/>
>                     <xs:element minOccurs="0" name="productCode"
> nillable="true" type="xs:string"/>
>                       <!--other search criteria here..-->
>                 </xs:sequence>
>             </xs:complexType>
> 
> The HTTP binding is : 
> 
> <wsdl2:binding name="ProductServiceHttpBinding"
> interface="tns:ServiceInterface" whttp:methodDefault="GET"
> type="http://www.w3.org/ns/wsdl/http";>
>         <wsdl2:operation ref="tns:getProducts"
> whttp:location="products/{productCode}/{accountType}"/>
> 
> I expected to invoke the service using the URL
> http://localhost:8080/axis2/services/ProductService/products?productCode=XYZ&accountType=1
> but it gives an String index out of range error, 
> When i try using
> http://localhost:8080/axis2/services/ProductService/products?criteria=1 ,
> it responds but doesn't serve any purpose since i've to pass in the
> attributes of crtieria (like productCode) rather than criteria itself.
> Now, is it possible to do such an invocation using GET, and if so how? .
> 
> I will be using Axis2 ServiceClient to invoke it (not generated stubs),
> and want to know how a complextype input can be sent ; the sample
> YahooSearchClient has only a String input.
> 
> 
> I've been stuck with this problem for almost a week, any inputs that'll
> help me proceed will be greatly appreciated.
> 
> Thanks,
> Joseph
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Axis2---REST-service-GET---input-parameters-qn.-tp20424414p20472960.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to