Skip to main content

@WebService only retrieves first parameter. All other parameters are null!

2 replies [Last post]
Anonymous

Hello!

I have created a webservice using the JWS annotations from JDK 1.6 and deployed it to an Endpoint successfully. The WSDL looks fine and the service is available and responds to calls but: The called method always seems to receive only the first of five parameters - all other parameters are always null. Is this a knows problem? Can you tell me if I did anything wrong in my webservice class? The problem is fully reproducable from different clients (I tried soapUI and a Flex application). I checked the SOAP envelopes in both cases and there the parameters are correctly present.

Here is my webservice class:
--------------------------------------
package kn.webstd.sample.inventory.ws;

// import *.*

@WebService(name = "WsProductSearchService")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class WsProductSearchService {

@WebMethod(operationName = "countProductResults")
@WebResult(name = "countOfProducts")
public Integer countProductResults(@WebParam(name = "searchString") String searchString,
@WebParam(name = "searchContext") String searchContext, @WebParam(name = "currency") String currency,
@WebParam(name = "minPrice") Integer minPrice, @WebParam(name = "maxPrice") Integer maxPrice)
throws RemoteException {
// do something
return result.getRowCount();
}

}
--------------------------------------

And this is how I published the service:

--------------------------------------
Endpoint.publish( "http://localhost:38080/wssample/soap", new WsProductSearchService() );
--------------------------------------

And finally the generated WSDL:
--------------------------------------

--------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jitendra Kotamraju

Björn Kimminich wrote:
> Hello!
>
> I have created a webservice using the JWS annotations from JDK 1.6 and deployed it to an Endpoint successfully. The WSDL looks fine and the service is available and responds to calls but: The called method always seems to receive only the first of five parameters - all other parameters are always null. Is this a knows problem? Can you tell me if I did anything wrong in my webservice class? The problem is fully reproducable from different clients (I tried soapUI and a Flex application). I checked the SOAP envelopes in both cases and there the parameters are correctly present.
>
I think soapUI and Flex may be sending the parameters in some namespace.
BasicProfile says that the rpc/lit parameters should be in no namespace.
If you send the request dump, it will be clear.

Did you try with JAX-WS client ? Other option is to use, doc/lit (you
remove @SOAPBinding(style = SOAPBinding.Style.RPC) annotation)

Jitu
> Here is my webservice class:
> --------------------------------------
> package kn.webstd.sample.inventory.ws;
>
> // import *.*
>
> @WebService(name = "WsProductSearchService")
> @SOAPBinding(style = SOAPBinding.Style.RPC)
> public class WsProductSearchService {
>
> @WebMethod(operationName = "countProductResults")
> @WebResult(name = "countOfProducts")
> public Integer countProductResults(@WebParam(name = "searchString") String searchString,
> @WebParam(name = "searchContext") String searchContext, @WebParam(name = "currency") String currency,
> @WebParam(name = "minPrice") Integer minPrice, @WebParam(name = "maxPrice") Integer maxPrice)
> throws RemoteException {
> // do something
> return result.getRowCount();
> }
>
> }
> --------------------------------------
>
> And this is how I published the service:
>
> --------------------------------------
> Endpoint.publish( "http://localhost:38080/wssample/soap", new WsProductSearchService() );
> --------------------------------------
>
> And finally the generated WSDL:
> --------------------------------------
>

>
>

>
>
>
>
>
>
>
>
>
>
>

>
>
>
>

>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>

>

>
>
>
>
>
>
>

>

> --------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net

bkimminich
Offline
Joined: 2009-07-14

When using soapUI I send a request like this via the application:





%
nameAndDescr
EUR
1
1000


The namespace seems to be taken from the WSDL correctly. If RPC doesn't work with a namespace, why is it generated into the WSDL anyway?

I appreciate any ideas what to do to resolve this problem. Thanks a lot!