13 years ago
Issue with line-breaks in SOAPUi-generated request
Hi,
I'm currently working on a webservice using a service provider (javax.xml.ws.Provider).
In order to test it rapidly, it thought about using SOAPUi. The thing is the requests sent by SOAPUi contain line-breaks and for an unknown reason
my service provider doesn't succeed to get the content of the request correctly.
After many testing and internet searches, I finally found that the same request without line-breaks is working whereas with line-breaks it is not.
Is there an option to force the removal of the line-breaks in the RAW version of the request in SOAPUi ?
OR
Is there something to do in my code to make it able to correctly work?
Thank you for any indication!
Here is a part of my code :
I'm currently working on a webservice using a service provider (javax.xml.ws.Provider).
In order to test it rapidly, it thought about using SOAPUi. The thing is the requests sent by SOAPUi contain line-breaks and for an unknown reason
my service provider doesn't succeed to get the content of the request correctly.
After many testing and internet searches, I finally found that the same request without line-breaks is working whereas with line-breaks it is not.
Is there an option to force the removal of the line-breaks in the RAW version of the request in SOAPUi ?
OR
Is there something to do in my code to make it able to correctly work?
Thank you for any indication!
Here is a part of my code :
@WebServiceProvider(portName = "serviceSOAP", serviceName = "service", targetNamespace = "http://www.example.net/")
@ServiceMode(value = javax.xml.ws.Service.Mode.MESSAGE)
public class ServiceIO implements Provider<SOAPMessage> {
private static Logger log = Logger.getLogger(ServiceIO.class);
@Override
public SOAPMessage invoke(SOAPMessage request) {
try {
request.writeTo(System.out); //Here I'm checking if the request arrived correctly
Node root = request.getSOAPBody().getFirstChild(); // Getting the real message from the SOAPMessage,
// IT DOESN'T WORK IF THE MESSAGE COMES FROM SOAPUI
String operation = root.getLocalName();
if (operation == null) { //The operation is always null if the request is not "inline"
log.debug("invoke Exception : no operation name");
throw new ServiceIOFault("No Operation Name");
}
else{
System.out.println("Operation : "+operation);
}
}catch(Exception e){
e.printStackTrace();
}
}
}