JAX-WS webservice operation failing after disabling SSLV3 - java

We are trying to consume Webservice, which was working earlier but now for each of the operation it's failing and getting following SOAP response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>unknown</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
We are using Tomcat and using Java6. Recently we disabled SSLV3, after that we are facing this issue.

Related

Axis 1.4 - Enable MTOM

I am working on a web service project that uses Axis 1.4. The stub and classes are built from the Eclipse Generate Client tool and a provided WSDL. I am able to upload files without issue but I am unable to download files. Requested files are sent back using MTOM. My Request and Responses are formatted correctly but I am getting the following error:
Axis Fault string: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
I have set the following but it does not appear to help:
getStub()._setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT,Call.ATTACHMENT_ENCAPSULATION_FORMAT_MTOM);
Any help would be great appreciated on how to resolve this and be able to access the attachment.
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<getFile xmlns="endpoint">
<input>
<userName>USERNAME</userName>
<passWord>PASSWORD</passWord>
<fileName>FILENAME</fileName>
</input>
</getFile>
</soapenv:Body>
</soapenv:Envelope>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<getResponse xmlns:a="http://www.w3.org/2005/05/xmlmime" xmlns="endpoint">
<output>
<fileData>
<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:FILEREFERENCENUMBER#apache.org"/>
</fileData>
</output>
</getResponse>
</soapenv:Body>
</soapenv:Envelope>

Soap mapping namespace between client and server JAX-WS

My Java project use JAX-WS to create SOAP Webservice. Client is another application send SOAP request to our SOAP Webservice, our SOAP WS receive request, process it and return SOAP response to client.
The SOAP message of client has structure:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:something">
<soapenv:Header/>
<soapenv:Body>
<urn:createAnimal>
<urn:animalData>
<urn:name>Tiger</urn:name>
</urn:animalData>
</urn:createAnimal>
</soapenv:Body>
</soapenv:Envelope>
But the server only support message with structure
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="/com/zoo/zoo/model/service/common/types/" xmlns:com="/com/zoo/zoo/model/view/common/">
<soapenv:Header/>
<soapenv:Body>
<typ:createAnimal>
<typ:animalData>
<!--Optional:-->
<com:name>Tiger</com:firstname>
</typ:animalData>
</typ:createAnimal>
</soapenv:Body>
</soapenv:Envelope>
When client send request to my SOAP Webservice, it receive error:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<env:Fault>
<faultcode>env:Client</faultcode>
<faultstring>Unknown method</faultstring>
</env:Fault>
</env:Body>
</env:Envelope>
I know the reason. Because the namespace of client is xmlns:urn="urn:something" and namespace in supported request of my SOAP service is xmlns:typ="/com/zoo/zoo/model/service/common/types/" xmlns:com="/com/zoo/zoo/model/view/common/". I can not change request structure from client(include namespace). How can I change namespace of my SOAP WS so that it can support namespace xmlns:urn="urn:something" with JAX-WS

jax: instead of ser: - JavaWS

Request from my Web Service looked like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://mywebservice.com/">
<soapenv:Header/>
<soapenv:Body>
<ser:something>
Now, it looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jax="http://mywebservice.com/">
<soapenv:Header/>
<soapenv:Body>
<jax:something>
What´s the difference between jax and ser? I get the same answers and apparently nothing has changed.

How to add namespace in a SOAP envelope using axis with Java

I'm working on a web service project, where I need to alter the default namespace of a soap envelope. I am using axis-1.4. The following is the generated SOAP envelope.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<v1:addClaimRequest xmlns="">
<v1:ClaimsAddRq xsi:type="xsd:string"><ifx:RqUID>004030000075</ifx:RqUID>
</v1:ClaimsAddRq>
</v1:addClaimRequest>
</soapenv:Body>
</soapenv:Envelope>
Following is my Java code:
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("v1");
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("xmlns:v1=urn://shivamath.com/prodschnsmngt/v1/","v1:addClaimRequest"));
_call.addParameter("v1:ClaimsAddRq",org.apache.axis.Constants.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
_call.setTargetEndpointAddress(locator);
_call.setEncodingStyle("");
setRequestHeaders(_call);
setAttachments(_call);
Following is the expected namespace to generate:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:v1="urn://grupoaval.com/prodschnsmngt/v1/"
xmlns:ifx="urn://grupoaval.com/xsd/ifx/">
<soapenv:Body>
<v1:addClaimRequest xmlns="">
<v1:ClaimsAddRq xsi:type="xsd:string"><ifx:RqUID>004030000075</ifx:RqUID>
</v1:ClaimsAddRq>
</v1:addClaimRequest>
</soapenv:Body>
Please guide me out of this problem.

SOAP Request using Java

I have been trying to send a request through soapui and I always keep getting the following error message:
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Failed to process SOAP request. SOAP body not in UTF-16.</faultstring>
<detail>
<wsdl_ops:error>
Failed to process SOAP request. SOAP body not in UTF-16.
</wsdl_ops:error>
</detail>
</soap:Fault>
</soap:Body>
Has anyone run into the same issue before?
UPDATE:
I changed the encoding to UTF-16 and it worked for me. Now, when I send the request I get the following error instead:
REQUEST:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://www.broadsign.com/wsdl_ops">
<soapenv:Header/>
<soapenv:Body>
<ns1:request not_modified_since="1970-01-01T00:00:00" token="0" requestid="1" version="4" name="category_mgr_list">
<category domain_id="1719213" />
</ns1:request>
</soapenv:Body>
</soapenv:Envelope>
RESPONSE:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl_ops="http://www.broadsign.com/wsdl_ops">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Invalid request.</faultstring>
<detail>
<wsdl_ops:error>Invalid request.</wsdl_ops:error>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
What am I missing? :(
Sounds like the service is expecting the request to be encoded as UTF-16. Validate your request and try setting the encoding in the request properties. Failing that, edit your question with the raw inputs and outputs.

Categories

Resources