Consuming WS on full vs compact framework - XmlException

B

Bert

Hi,

I'm really desperate here, so I'll try to post my problem once more..

I'm building a web service (to be consumed by a .NET Compact Framework
client), using the Remoting infrastructure. Depending on the incoming
message, I change some properties in the IMessage object (in a
ChannelSink). Sometimes I have to change the return value from a method
from AClass to string. Whenever I do this the soap message gets another
formatting; eg:

invoking "string method1()"
Soap response:
<SOAP-ENV:Body>
<i2:SayHelloResponse id="ref-1" xmlns:i2
="http://schemas.microsoft.com/clr/nsassem/TestClassesLib.Class1/TestType
s" >
<return id="ref-3">Hello World</return>
</i2:SayHelloResponse>
</SOAP-ENV:Body>

invoking "AClass method2()" (AClass is substituted by a string, which
contains a custom reference to the object, when
returning)
Soap response:
<SOAP-ENV:Body>
<i2:GetClass2InstanceResponse id="ref-1" xmlns:i2
="http://schemas.microsoft.com/clr/nsassem/TestClassesLib.Class1/TestType
s">
<return href="#ref-3" />
</i2:GetClass2InstanceResponse>
<SOAP-ENC:string id="ref-3">
R2WS:http://192.168.0.2:1234/TestClassesLib.Class2[582f19a6-19f9-48d0-
ac9c-44bfdb5de304]</SOAP-ENC:string>
</SOAP-ENV:Body>


So the second message returns a string using a reference, while the first
one does it directly. These two work fine on a normal client (using the
full framework), but if I try it on a Compact client an XmlException
with message: "The identifier \"ref-3\" does not appear in the
document." is thrown, while clearly "ref-3" is present.

Is this a bug in the CF? Is there a way to force the formatting of the
soap message to always follow the first approach? Any other suggestions?

Your help is much appriciated,
Bert.
 
R

Ronnie Yates [MS]

Can you post the complete Soap messages for both responses? Can you check
which namespace the href and id namespaces are in, they should be in no
namespace? Also, what service is the CF client talking to, ASP.Net, Axis,
etc? If its ASP.Net, can you post the service code.

.NET Compact Framework FAQ:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.a
spx
.NET Compact Framework KickStart:
http://www.amazon.com/exec/obidos/tg/detail/-/0672325705/qid=1070652954//ref
=sr_8_xs_ap_i0_xgl14/103-0627618-0577446?v=glance&s=books&n=507846

This posting is provided "AS IS" with no warranties, and confers no rights.
 
R

Ronnie Yates [MS]

I'm sorry, my questions were a bit vague. Does the call to "string
method1()" succeed or fail? Does the call to "AClass method2()" succeed or
failt? I took a look at your other thread, but the code to generate the
responses on this thread would be easier to debug and diagnosis. Do you
have the code to generate these two response? If so, can you post it?
Thanks.

..NET Compact Framework FAQ:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.a
spx
..NET Compact Framework KickStart:
http://www.amazon.com/exec/obidos/tg/detail/-/0672325705/qid=1070652954//ref
=sr_8_xs_ap_i0_xgl14/103-0627618-0577446?v=glance&s=books&n=507846

This posting is provided "AS IS" with no warranties, and confers no rights.
 
B

Bert

Here are the exact messages:

This is the response message that causes the exception (ref-3 is not
found):

<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<i2:GetClass2InstanceResponse id="ref-1" xmlns:i2
="http://schemas.microsoft.com/clr/nsassem/TestClassesLib.Class1/TestType
s">
<return href="#ref-3" />
</i2:GetClass2InstanceResponse>
<SOAP-ENC:string id="ref-3">
R2WS:http://192.168.0.2:1234/TestClassesLib.Class2[a2bced06-635d-4c3d-
bfdc-8ed6ba865eed]</SOAP-ENC:string>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


The exception doesn't occur with the following message:

<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<i2:SayHelloResponse id="ref-1" xmlns:i2
="http://schemas.microsoft.com/clr/nsassem/TestClassesLib.Class1/TestType
s">
<return>Hello World</return>
</i2:SayHelloResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


And the problem remains with SP2.

If you need some other info, just let me known.


Thanks for the help,
Bert.



(e-mail address removed) (Ronnie Yates [MS]) wrote in
 
R

Ronnie Yates [MS]

Are you talk to an ASP.Net server? If so, can you post the server code and
a simple client? This would help me create a repro scenario. Thanks

.NET Compact Framework FAQ:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.a
spx
.NET Compact Framework KickStart:
http://www.amazon.com/exec/obidos/tg/detail/-/0672325705/qid=1070652954//ref
=sr_8_xs_ap_i0_xgl14/103-0627618-0577446?v=glance&s=books&n=507846

This posting is provided "AS IS" with no warranties, and confers no rights.
 
B

Bert

I'm not using ASP.NET, all the objects are hosted on .NET Remoting using
the HttpChannel.

If you want to see my code, I'd rather mail to you directly than post it in
this group, because I'm not shure I can share all this code and that way it
is a bit more confidential.


Thanks,
Bert.

(e-mail address removed) (Ronnie Yates [MS]) wrote in
 
R

Rob

I was also using .Net Remoting using the HttpChannel.

--Rob

Bert said:
I'm not using ASP.NET, all the objects are hosted on .NET Remoting using
the HttpChannel.

If you want to see my code, I'd rather mail to you directly than post it in
this group, because I'm not shure I can share all this code and that way it
is a bit more confidential.


Thanks,
Bert.

(e-mail address removed) (Ronnie Yates [MS]) wrote in
Are you talk to an ASP.Net server? If so, can you post the server code
and a simple client? This would help me create a repro scenario.
Thanks

NET Compact Framework FAQ:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/defa
ult.a spx
NET Compact Framework KickStart:
http://www.amazon.com/exec/obidos/tg/detail/-/0672325705/qid=1070652954
//ref
=sr_8_xs_ap_i0_xgl14/103-0627618-0577446?v=glance&s=books&n=507846

This posting is provided "AS IS" with no warranties, and confers no
rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top