I'm using a endpoint SOAP created On Spring Framework using JAXB, but I want that my anwers(Expected Response) return without prefix when I Send Request One, but this is returned like is showed on Current Response:.
How can I do to return a message SOAP without namespaces?
Request One
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
<soapenv:Header/>
<soapenv:Body>
<urn:ZProveerDatosPagoProveed2>
<Bukrs>RG10</Bukrs>
<Langu>S</Langu>
<Lifnr>00000000</Lifnr>
</urn:ZProveerDatosPagoProveed2>
</soapenv:Body>
</soapenv:Envelope>
Current Response:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header/>
<soap-env:Body>
<n0:ZProveerDatosPagoProveed2Response xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
<Adrnr>0000</Adrnr>
<Bankk>0000</Bankk>
<Bankn>0000</Bankn>
<Bkont>0000</Bkont>
<Iban>ES0000</Iban>
<KoinhFi>ROBLES AVN</KoinhFi>
<Land1>TH</Land1>
<Landx>XXXXX</Landx>
<Name1>ROBLES AVN</Name1>
<Pstlz>0000</Pstlz>
<Stcd1>A0000</Stcd1>
<Stras>ROBLES AVN</Stras>
<Swift>XXXXX</Swift>
<Text1_052>ROBLES AVN</Text1_052>
<Zterm>Z000</Zterm>
</n0:ZProveerDatosPagoProveed2Response>
</soap-env:Body>
</soap-env:Envelope>
Expected Response:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header/>
<soap-env:Body>
<ZProveerDatosPagoProveed2Response xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
<Adrnr>0000</Adrnr>
<Bankk>0000</Bankk>
<Bankn>0000</Bankn>
<Bkont>0000</Bkont>
<Iban>ES0000</Iban>
<KoinhFi>ROBLES AVN</KoinhFi>
<Land1>TH</Land1>
<Landx>XXXXX</Landx>
<Name1>ROBLES AVN</Name1>
<Pstlz>0000</Pstlz>
<Stcd1>A0000</Stcd1>
<Stras>ROBLES AVN</Stras>
<Swift>XXXXX</Swift>
<Text1_052>ROBLES AVN</Text1_052>
<Zterm>Z000</Zterm>
</ZProveerDatosPagoProveed2Response>
Related
I want to send a java soap req to a web service:
url: (https://webapplicaties.agro.nl/OpvragenPandEnergieLabel/EpbdOpvragenPandEnergieLabelService.asmx?WSDL)
This is the request:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:epb="http://schemas.ep-
online.nl/EpbdOpvragenPandEnergieLabelHeader"
xmlns:epb1="http://schemas.ep-
online.nl/EpbdOpvragenPandEnergieLabelRequest">
<soapenv:Header>
<epb:PandEnergieLabelHeader>
<epb:username>username</epb:username>
<epb:password>password</epb:password>
<epb:versienr>4</epb:versienr>
</epb:PandEnergieLabelHeader>
</soapenv:Header>
<soapenv:Body>
<epb1:GetPandEnergieLabel>
<epb1:Pand_postcode>postcode</epb1:Pand_postcode>
<epb1:Pand_huisnummer>housnr</epb1:Pand_huisnummer>
<epb1:Pand_huisnummer_toev>extra</epb1:Pand_huisnummer_toev>
</epb1:GetPandEnergieLabel>
</soapenv:Body>
</soapenv:Envelope>
and the response should be like this.
Which steps should I take to have a such a response?
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<PandEnergieLabel xmlns="http://schemas.ep-online.nl/EpbdExportTypes">
<Pand_gebouwklasse>W</Pand_gebouwklasse>
<Pand_is_op_basis_van_referentie_gebouw>false</Pand_is_op_basis_van_referentie_gebouw>
<Pand_opnamedatum>29-04-2011</Pand_opnamedatum>
<Pand_berekeningstype>EP</Pand_berekeningstype>
<Pand_energieprestatieindex>1.21</Pand_energieprestatieindex>
<Pand_energieklasse>B</Pand_energieklasse>
<Pand_energielabel_is_prive>false</Pand_energielabel_is_prive>
<Pand_forfaitaire>1.21</Pand_forfaitaire>
<Meting_geldig_tot>29-04-2021</Meting_geldig_tot>
<Pand_registratiedatum>29-04-2011</Pand_registratiedatum>
<Pand_postcode>1072XC</Pand_postcode>
<Pand_huisnummer>79</Pand_huisnummer>
<Pand_huisnummer_toev>A</Pand_huisnummer_toev>
<Pand_gebouwcode />
<Pand_gebouwtype>Portiekwoning</Pand_gebouwtype>
<Pand_gebouwsubtype>Tussenvloer</Pand_gebouwsubtype>
</PandEnergieLabel>
</soap:Body>
</soap:Envelope>
How should I use Variables inside the request to ask for multiple addresses (postcode, housnr, ...)
Thanks
I have written a WebService Client in Java (Spring) that produces the following SOAP Message
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" SOAP-ENV:mustUnderstand="1">
<wsse:UsernameToken wsu:Id="UsernameToken-636BB26257F688077A14836055821331">
<wsse:Username>
<!-- Removed-->
</wsse:Username>
<wsse:Password>
<!-- Removed-->
</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
<To SOAP-ENV:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">https://fi422helswb035/invoicewstest/ProblematicInvoiceWebService.svc/externalpartnerInvoiceWebService</To>
<Action SOAP-ENV:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">https://invoice.externalpartner.com/WebServices/IexternalpartnerInvoiceWebService/GetInvoices</Action>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns4:GetInvoices xmlns:ns2="http://schemas.datacontract.org/2004/07/externalpartner.Invoice.Web.Service.Interfaces.Types" xmlns:ns3="http://schemas.datacontract.org/2004/07/externalpartner.Invoice.Web.Service.Interfaces" xmlns:ns4="https://invoice.externalpartner.com/WebServices/" xmlns:ns5="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns6="http://schemas.datacontract.org/2004/07/externalpartner.Invoice.Web.Service.Exceptions">
<customerNumber xmlns="https://invoice.externalpartner.com/WebServices">10134</customerNumber>
</ns4:GetInvoices>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
This message is Rejected on the server side with a 500 error. I can invoke the service with SOAP-UI; the following message (produced by SOAP UI is accepted)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="https://invoice.externalpartner.com/WebServices/">
<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" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-134751B2732DA1D93F148360576695534">
<wsse:Username>
<!-- Removed-->
</wsse:Username>
<wsse:Password>
<!-- Removed-->
</wsse:Password>
<wsse:Nonce>
<!-- Removed-->
</wsse:Nonce>
<wsu:Created>2017-01-05T08:42:46.955Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
<To soapenv:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">https://fi422helswb035/invoicewstest/ProblematicInvoiceWebService.svc/externalpartnerInvoiceWebService</To>
<Action soapenv:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">https://invoice.externalpartner.com/WebServices/IexternalpartnerInvoiceWebService/GetInvoices</Action>
</soapenv:Header>
<soapenv:Body>
<web:GetInvoices>
<!-- Optional:-->
<web:customerNumber>10134</web:customerNumber>
</web:GetInvoices>
</soapenv:Body>
</soapenv:Envelope>
The real difference I can spot is the up front Name Space declaration in the accepted message. The web namespace is declared in the Envelope element - and in my rejected request it is declared in the element itself.
There are obviously also the missing a nonce and created elements, but according to the Oasis standards, those are not mandatory.
The question is; does the SOAP specification dictate where namespace declarations should be done? My best guess is that the rejected SOAP message is perfectly valid, and that there is a server side issue here...
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 am getting soap response from web service. I need to parse to get the value inside the node. Please provide some code to parse the soap response.
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns3:Response xmlns:ns3="http://www.example.org/Response" userid="100">
<name date="23-10-2013">Sample</name>
<name date="02-09-2013">Hello</name>
</ns3:Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
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.