You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by "Sanders, Corey" <Co...@stercomm.com> on 2002/02/06 01:06:07 UTC

RE: Error parsing response envelope on Linux, but not windows 200 0.

While searching for a resolution, I found the attached information on the
Apache SOAP User's FAQ
(http://xml.apache.org/soap/faq/faq_chawke.html#Q1_2), which helped.

The FAQ says to use Xerces 1.4.3. I upgraded to Xerces 1.4.4 (the most
current at this time) from Xerces 1.4.2 and that fixed my problem. I am at a
loss, however, as to why the code ever worked on either platform because I
am running the _exact_ same jars and exact same classpaths on both Windows
and Linux machines. Oh well...

-- Corey


---------- 8< CUT - SOAP-User's FAQ Entry 1.2 - CUT 8< ----------

1.2  Help! I'm getting this error: "Unable to resolve namespace URI for
'xsd'".
Ensure that:
(a) You are using Xerces 1.4.3, 1.2.3 or 1.3.0 (but NOT 1.3.1) - on both the
client and the server (if both are using Apache-SOAP).
(b) xerces.jar is the FIRST entry in your CLASSPATH, as described in the
Apache-SOAP installation instructions.
(c) There is ONLY ONE version of xerces.jar in your CLASSPATH.
(d) There are no other XML parsers in your classpath. Some people have
experienced this problem due to an early version of the JAXP package hiding
in JAVA_HOME/jre/lib/ext.



-----Original Message-----
From: Sanders, Corey 
Sent: Tuesday, February 05, 2002 3:06 PM
To: Apache SOAP User Mailing List (E-mail)
Subject: Error parsing response envelope on Linux, but not windows 2000.



I am experiencing wierd behavior using the SOAP-2_2 API. Using the code
fragment attached below, I can make a successful call from my SOAP client on
a Windows 2000 machine into an Apache SOAP 2.1 service running on JRun. But,
using the _exact_ same code, against the same service, but from my Redhat
7.2 machine, I am getting the attached exception. I have verified that the
classpaths and jars are the same on both machines. The client JVM is the
same - JDK1.3.1_01. Both clients are running under Weblogic 6.1.

Stepping through the SOAP source in my debugger, I can see why the error is
occuring. While processing the response envelope (attached below), the API
is unable to locate a namespaceURI for the "xsd" namespace. But the xsd
namespace is defined  in the Envelope tag! Besides that, I cannot see why
the behavior would be different between the two platforms. And I am pretty
confident there is a platform issue because I have been able to duplicate
the problem on two different Linux machines and unable to duplicate the
problem on two different Windows 2000 machines.


---------- 8< CUT - Exception - CUT 8< ----------

project.exception.RegistrationException: Unexpected exception caught in
call.[Stack Trace:] [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to
resolve namespace URI for 'xsd'.;
targetException=java.lang.IllegalArgumentException: Unable to resolve
namespace URI for 'xsd'.]
	at org.apache.soap.rpc.Call.invoke(Call.java:244)
	at
project.memberadmin.RegistrationAPI.getUserInfo(RegistrationAPI.java:212)
	at jsp_servlet.__GetUserInfo._jspService(__GetUserInfo.java:133)
	at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:265)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:200)
	at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:2456)
	at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2039)
	at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
	at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

---------- 8< CUT - Response Envelope - CUT 8< ----------

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
	xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
	xmlns:xsd="http://www.w3.org/1999/XMLSchema">
	<SOAP-ENV:Body>
		<ns1:getUserInfoResponse
			xmlns:ns1="urn:GetUserInfoManager"
	
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
			<return xsi:type="xsd:string">blah, blah,
blah</return>
		</ns1:getUserInfoResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


---------- 8< CUT - Code Fragment - CUT 8< ----------

call = new Call();

callProvider = getCallProvider(METHOD_GET_USER_INFO);

call.setTargetObjectURI(callProvider);
call.setMethodName(METHOD_GET_USER_INFO);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector params = new Vector();
params.addElement(new Parameter(PARAM_CUSTOMER_ID, String.class,
_customerId, null));
params.addElement(new Parameter(PARAM_CONTACT_ID, String.class, _contactId,
null));
call.setParams(params);

Response resp = call.invoke(new URL(providerURL), "");
if( resp.generatedFault() )
{
	Fault fault = resp.getFault();
	throw new RegistrationException("SOAP Exception in call: (" +
		fault.getFaultCode() + ") " + fault.getFaultString() );
} else
{
	result = resp.getReturnValue();
}

--

Corey Sanders
Global Development
Sterling Commerce
614-659-6860