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="">
Related
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>
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.
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 got little Problems with my generated code:
here the XML Structure that i need to have:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<soapenv:Envelope xmlns:v1="http://openclinica.org/ws/study/v1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="soapenc" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-27777511" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>xxxx</wsse:Username>
<wsse:Password type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxxxxxx</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<v1:listAllRequest/>
</soapenv:Body>
</soapenv:Envelope>
and here´s my Code that i have done:
declarePrefix("v1", NAMESPACE);
getBody().addTextNode(null, METHOD_NAME, "?");
XMLParentNode security = new XMLParentNodeImpl(HEADER_NAMESPACE, "Security");
security.addAttribute(HEADER_NAMESPACE,"mustUnderstand", "1");
XMLParentNode usernameToken = new XMLParentNodeImpl(UNT_NAMESPACE, "UsernameToken");
usernameToken.addTextNode(null, "wsse:Username", "root");
usernameToken.addTextNode(PASSTYPE, "wsse:Password", Constants.OC_PASSWORD);
security.addElement(usernameToken);
getHeader().addElement(security);
but the output looks like:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<soapenv:Envelope xmlns:v1="http://openclinica.org/ws/study/v1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<n0:Security n0:mustUnderstand="1" xmlns:n0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<n1:UsernameToken xmlns:n1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>xxxx</wsse:Username>
<n2:wsse:Password xmlns:n2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxxxxxx</n2:wsse:Password>
</n1:UsernameToken>
</n0:Security>
</soapenv:Header>
<soapenv:Body>
<listAllRequest>?</listAllRequest>
</soapenv:Body>
</soapenv:Envelope>
you see i have some trouble with the lines
<n0:Security....
<n1:UsernameToken...
<n2:wsse:Password...
how can i change the n0,n1 etc... not just in the beginn of the line specialy on the tags like n0:mustUnderstand="1"
i tryed to declare prefixes etc but nothing changes tis object.
Can someone tell with what method i can change this things
Thanks a lot for helping
Christian
for all intrestet Users, i solved it that way:
declarePrefix("v1", NAMESPACE);
declarePrefix("soapenc", "soapenc");
getBody().addTextNode(null, METHOD_NAME, "?");
XMLParentNode security = new XMLParentNodeImpl(null, "wsse:Security");
security.declarePrefix("wsse", HEADER_NAMESPACE);
security.addAttribute(HEADER_NAMESPACE,"mustUnderstand", "1");
XMLParentNode usernameToken = new XMLParentNodeImpl(null, "wsse:UsernameToken");
usernameToken.declarePrefix("wsu", UNT_NAMESPACE);
usernameToken.addAttribute(null, "wsu:Id", "UsernameToken-27777511");
usernameToken.addTextNode(null, "wsse:Username", Constants.OC_Username);
usernameToken.addTextNode(null, "wsse:Password", Constants.OC_PASSWORD);
security.addElement(usernameToken);
getHeader().addElement(security);
the results not 100% simular to my outgoing code, but the request are working :)
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.