Logging incoming XML in a .Net Web Service - web-services

I have read a few post about this (on stackoverflow as well) and cant seem to get a relevant solution.
I have a standard .NET web service that has one method as below:
[WebMethod]
public SupplyResponseMessage GetSupply(SupplyRequestMessage SupplyRequest)
{
...
}
To debug it, im using log4net writing to a log file and I want it to log the serialized SupplyRequestMessage (hoping in XML) as well, but cant seem to get access to the current HttpContext to do so. What is the recommended way to log the incoming XML that the web service deserializes to create the SupplyRequestMessage object?

SOLUTION
I found exactly what I was looking for in the SoapExtensionAttribute. Here is an article that will help anyone looking for something similar:
Efficient Tracing Using SOAP Extensions in .NET

Related

Returning Json objetcs in Chrome using ASp.Net Web Apis

I am fairly new to web API and i'm currently following this tutorial
I have only got as far as task 3 and i'm quite learning a lot.
As you can see the tutorial is using Internet Explorer and I am using Chrome .. for some reason Chrome is returning xml and IE is returning a json object. Should I worry about this or not? i'd love it if Chrome returned a Json object though..
Thank you
WebApi is pretty cool in that it will serialise it's output as JSON or XML based on the accept header sent by the browser.
I expect that Chrome's default is XML, and IE's is JSON.
I can't find a simple configuration change example for Chrome, with most information pointing to having to use a plugin to change the accept header. In Firefox the default is XML but you can adjust it with a config change.

calling web services from UNIX

I have a requirement to kickoff a workflow which is in salesforce.com thorugh web service from UNIX box. Can any one suggest me options or guide lines to achive this scenario?
I don't think you can just "kick off workflows". You'll have to perform an insert or update of records in Salesforce that will satisfy the workflow's entry criteria.
There's a Java tool called Data Loader for your basic data manipulation activities (you can download it from your own production org)
and it can be scripted for scheduled runs, has config file where you can store user's password in secure way etc. Check out the pdf guide for more ("Command Line Quick Start" chapter)
So I don't think you really need a webservice call...
Unless I misunderstood and you're talking about calling an Apex class' method that has "webservice" keyword and it will somehow perform the updates?
In that case you'll need to download the WSDL file generated for this class (Setup->Develop->Classes) and well, consume it in language of your choice (Java, PHP, Python... this link will help, steps aren't too different), then do your command line magic?
http://wiki.developerforce.com/page/Integration has tons of resources for you :)
Salesforce uses SOAP for their web service. They don't have restful web services now. Just request them to give the wsdl file.
Use this wsdl file to generate the java code. After that get their webService url so that you can proceed with your data pulling
This link may help you..
http://salesforce-walker.blogspot.in/2011/12/to-access-salesforce-data-from-java-we.html
Hope this helps

Creating a crystal report in a web service that uses XMLRPC

I have looked into everything but I think this is a unique problem. I have a web service in my website. This web service uses XMLRPC.NET but that hardly matters. i use this web service to get the string sent by the client and convert it into XML.This all is working fine. But the real problem is: I have a .aspx that uses the above written xml to generate a crystal report and save it as a PDF. The problem is I cannot call the .aspx page from my web service as response. redirect does not work. I tried writing the complete crystal report generation and PDF save logic in the web service method but it does not work because the CrystalReportViewer1.reportsource gives an error as it does not recognize the CrystalReportViewer1 in the current context. is there any way that I can do this by redirecting or by using the crystal report logic in the web service or any other way. Seems a little complicated but any help will be greatly appreciated. Please need help.
Thank You

What are good options for accessing WSDL Webservices in Groovy?

What are good options for accessing Webservices that are defined with WSDL from Groovy? I've looked at groovyws and while it appears to work ok for basic stuff I've run into issues with complex WSDL in the passed. It also appears to no longer be under active development. Are there any other good Groovy options for accessing webservices or should I just pick a Java API and call it through Groovy?
I'm currently using GroovyWS, and haven't found an alternative. If GroovyWS manages to parse the WSDL, it seems to work nicely enough. In the case where it wouldn't parse the WSDL, I switched service APIs completely.

Fetching remote database info from a client application

What would be the preferred method of pulling content from a remote database?
I don't think that I would want to pull directly from the database for a number of reasons.
(Such as easily being able to change where it is fetching the info from and a current lack of access from outside the server.)
I've been thinking of using HTTP as a proxy to the database basically just using some PHP to display raw text from the database and then grabbing the page and dumping it to a string for displaying.
I'm not exactly sure how I would go about doing that though. (Sockets?)
Right now I am building it around a blog/news type system. Though the content would expand in the future.
I've got a similar problem at the moment, and the approach I'm taking is to communicate from the client app with a database via a SOAP web service.
The beauty of this approach is that on the client side the networking involved consists of a standard HTTP request. Most platforms these days include an API to perform basic HTTP client functions. You'll then also need an XML or JSON parser to parse the returned SOAP data, but they're also readily available.
As a concrete example, a little about my particular project: It's an iPhone app communicating with an Oracle database. I use a web service to read data from the database and send the data to the app formatted in XML using SOAP. The app can use Apple's NSURLConnection API to perform the necessary HTTP request. The XML is then parsed using the NSXMLParser API.
While the above are pretty iPhone-specific (and are Objective-C based) I think the general message still applies - there's tools out there that will do most of the work for you. I can't think of an example of an HTTP API offhand, but for the XML parsing part of the equation there's Xerces, TinyXML, Expat...
HTH!
You might look at using AJAX (I recommend JSON instead of XML though). This is the technology underlying Google Maps.