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>
Related
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.
I am facing one weird issue in web services. Functionality is working fine,but the response have some unneccessary namespace to the response element, That prefix is not at all defined in the wsdl or stubs. How to remove the unneccessary prefixes in the response element, that namespace is not at all defined in the WSDL. Please help me out to resolve.
Output:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<p30:realTimeWSProviderResponse xmlns:p30="http://eh.actimize.com">
<requestId/>
<searchDefinitionId/>
<generateAlert/>
Expected Output:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<RealTimeWSProviderResponse xmlns="http://eh.actimize.com">
<requestId xmlns=""/>
<searchDefinitionId xmlns=""/>
<generateAlert xmlns=""/>
<enableSuppression xmlns=""/>
<partyType xmlns=""/>
<partyKey xmlns=""/>
<names xmlns="">
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.
I generate a Web Service Client with the assistant of Eclipse passing the WSDL of the provider Web Service.
I generate in a JUnit test case the object to pass to the Web Service.
//After set properties of the request object
AbacusWebService wsAbacus = new AbacusWebService();
WebServiceResult wsResult = wsAbacus.irsValoration(requestObject);
With the monitor TCP-IP of Eclipse I see the the request and the response and both are correct. The response returns data:
<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>
<irsValorationResponse xmlns="http://webServices.isban.es">
<irsValorationReturn>
<error xsi:nil="true"/>
<format>dd/MM/yyyy</format>
<pricingDate>02/09/2012</pricingDate>
<results>
<results>
<bpv>-492.6493116525817</bpv>
<cer xsi:nil="true"/>
<chargeRunning xsi:nil="true"/>
<chargeUpfront xsi:nil="true"/>
<error xsi:nil="true"/>
<gamma>0.004649336915463209</gamma>
<gammaTotal xsi:nil="true"/>
<minCerReturn xsi:nil="true"/>
<name>IRS</name>
<npv>46371.877687584296</npv>
<payingNpv>0.0</payingNpv>
<pricingDelta>433.0423619134596</pricingDelta>
<receivingNpv>46371.877687584296</receivingNpv>
<swapRate>0.9412756009346844</swapRate>
</results>
</results>
</irsValorationReturn>
</irsValorationResponse>
</soapenv:Body>
But when I inspect the response object (wsResult), all of their properties are null.
Can anyone help me?
Thanks in advance.
I need some help using the SoapUI tool.
I'm testing webServices APIs using this tool.
There is an API called "getUsageReport()" which takes 2 input parameters
<datasources> of type <akaaurdt:ArrayOfString>
<start date> of type <xsd:string>
<akaaurdt:ArrayOfString> is defined as below.
<complexType name="ArrayOfString">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" />
</restriction>
</complexContent>
</complexType>
the request xml in soap UI is as below
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bil="https://control.akamai.com/BillingReports.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<bil:getUsageReport soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<datasources xsi:type="bil:ArrayOfString" soapenc:arrayType="xsd:string[]"/>
<startDate xsi:type="xsd:string">?</startDate>
</bil:getUsageReport>
</soapenv:Body>
</soapenv:Envelope>
when I click on RUN by giving a date in the request, this is the response
<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>
<soapenv:Fault>
<faultcode>soapenv:Server.generalException</faultcode>
<faultstring>akaaurdt:ApplicationError:ApplicationError:(?? No Data for Given Start Date. Please resubmit with a more recent date)</faultstring>
<detail>
<ns1:exceptionName xmlns:ns1="http://xml.apache.org/axis/">com.akamai.aws.util.AWSFault</ns1:exceptionName>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">qa-portal-ws01.qaextranet.akamai.com</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
How do I specify the <datasources> parameter in this request xml to get the desired response?
Please help me with this
-Kiran
Run getReports (or getReportingGroups) of the BillingReports. Lets say it returns a contractCode called 55555.
Run method getUsageReport and it should look like the following:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bil="https://control.akamai.com/BillingReports.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<bil:getUsageReport soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<datasources xsi:type="bil:ArrayOfString" soapenc:arrayType="xsd:string[]">
<datasource xsi:type="xsd:string">55555</datasource>
</datasources>
<startDate xsi:type="xsd:string">20120620</startDate>
</bil:getUsageReport>
</soapenv:Body>
</soapenv:Envelope>
you should specify the date
<startDate xsi:type="xsd:string">?</startDate>
it's required in the request, the date format i don't know how it is defined, because it's string type, and not the date type.
Try with yyyy/MM/dd, is the date format type.
You never want to submit a request with ? placeholders. Edit the request so there's actual data.