473,748 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SAAJ response - invalid SOAP envelope

I'm using SAAJ 1.2 (from jwsdp-1.3) and JDK 1.4.2_03.

I've written a client application that uses the SAAJ api to send a
SOAP message to a servlet. The servlet successfully receives the
message and returns a SOAP response containing a single element in the
SOAP body. The client receives the response and writes its content to
standard out via the SOAPMessage.wri teTo() method. The response
received looks correct:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/">
<SOAP-ENV:Body>
<eai:Response xmlns:eai="urn: nz:govt:eai">SU CCESS</eai:Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

.... but when I try to access the soap envelope as follows:

SOAPMessage response = connection.call (message, endpoint);
response.writeT o(System.out);
SOAPPart part = response.getSOA PPart();
SOAPEnvelope env = part.getEnvelop e();

The last line in the above code fragment throws the following
exception (see below). Does anyone know whats causing this? Please
help.

Thanks in advance ...
Steve

SEVERE: SAAJ0511: Unable to create envelope from given source
com.sun.xml.mes saging.saaj.SOA PExceptionImpl: Unable to create
envelope from given source:
at com.sun.xml.mes saging.saaj.soa p.EnvelopeFacto ry.createEnvelo pe(EnvelopeFact ory.java:71)
at com.sun.xml.mes saging.saaj.soa p.ver1_1.SOAPPa rt1_1Impl.creat eEnvelopeFromSo urce(SOAPPart1_ 1Impl.java:34)
at com.sun.xml.mes saging.saaj.soa p.SOAPPartImpl. getEnvelope(SOA PPartImpl.java: 82)
at test.SendDogLic ense.main(SendD ogLicense.java: 124)
Caused by: javax.xml.trans form.Transforme rException:
org.w3c.dom.DOM Exception: NAMESPACE_ERR: An attempt is made to create
or change an object in a way which is incorrect with regard to
namespaces.
at org.apache.xala n.transformer.T ransformerIdent ityImpl.transfo rm(TransformerI dentityImpl.jav a:511)
at com.sun.xml.mes saging.saaj.soa p.EnvelopeFacto ry.createEnvelo pe(EnvelopeFact ory.java:63)
.... 3 more
Caused by: org.w3c.dom.DOM Exception: NAMESPACE_ERR: An attempt is made
to create or change an object in a way which is incorrect with regard
to namespaces.
at org.apache.xml. utils.DOMBuilde r.startElement( DOMBuilder.java :354)
at org.apache.xala n.transformer.T ransformerIdent ityImpl.startEl ement(Transform erIdentityImpl. java:1073)
at org.xml.sax.hel pers.XMLFilterI mpl.startElemen t(Unknown Source)
at org.apache.xerc es.parsers.Abst ractSAXParser.s tartElement(Unk nown
Source)
at org.apache.xerc es.impl.XMLNSDo cumentScannerIm pl.scanStartEle ment(Unknown
Source)
at org.apache.xerc es.impl.XMLNSDo cumentScannerIm pl$NSContentDis patcher.scanRoo tElementHook(Un known
Source)
at org.apache.xerc es.impl.XMLDocu mentFragmentSca nnerImpl$Fragme ntContentDispat cher.dispatch(U nknown
Source)
at org.apache.xerc es.impl.XMLDocu mentFragmentSca nnerImpl.scanDo cument(Unknown
Source)
at org.apache.xerc es.parsers.XML1 1Configuration. parse(Unknown Source)
at org.apache.xerc es.parsers.XML1 1Configuration. parse(Unknown Source)
at org.apache.xerc es.parsers.XMLP arser.parse(Unk nown Source)
at org.apache.xerc es.parsers.Abst ractSAXParser.p arse(Unknown Source)
at org.xml.sax.hel pers.XMLFilterI mpl.parse(Unkno wn Source)
at org.apache.xala n.transformer.T ransformerIdent ityImpl.transfo rm(TransformerI dentityImpl.jav a:494)
.... 4 more
Jul 17 '05 #1
0 6903

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
7456
by: Oliver Hirschi | last post by:
Hi, I am really confused. I try to call a soap-method on a server with one parameter and I like to get the return-parameter of this method, but I get ever the following exception by invoking the call: -------------------------------------- No Deserializer found to deserialize a &apos;http://schemas.xmlsoap.org/soap/encoding/:string&apos; using encoding style &apos;http://schemas.xmlsoap.org/soap/encoding/&apos;.
3
2382
by: Michel | last post by:
Hi there, I am using a web service in VS2003 (the service itself is a dll - I think it is made in Delphi). When calling it, I get an InvalidOperationException: "There is an error in XML document (2, 5587)", with an inner exception: "The referenced element with ID '2' was not found in the document." I use SOAP toolkit to trace the messages. Below are the return message and the schema (shortened for clarity). They look fine to me...
4
7850
by: Christian Wilhelm | last post by:
Hi! I have a Problem understanding the deserialisation of SOAP-Responses. The "normal" way, calling a XML WebService is to use WSDL 1) Send Request 2) Get SOAP-Response 3) With Informations out of WSDL transform the SOAP-Response to an Object. Let us call it "Customer".
2
5062
by: Pathogenix | last post by:
Greetings, I'm trying to fix a web service client which has been implemented in a dailywtf worthy manner. I've decided to rip all the old code out and start again from the proxy generated by wsdl.exe. I've immediately run up against the same problem that spawned the original, deeply fascinating code. I can make a request, and Fiddler shows that the service is returning a valid response, but the client is returning a null object....
1
3671
by: BeckyB00 | last post by:
Slightly different situation from the question of the 11/18/05 but the same error. (I'm just learning about web services so this is based on a 'quick tutorial') I'm running a web service using Axis and want to consume it with a .NET client. So I've created the web proxy using wsdl.exe and I can call the service and it responds but the client returns null. If I run a Java client then it gets the response fine and dandy. The web service...
5
3752
by: Robbert van Geldrop | last post by:
Hello, I have a problem consuming a WebService which appears to be dependent of the type of network I am on: The following SOAP response is not processed when I am connected over the internet with the WebService but it is processed correctly when I am on the local LAN: Can it have something todo with the maximum response size and WebServices
2
3414
plumpnation
by: plumpnation | last post by:
I have now got this bulky piece of script working, it reads the form correctly, which sends the request to the web service using SOAP. It conforms to their DTD and the web service then responds and sends an xml document back to the page. I would very much like the contents of the form to be entered into an sql database as it is sent to the web service, as their reply does not contain the full details filled into the form. Aside from the...
2
7293
by: hary | last post by:
Hello, I have a C# application that is consuming a C# WebService. I am calling a method on the WebService and it is sending me back a response which contains an XmlDocument: string soapMessage = "<?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><validateStudent...
0
2141
by: nappingcub | last post by:
This is my first time coding a web service in .NET and ran into a slight snag that I was hoping that anyone could help me out on. I'm using the generic Hello World web service that is stubbed out on a new web service project since it can convey what I would like to do in the smallest amount of code. I've figured out how to change the <HelloWorldResponse> to a different element name by using the SoapDocumentMethod parameters, but I can't find...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9552
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8245
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4877
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.