Search Results

Search found 2 results on 1 pages for 'user304309'.

Page 1/1 | 1 

  • Failed sending bytes array to JAX-WS web service on Axis

    - by user304309
    Hi I have made a small example to show my problem. Here is my web-service: package service; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public class BytesService { @WebMethod public String redirectString(String string){ return string+" - is what you sended"; } @WebMethod public byte[] redirectBytes(byte[] bytes) { System.out.println("### redirectBytes"); System.out.println("### bytes lenght:" + bytes.length); System.out.println("### message" + new String(bytes)); return bytes; } @WebMethod public byte[] genBytes() { byte[] bytes = "Hello".getBytes(); return bytes; } } I pack it in jar file and store in "axis2-1.5.1/repository/servicejars" folder. Then I generate client Proxy using Eclipse for EE default utils. And use it in my code in the following way: BytesService service = new BytesServiceProxy(); System.out.println("Redirect string"); System.out.println(service.redirectString("Hello")); System.out.println("Redirect bytes"); byte[] param = { (byte)21, (byte)22, (byte)23 }; System.out.println(param.length); param = service.redirectBytes(param); System.out.println(param.length); System.out.println("Gen bytes"); param = service.genBytes(); System.out.println(param.length); And here is what my client prints: Redirect string Hello - is what you sended Redirect bytes 3 0 Gen bytes 5 And on server I have: ### redirectBytes ### bytes lenght:0 ### message So byte array can normally be transfered from service, but is not accepted from the client. And it works fine with strings. Now I use Base64Encoder, but I dislike this solution.

    Read the article

  • Hibernate annotations cascading doesn't work

    - by user304309
    Hi all, I've decided to change hbm.xml style to annotations using hibernate. I had in my hbm.xml: <hibernate-mapping package="by.sokol.jpr.data"> <class name="Licence"> <id name="licenceId"> <generator class="native" /> </id> <many-to-one name="user" lazy="false" cascade="save-update" column="usr"/> </class> </hibernate-mapping> And changed it to: @Entity public class Licence { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int licenceId; @ManyToOne(targetEntity=User.class, fetch=FetchType.EAGER, cascade = CascadeType.ALL) @Cascade(value = { org.hibernate.annotations.CascadeType.SAVE_UPDATE }) private User user; } And hibernate doesn't save user on saving. I really need help!

    Read the article

1