I had the following in my code already:
Call call = new Call();
call.setSOAPTransport(soapHTTPConnection);
SOAPMappingRegistry smr = call.getSOAPMappingRegistry();
StringDeserializer sd = new StringDeserializer();
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Result"), java.lang.String.class, null, sd);
return call;
which unfortunately didn't help :-( Any other ideas on how to get a namespace?
Thanks.
Michael Fork
[EMAIL PROTECTED]
"Scott Nichol" <[EMAIL PROTECTED]>
07/30/2003 10:18 AM
|
To: <[EMAIL PROTECTED]> cc: Subject: Re: Apache -> MSSOAP & Namespaces |
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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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
> [EMAIL PROTECTED]