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 "Hansen, Richard" <Ri...@westgroup.com> on 2001/03/22 22:44:20 UTC

BUG in type mapping?

I think there may be a bug in how type mappings are handled. With an input
parameters it is not necessary to define a QName. I can just define a
mapping of java.lang.String to the StringDeserializer. But for a return
value it is necessary to define a QName along with the java type. If I don't
define a QName then I get an error message that a mapping for the whatever
the type name is cannot be found. 

Now the problem I have run into is that the only way I can get interop
between Apache and MS SOAP is to not define a QName. With the MS high level
api I could find no way to get it to insert the proper URI from the WSDL
file. So I was forced to just leave the QName undefined.

Rick Hansen

The views, opinions, and judgments expressed in this message are solely
those of the author. The message contents have not been reviewed or approved
by West Group.



ms soap

Posted by Frank Starsinic <fs...@apengines.com>.
i have a client that is using the ms soap toolkit.

when they send me an array of stuff which i would expect like this...
<soap:envelope>
<blah-blah/>
<stuffs>
   <stuff>asdf</stuff>
   <stuff>asdfddasdf</stuff>
   <stuff>lkjkjkjk</stuff>
</stuffs>
</blah-blah>
</soap:envelope>


apparently the only way ms suggests to do that is with either an ADO
recordset
or wrap it all in a CDATA thingy so i end up getting this instead...

<soap:envelope>
<blah-blah/>
<stuffs>[CDATA[
   &lt;stuff&gt;asdf&lt;/stuff&gt;
   &lt;stuff&gt;asdfddasdf&lt;/stuff&gt;
   &lt;stuff&gt;lkjkjkjk&lt;/stuff&gt;]]
</stuffs>
</blah-blah>
</soap:envelope>

is this really the only option? something does not seems right here.
i'm not exactly sure of the CDATA syntax but ya'll get my point i think.
geepers. what do i do?

frank


ms soap

Posted by Frank Starsinic <fs...@apengines.com>.
i have a client that is using the ms soap toolkit.

when they send me an array of stuff which i would expect like this...
<soap:envelope>
<blah-blah/>
<stuffs>
   <stuff>asdf</stuff>
   <stuff>asdfddasdf</stuff>
   <stuff>lkjkjkjk</stuff>
</stuffs>
</blah-blah>
</soap:envelope>


apparently the only way ms suggests to do that is with either an ADO
recordset
or wrap it all in a CDATA thingy so i end up getting this instead...

<soap:envelope>
<blah-blah/>
<stuffs>[CDATA[
   &lt;stuff&gt;asdf&lt;/stuff&gt;
   &lt;stuff&gt;asdfddasdf&lt;/stuff&gt;
   &lt;stuff&gt;lkjkjkjk&lt;/stuff&gt;]]
</stuffs>
</blah-blah>
</soap:envelope>

is this really the only option? something does not seems right here.
i'm not exactly sure of the CDATA syntax but ya'll get my point i think.
geepers. what do i do?

frank


RE: BUG in type mapping?

Posted by Silvio Fiorito <si...@ntr.net>.
I haven't had any problems using an ApacheSOAP client against an MSSOAP
highlevel API endpoint. Here's a message I posted to the list last night:

Someone had the same problem last week. Here's the msg I sent them (note
that you MUST have the tempuri.org junk, it's not an actual URL, just a
place holder I believe [as in temp URI]):

Anyways, let's say you have a COM object "SOAPTest.TestClass" and you'd like
to call method "TestMethod" which takes one string parameter named
"strParam1" and returns a string. Here's what you do (I'm using the
'guidgen' sample as a basis):

    Vector params = new Vector();
    URL url = new
URL("http://localhost/path_to_wsdl_generated_asp_file.asp");

    // define deserializers for the return things (without xsi:type)
    SOAPMappingRegistry smr = new SOAPMappingRegistry ();
    StringDeserializer sd = new StringDeserializer ();
    smr.mapTypes (Constants.NS_URI_SOAP_ENC, new QName("", "Result"), null,
null, sd);

    // create the transport and set parameters
    SOAPHTTPConnection st = new SOAPHTTPConnection();

    // build the call.
    Call call = new Call ();
    call.setSOAPTransport(st);
    call.setSOAPMappingRegistry (smr);
    call.setTargetObjectURI ("http://tempuri.org/message/");
    call.setMethodName("TestMethod");
    call.setEncodingStyleURI ("http://schemas.xmlsoap.org/soap/encoding/");

    params.addElement(new Parameter("strParam1", String.class, "A", null));
    call.setParams(params);

    // invoke it
    Response resp;
    resp = call.invoke (url,
"http://tempuri.org/action/TestClass.TestMethod");

