• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

unable to read soapmessage

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a file (test.xml) with the below content:

------=_Part_9_21655743.1266408465031
Content-Type: text/xml; charset=UTF-8

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:apache="http://xml.apache.org/xml-soap" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:noprefix_defaultname="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:attachments.wsdl.test" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Header/>
<soapenv:Body>
<tns:tagX>45</tns:tagX>
<tns:inputMimeMultipart/>
</soapenv:Body>
</soapenv:Envelope>

------=_Part_9_21655743.1266408465031
Content-Type: text/plain

Hi this is the default mime content.
------=_Part_9_21655743.1266408465031--



I have written the below java code (with the intention to get the XML part):


Error:

SEVERE: SAAJ0511: Unable to create envelope from given source
Exception in thread "main" com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:

The SOAPPart is not retrieved. Getting SOAPBody fails with "com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:image/jpg. Is this an error message instead of a SOAP response?" message.

The getAttachments() returns an empty iterator.

Can someone show code for 1. getting the XML SOAP DOM object and 2. the attachment content from the above file?
 
chaitu sravs
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am just wondering if there is any hint at what is wrong, I searched and searched but in vain...

The above SOAP request file and the Java code reproduce the stated problem in JDK1.6.

 
She'll be back. I'm just gonna wait here. With this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic