Collegues, i call webservice and receive the exception:
org.springframework.ws.soap.SoapMessageCreationException: Could not create message from InputStream: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?
Wireshark shows than i receive response:
HTTP/1.1 200 OK
Content-Type: text/html
Transfer-Encoding: chunked
Server: Jetty(8.1.13.v20130916)
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://mayacomp/Generic/Ws">
<soapenv:Body>
<ws:response>
<out>
<requestID>6b140165-af79-47a2-9e9f-5b7bba265050</requestID>
<requestTimestamp>2015-12-01T13:04:44.044</requestTimestamp>
</out>
</ws:response>
</soapenv:Body>
</soapenv:Envelope>
My beans looks like:
@Bean
public Jaxb2Marshaller marshaller() {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setContextPath("com.mayacomp.entities");
HashMap<String,Object> properties = new HashMap<String,Object>();
properties.put(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.setMarshallerProperties(properties);
return marshaller;
}
@Bean
public myClient myClient(Jaxb2Marshaller marshaller) {
myClient client = new myClient();
client.setDefaultUri("URL");
client.setMarshaller(marshaller);
client.setUnmarshaller(marshaller);
//client.setMessageSender(messageSender);
return client;
}
Class which calls WS looks like:
public class myClient extends WebServiceGatewaySupport {
public Response createApplication(In in) {
Request request = (Request) new Request();
request.setIn(in);
Response response = (Response) getWebServiceTemplate().marshalSendAndReceive(
"URL",
request,
new WebServiceMessageCallback()
{ public void doWithMessage(WebServiceMessage message) {
SaajSoapMessage saajSoapMessage = (SaajSoapMessage)message;
SOAPMessage soapMessage = SOAP.createSOAPMessage(in);
saajSoapMessage.setSaajMessage(soapMessage);
}
}
);
return null;
}
Could you help me to read web service response?
UPDATE
--- maven-dependency-plugin:2.8:tree (default-cli) @ adapter ---
com.comp:adapter:jar:0.0.1-SNAPSHOT
+- junit:junit:jar:4.12:compile
| \- org.hamcrest:hamcrest-core:jar:1.3:compile
+- org.springframework:spring-context:jar:4.2.3.RELEASE:compile
| +- org.springframework:spring-aop:jar:4.2.3.RELEASE:compile
| | \- aopalliance:aopalliance:jar:1.0:compile
| +- org.springframework:spring-beans:jar:4.2.3.RELEASE:compile
| \- org.springframework:spring-expression:jar:4.2.3.RELEASE:compile
+- org.springframework:spring-core:jar:4.2.3.RELEASE:compile
| \- commons-logging:commons-logging:jar:1.2:compile
+- io.codearte.jfairy:jfairy:jar:0.5.1:compile
| +- com.google.guava:guava:jar:19.0-rc2:compile (version selected from constraint [15.0,))
| +- org.yaml:snakeyaml:jar:1.16:compile (version selected from constraint [1.9,2.0))
| +- org.iban4j:iban4j:jar:2.1.1:compile
| +- com.google.inject:guice:jar:4.0:compile
| | \- javax.inject:javax.inject:jar:1:compile
| +- joda-time:joda-time:jar:2.3:compile
| +- com.google.inject.extensions:guice-assistedinject:jar:4.0:compile
| +- org.reflections:reflections:jar:0.9.9:compile
| | +- org.javassist:javassist:jar:3.18.2-GA:compile
| | \- com.google.code.findbugs:annotations:jar:2.0.1:compile
| +- org.apache.commons:commons-lang3:jar:3.3.2:compile
| \- org.slf4j:slf4j-api:jar:1.7.7:compile
+- org.fluttercode.datafactory:datafactory:jar:0.8:compile
+- org.springframework.ws:spring-ws-core:jar:2.2.3.RELEASE:compile
| +- org.springframework.ws:spring-xml:jar:2.2.3.RELEASE:compile
| +- org.springframework:spring-oxm:jar:4.0.9.RELEASE:compile
| +- org.springframework:spring-web:jar:4.0.9.RELEASE:compile
| \- org.springframework:spring-webmvc:jar:4.0.9.RELEASE:compile
+- log4j:log4j:jar:1.2.17:compile
\- org.apache.httpcomponents:httpclient:jar:4.5.1:compile
+- org.apache.httpcomponents:httpcore:jar:4.4.3:compile
\- commons-codec:commons-codec:jar:1.9:compile