471,089 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

How to determine encodingStyle in SoapExtension SoapClientMessage?

Can anyone tell me how to access the encodingStyle in a client from a
SoapExtension? In particular, I'd like to know the style in
SoapClientMessage in the SoapMessageStage.BeforeSerialize.
I'm trying to determine if the message encodingStyle is document/literal or
rpc/encoding (or document/encoding).

From the SoapClientMessage I can see in the debugger that there is a value
for message.protocol.EncodingNs and for message.Client.EncodingNs of
"http://schemas.xmlsoap.org/soap/encoding/", but i get errors that these
members are "inaccessible due to its protection level" if I try to access them
at compile time. Is there a way using reflection to access these, or some
other way?

Thanks,
Martha Borkan
May 1 '06 #1
3 1699
"M Borkan" <MB*****@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
Can anyone tell me how to access the encodingStyle in a client from a
SoapExtension? In particular, I'd like to know the style in
SoapClientMessage in the SoapMessageStage.BeforeSerialize.
I'm trying to determine if the message encodingStyle is document/literal
or
rpc/encoding (or document/encoding).

From the SoapClientMessage I can see in the debugger that there is a value
for message.protocol.EncodingNs and for message.Client.EncodingNs of
"http://schemas.xmlsoap.org/soap/encoding/", but i get errors that these
members are "inaccessible due to its protection level" if I try to access
them
at compile time. Is there a way using reflection to access these, or some
other way?


Martha:

Reflection should work. I would try it if I were you.

Regards,

--
Martin Kulov
http://www.codeattest.com/blogs/martin

MVP, MCT, MCSD.NET Early Achiever

May 1 '06 #2
I'm not very familiar with reflection, and I'm not sure what I should be
relecting on in this case. Here are some possibilites:

message.Method : System.Web.Services.Protocols.SoapClientMethod
// unfortunately the message.Method and message.method are
// inaccessible due to protection.
// Won't accessing these at runtime just throw FieldAccessException
// or some other Exception?
message.MethodInfo System.Web.Services.Protocols.LogicalMethodInfo
message.Client.ClientType : System.Web.Services.Protocols.SoapClientType

How do I find out whether there was a SoapRpcMethodAttribute applied to
the method (on the message.MethodInfo which is a LogicalMethodInfo)?
on its CustomAttributeProvider? or somewhere else?
or a SoapRpcServiceAttribute applied to the Serice/Class?
(Shouldn't the service attributes propogate down to the methods in
the service)?
Where do I look to see if any of these attibutes are applied?

Thanks in advance,
Martha
May 1 '06 #3
"M Borkan" <MB*****@discussions.microsoft.com> wrote in message
news:58**********************************@microsof t.com...
I'm not very familiar with reflection, and I'm not sure what I should be
relecting on in this case.
Where do I look to see if any of these attibutes are applied?


Hi Martha,

Look at the links below. I think they will help you.

[1]
http://msdn.microsoft.com/library/de...natruntime.asp

[2] http://msdn2.microsoft.com/en-us/library/a4a92379.aspx

Martin

May 2 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.