I think that should do it. I just got it working today. Email me directly if
you're still having problems (unless the other list members don't mind the
traffic).

Silvio

-----Original Message-----
From: Hansen, Richard [mailto:Richard.Hansen@westgroup.com]
Sent: Thursday, March 22, 2001 4:44 PM
To: Apache Soap list (E-mail)
Subject: BUG in type mapping?


I think there may be a bug in how type mappings are handled. With an input
parameters it is not necessary to define a QName. I can just define a
mapping of java.lang.String to the StringDeserializer. But for a return
value it is necessary to define a QName along with the java type. If I don't
define a QName then I get an error message that a mapping for the whatever
the type name is cannot be found.

Now the problem I have run into is that the only way I can get interop
between Apache and MS SOAP is to not define a QName. With the MS high level
api I could find no way to get it to insert the proper URI from the WSDL
file. So I was forced to just leave the QName undefined.

Rick Hansen

The views, opinions, and judgments expressed in this message are solely
those of the author. The message contents have not been reviewed or approved
by West Group.



RE: BUG in type mapping?

Posted by Silvio Fiorito <si...@ntr.net>.
I haven't had any problems using an ApacheSOAP client against an MSSOAP
highlevel API endpoint. Here's a message I posted to the list last night:

Someone had the same problem last week. Here's the msg I sent them (note
that you MUST have the tempuri.org junk, it's not an actual URL, just a
place holder I believe [as in temp URI]):

Anyways, let's say you have a COM object "SOAPTest.TestClass" and you'd like
to call method "TestMethod" which takes one string parameter named
"strParam1" and returns a string. Here's what you do (I'm using the
'guidgen' sample as a basis):

    Vector params = new Vector();
    URL url = new
URL("http://localhost/path_to_wsdl_generated_asp_file.asp");

    // define deserializers for the return things (without xsi:type)
    SOAPMappingRegistry smr = new SOAPMappingRegistry ();
    StringDeserializer sd = new StringDeserializer ();
    smr.mapTypes (Constants.NS_URI_SOAP_ENC, new QName("", "Result"), null,
null, sd);

    // create the transport and set parameters
    SOAPHTTPConnection st = new SOAPHTTPConnection();

    // build the call.
    Call call = new Call ();
    call.setSOAPTransport(st);
    call.setSOAPMappingRegistry (smr);
    call.setTargetObjectURI ("http://tempuri.org/message/");
    call.setMethodName("TestMethod");
    call.setEncodingStyleURI ("http://schemas.xmlsoap.org/soap/encoding/");

    params.addElement(new Parameter("strParam1", String.class, "A", null));
    call.setParams(params);

    // invoke it
    Response resp;
    resp = call.invoke (url,
"http://tempuri.org/action/TestClass.TestMethod");

I think that should do it. I just got it working today. Email me directly if
you're still having problems (unless the other list members don't mind the
traffic).

Silvio

-----Original Message-----
From: Hansen, Richard [mailto:Richard.Hansen@westgroup.com]
Sent: Thursday, March 22, 2001 4:44 PM
To: Apache Soap list (E-mail)
Subject: BUG in type mapping?


I think there may be a bug in how type mappings are handled. With an input
parameters it is not necessary to define a QName. I can just define a
mapping of java.lang.String to the StringDeserializer. But for a return
value it is necessary to define a QName along with the java type. If I don't
define a QName then I get an error message that a mapping for the whatever
the type name is cannot be found.

Now the problem I have run into is that the only way I can get interop
between Apache and MS SOAP is to not define a QName. With the MS high level
api I could find no way to get it to insert the proper URI from the WSDL
file. So I was forced to just leave the QName undefined.

Rick Hansen

The views, opinions, and judgments expressed in this message are solely
those of the author. The message contents have not been reviewed or approved
by West Group.