ASP.NET WebService is Wrapping my JSON response with XML tags

In your code, don’t “return” the json. Use instead: Context.Response.Write(ser.Serialize(jsonData)); Then you’ll be good. The regular return command helps you by putting in a more proper service format. Some would say it’d be better form to use this, and unwrap your json on the client from this format. I say, just spit down the stuff … Read more

How to get the X509Certificate from a client request

this is how we do this in the constructor of our webservice: if (OperationContext.Current.ServiceSecurityContext.AuthorizationContext.ClaimSets == null) throw new SecurityException (“No claimset service configured wrong”); if (OperationContext.Current.ServiceSecurityContext.AuthorizationContext.ClaimSets.Count <= 0) throw new SecurityException (“No claimset service configured wrong”); var cert = ((X509CertificateClaimSet) OperationContext.Current.ServiceSecurityContext. AuthorizationContext.ClaimSets[0]).X509Certificate; //this contains the thumbprint cert.Thumbprint

Add SoapHeader to org.springframework.ws.WebServiceMessage

Basically, you need to use a WebServiceMessageCallback in your client to modify the message after its creation but before it is sent. To rest of the code has been described pretty accurately by @skaffman so the whole stuff might look like this: public void marshalWithSoapActionHeader(MyObject o) { webServiceTemplate.marshalSendAndReceive(o, new WebServiceMessageCallback() { public void doWithMessage(WebServiceMessage message) … Read more