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 Michael J Fork <mj...@us.ibm.com> on 2003/07/30 06:41:57 UTC
Apache -> MSSOAP & Namespaces
All,
I am trying to connect to MSSOAP 3.0 from the Apache Soap shipped with IBM
WebSphere Application Server 4.0 (not sure of version), and am getting the
following error:
Server:XML Parser failed at linenumber 5, lineposition 36, reason is: Only
a default namespace can have an empty URI.
The request that was sent:
POST http://XXXXX/XXXX/XXXXXXXXX.wsdl HTTP/1.0
Host: XXXXX
Content-Type: text/xml; charset=utf-8
Content-Length: 699
SOAPAction: "http://xxxxxx/xxxxxx/xxxxxx/xxxxxx.Login"
<?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/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:Login xmlns:ns1="http://tempuri.org/test2/message/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<strLoginName xmlns:ns2="" xsi:type="ns2:Result">xxxxxxx</strLoginName>
<strPassword xmlns:ns3="" xsi:type="ns3:Result">xxxxxxxxx</strPassword>
</ns1:Login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
It does not like xmlns:ns2="" -- how do I specify a value for the
namespace? The code creating the call is generated by WSAD and is:
Vector params = new Vector();
Parameter strLoginNameParam = new Parameter("strLoginName", java.lang.String.class, strLoginName, Constants.NS_URI_SOAP_ENC);
params.addElement(strLoginNameParam);
Parameter strPasswordParam = new Parameter("strPassword", java.lang.String.class, strPassword, Constants.NS_URI_SOAP_ENC);
params.addElement(strPasswordParam);
call.setParams(params);
Response resp = call.invoke(getURL(), SOAPActionURI);
Thanks.
Michael Fork
mjfork@us.ibm.com
Re: Apache -> MSSOAP & Namespaces
Posted by Scott Nichol <sn...@scottnichol.com>.
My guess is that either you or WebSphere has added a type mapping to read the result, but has not done it correctly. It looks like a full type mapping has been provided, rather than the element name mapping required. It should be something like
StringDeserializer stringDser = new StringDeserializer();
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Result"), String.class, null, stringDser);
Note that the serializer is specified as null, indicating that this is just for mapping an element to a Java class through a particular deserializer.
Scott Nichol
Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message -----
From: "Michael J Fork" <mj...@us.ibm.com>
To: <so...@ws.apache.org>
Sent: Wednesday, July 30, 2003 12:41 AM
Subject: Apache -> MSSOAP & Namespaces
> All,
>
> I am trying to connect to MSSOAP 3.0 from the Apache Soap shipped with IBM
> WebSphere Application Server 4.0 (not sure of version), and am getting the
> following error:
>
> Server:XML Parser failed at linenumber 5, lineposition 36, reason is: Only
> a default namespace can have an empty URI.
>
> The request that was sent:
>
> POST http://XXXXX/XXXX/XXXXXXXXX.wsdl HTTP/1.0
> Host: XXXXX
> Content-Type: text/xml; charset=utf-8
> Content-Length: 699
> SOAPAction: "http://xxxxxx/xxxxxx/xxxxxx/xxxxxx.Login"
>
> <?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/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <SOAP-ENV:Body>
> <ns1:Login xmlns:ns1="http://tempuri.org/test2/message/"
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <strLoginName xmlns:ns2="" xsi:type="ns2:Result">xxxxxxx</strLoginName>
> <strPassword xmlns:ns3="" xsi:type="ns3:Result">xxxxxxxxx</strPassword>
> </ns1:Login>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> It does not like xmlns:ns2="" -- how do I specify a value for the
> namespace? The code creating the call is generated by WSAD and is:
>
> Vector params = new Vector();
> Parameter strLoginNameParam = new Parameter("strLoginName", java.lang.String.class, strLoginName, Constants.NS_URI_SOAP_ENC);
> params.addElement(strLoginNameParam);
> Parameter strPasswordParam = new Parameter("strPassword", java.lang.String.class, strPassword, Constants.NS_URI_SOAP_ENC);
> params.addElement(strPasswordParam);
> call.setParams(params);
>
> Response resp = call.invoke(getURL(), SOAPActionURI);
>
> Thanks.
>
> Michael Fork
> mjfork@us.ibm.com