![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| 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 | |||