Environment versions
Network:
Windows Server 2012
Long time ago I had to work with an AXXIS WS, which had specific auth tokens embedded in the header and would barf if not following some additional rules automatically followed if generated via the AXXIS-Java tool chain. Worked, but afterwards had to change twice as AXXIS developed, as their implenentation developed. Too many standards...
>You can also use SOAP headers for this. But again - quite awkward to implement.
>
>+++ Rick ---
>
>>>What are you using for your Web Service? ASMX or WCF?
>>
>>ASMX
>>
>>>Both mechanisms support methods you can implement on the service to inject custom data into the document. It's not trivial and you'd have to inspect each response to decide whether you need to actually inject. You can't just put XML at the top of the page (or end) because as you found out that produces invalid XML - the XML has to become part of the XML document. Typically in SOAP this is done with custom SOAP Headers. You can effectively define a custom SOAP Header and then set that header for the requests that need it.
>>
>>I suspected that.
>>
>>>It's been a long while since I looked at this and it's ugly. Really what you should do is add that functionality to the main SOAP envelope and the payload you're sending. A common way to do this is a common Request and Response object structure that includes message specific objects (like hasErrors,errorCode, etc.) which then has a content element into which you push your actual result data. It's a pretty common service pattern that works really well. You basically create a base ResponseMessage object and you can then subclass that to add the custom result properties that you need to actually return to the client. Most enterprise systems use a variation of this message based service style.
>>
>>I have all that. This is as is for regular Web Service method handlers. But, for as long as I am not in the Web Service method, thus at a very high level, I have one specific place which I need to intercept, based on a very rare condition, the request and return a custom message.
>>
>>I have a SOAP trace extension which might be useful for that. I will have to do more research on this.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only