Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - Can a pre-existing SOAP tail wag the WCF dog?

 
 
Old 03-05-2007   #1 (permalink)
VermillionRaelin@gmail.com


 
 

Can a pre-existing SOAP tail wag the WCF dog?

I'm trying to map Zimbra's existing SOAP API to WCF. It's not working
out too well. Here's an edited sample of the SOAP requests that I
would like my WCF service to accept:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<userAgent name="ZimbraWebClient - FF2.0 (Win)"
version="undefined"/>
<nosession/>
<format type="js"/>
</context>
</soap:Header>
<soap:Body>
<AuthRequest xmlns="urn:zimbraAccount">
<account by="name">user1</account>
<password>test123</password>
</AuthRequest>
</soap:Body>
</soap:Envelope>

I've tried several approaches, the most promising being a
MessageContract, but it's not working out all that well. First, I
don't know if WCF is going to accept anything that doesn't have an
Action element on the header. If that's the case, it wouldn't be too
difficult to tag an Action header onto the request on Zimbra's side of
the fence. Second, I can't figure out any way, even with vanilla XML
serialization, to create a simple element with an attached attribute
(see the "account" element above). If I can't do that, then I'm
pretty well dead in the water because that pattern is all over the
API.

If I can build a service that accepts the SOAP request listed above,
it should be simple for me to repeat the pattern for the rest of the
API. Any help?


My System SpecsSystem Spec
Old 04-10-2007   #2 (permalink)
Dwight@QuickLearn


 
 

RE: Can a pre-existing SOAP tail wag the WCF dog?

The Message Contract would be your best bet here.

And yes, an Action must be applied to the Message for WCF to determine what
to do with it.

Within your Message Contract, use a custom class for your header of the
"Content" section, and use a custom class for the Body of the Message
Contract. For the Body use a custom class for the "AuthRequest" section that
uses the XmlSerializer instead of the DataContract Serializer.

In the Custom "AuthRequest" class the [XmlFormatter] attribute and apply the
name property/field as a [XmlAttribute] markup.

hth



"VermillionRaelin@gmail.com" wrote:

> I'm trying to map Zimbra's existing SOAP API to WCF. It's not working
> out too well. Here's an edited sample of the SOAP requests that I
> would like my WCF service to accept:
>
> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
> <soap:Header>
> <context xmlns="urn:zimbra">
> <userAgent name="ZimbraWebClient - FF2.0 (Win)"
> version="undefined"/>
> <nosession/>
> <format type="js"/>
> </context>
> </soap:Header>
> <soap:Body>
> <AuthRequest xmlns="urn:zimbraAccount">
> <account by="name">user1</account>
> <password>test123</password>
> </AuthRequest>
> </soap:Body>
> </soap:Envelope>
>
> I've tried several approaches, the most promising being a
> MessageContract, but it's not working out all that well. First, I
> don't know if WCF is going to accept anything that doesn't have an
> Action element on the header. If that's the case, it wouldn't be too
> difficult to tag an Action header onto the request on Zimbra's side of
> the fence. Second, I can't figure out any way, even with vanilla XML
> serialization, to create a simple element with an attached attribute
> (see the "account" element above). If I can't do that, then I'm
> pretty well dead in the water because that pattern is all over the
> API.
>
> If I can build a service that accepts the SOAP request listed above,
> it should be simple for me to repeat the pattern for the rest of the
> API. Any help?
>
>

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Tail Logfile with WMI VB Script
tail -f file | cut ...? PowerShell
head and tail in PS? PowerShell
Tail functionality? PowerShell
Re: grep, which, and tail commands? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46