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.
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>
This is the request that I am sending to zimbra server. And I am using postman for testing this
This is zimbra " Zimbra 9.0.0_ZEXTRAS_20210811 (build 20210830124411) " that I am running in server
I have generate authToken using a username which as administrative access.
Can anyone have solution to this problem?
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<authToken>0_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</authToken>
</context>
</soap:Header>
<soap:Body>
<CreateAccountRequest xmlns="urn:zimbraAdmin" name="testuser#example.com">
<a n="displayName">Test User</a>
<password>testpassword</password>
</CreateAccountRequest>
</soap:Body>
</soap:Envelope>
This is the error that I am getting
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<change token="26999"/>
</context>
</soap:Header>
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Sender</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text>permission denied: need adequate admin token</soap:Text>
</soap:Reason>
<soap:Detail>
<Error xmlns="urn:zimbra">
<Code>service.PERM_DENIED</Code>
<Trace>qtp195615004-132:1651166999211:fedd1b5adb872a47</Trace>
</Error>
</soap:Detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
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
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>
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>