wsimport port return invalidxmlexception iso-8859-1



Let me try to explain a doubts in ws client. I generate the code automaticly using wsimport. I have two issues to solve:


1) The webservice result is ISO-8859-1, but by default is set UTF-8, I don't know how to change the encoding.


2) When server don't return any special caracter ISO-8859-1 the result is null, I'm using proxy maybe thats the problem.


Bellow the exception and the test code:


com.sun.xml.internal.ws.encoding.soap.DeserializationException: Failed to read a response: javax.xml.bind.UnmarshalException - with linked exception: [javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,266] Message: Byte inválido 2 da sequência UTF-8 do byte 2.] at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:113) at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78) at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135) at com.sun.proxy.$Proxy22.cleanse(Unknown Source) at org.apache.ws.axis2.services.test.TestMain.main(TestMain.java:49) Caused by: javax.xml.bind.UnmarshalException


- with linked exception:



@WebEndpoint(name = "cleanseSOAPport_http")
public CleansePortType getCleanseSOAPportHttp() {
return super.getPort(new QName("http://ift.tt/1uzFBTy", "cleanseSOAPport_http"), CleansePortType.class);
}





@WebMethod(action = "cleanse")
@WebResult(name = "CleanseResponse", targetNamespace = "http://ift.tt/1uzFBTy")
@RequestWrapper(localName = "cleanse", targetNamespace = "http://ift.tt/1uzFBTy", className = "org.apache.ws.axis2.services.cleanse.Cleanse")
@ResponseWrapper(localName = "CleanseResponse", targetNamespace = "http://ift.tt/1uzFBTy", className = "org.apache.ws.axis2.services.cleanse.CleanseResponse")
public OutputField cleanse(
@WebParam(name = "SystemID", targetNamespace = "http://ift.tt/1uzFBTy")
String systemID,
@WebParam(name = "ServerID", targetNamespace = "http://ift.tt/1uzFBTy")
String serverID,
@WebParam(name = "CleanseInput", targetNamespace = "http://ift.tt/1uzFBTy")
InputField cleanseInput)
throws CleanseFault
;

No comments:

Post a Comment