- This topic has 1 reply, 2 voices, and was last updated 12 years, 7 months ago by support-swapna.
-
AuthorPosts
-
kokomelleMemberHi
I use axis2 and jax-ws to generate a web service client.
In the service I have a method that contains in parameter a complex type
public int sendSaveUserPreferencesWS(UserSetWS[] prefs)the UserSetWS class defined as follow:
public class UserSetWS {
private String setName;
private UserPreferenceWS[] userPreferences;/**
*
* @param setName
* @param uPreferences
*/
public UserSetWS(String setName, UserPreferenceWS[] uPreferences) {
this.setName = setName;
this.userPreferences = uPreferences;
}public void setTiti(String[] setNam){
this.setName = setNam[0];
}public String getSetName() {
return setName;
}public void setSetName(String setName) {
this.setName = setName;
}public int setuPreferences(UserPreferenceWS[] userPreferences) {
this.userPreferences = userPreferences;
return 0;
}public UserPreferenceWS[] getuPreferences() {
return userPreferences;
}}
after generating the clien code. The class UserSetWS is generated but without the method setuPreferences and I’m enable to use the constructor with parameters. the only constructor is new UserSetWS ()
could you help me ?
thanks in advance
support-swapnaModeratorkokomelle,
If you look at the generated client code for the class UserSetWS in the comments section for getUPreferences method :
* This accessor method returns a reference to the live list, not a
* snapshot. Therefore any modification you make to the returned list will
* be present inside the JAXB object. This is why there is not a
* <CODE>set</CODE> method for the uPreferences property.
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getUPreferences().add(newItem);
* </pre>This pretty much explains why you are not seeing the setter method for the complex type.
I think the WSDL only operates on a no-arguments constructor. I am not sure about this one. I suggest you check on Webservices forums for better support on how to get it working.
Hope this helps.
-
AuthorPosts