Skip to main content

@webparam (header=true...) changes signature of mehtod at client

1 reply [Last post]
swapnali
Offline
Joined: 2006-06-14
Points: 0

I have a webmethod as follows. And I want the client to pass some specfic header when they call this method so I added one parameter in header

@WebMethod
public String greetMessage(
@WebParam(name="UserCred", header=true)
UserCred userCred,
@WebParam(name="YourName")
String yourName

)
{

return "Greetings "+yourName+"!!!!";
}

where UserCred is a my class having attributs as username, password and get/set methods for it.

But when I generate the proxy classes from wsimport the signature of this method changes to as follows

@WebMethod
@WebResult(name = "greetMessageResponse", targetNamespace = "http://com.xyx/", partName = "result")
public GreetMessageResponse greetMessage(
@WebParam(name = "greetMessage", targetNamespace = "http://com.xyx/", partName = "parameters")
GreetMessage parameters,
@WebParam(name = "UserCred", targetNamespace = "http://com.xyx/", header = true, partName = "UserCred")
UserCred userCred);

If I try to generate the proxy classes for a .NET client is VS, I get the same behaviour.

My WSDL file is as follows


<?xml version="1.0" encoding="UTF-8"?>

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
paul1979
Offline
Joined: 2006-12-25
Points: 0

Hi
if you should not mandatory use RPC soap binding style, try this:

@WebMethod
[b]@javax.jws.soap.SOAPBinding(
style=javax.jws.soap.SOAPBinding.Style.RPC,
use=javax.jws.soap.SOAPBinding.Use.LITERAL,
)[/b]
public String greetMessage(
@WebParam(name="UserCred", header=true)
UserCred userCred,
@WebParam(name="YourName")
String yourName
)
{

return "Greetings "+yourName+"!!!!";
}

the method`s signature will not be changed in the proxy class. In my case, I should use only document style and I don`t know how to solve this problem :-(