Aleksandar's computer workshop
Let's see what Aleksandar was fixing today.
My findings, tips & tricks related to computers, internet, programming and other stuff I was working with.

Solving problems with the MS header "SOAPAction"

June 8, 2009 23:45 by Aleksandar

Today I have faced some errors during implementation of some 3rd party SOAP service. Proxy was made with received WSDL file using this command:

"c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\wsdl.exe" /language:VB  /protocol:SOAP /namespace:testNamespace sampleservice.wsdl /server

Command above will convert WSDL file to ASMX server proxy class file.

After first test I got this error:

The methods testMethod1 and testMethod2 use the same SOAPAction ''. When the RoutingStyle of the XML Web service is SoapAction, SOAPAction values must be unique across methods on the XML Web service. You can change the SOAPAction with the Action parameter to the SoapDocumentMethod or SoapRpcMethod attributes, or you can specify a RoutingStyle of RequestElement on the XML Web service.

In order to fix this problem add line marked with bold green color in class definition:

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42"), _
System.Web.Services.Protocols.SoapDocumentService(RoutingStyle:=SoapServiceRoutingStyle.RequestElement), _
System.Web.Services.WebServiceAttribute([Namespace]:="testNamespace"), _
System.Web.Services.WebServiceBindingAttribute(Name:="TestSoapBinding", [Namespace]:="testNamespace")> _
Public Class testWebService

' your class code comes here 

End Class


How to debug HTTP requests when developing and testing Web applications and clients

June 4, 2009 16:33 by Aleksandar

Have you ever found yourself wondering how browser interacts with your Web application? Have you encountered a strange performance bottleneck that you can't track down? Are you curious about which cookies are being sent, or what downloaded content is marked as cacheable?

In Web and Internet development you are unable to see directly what is being sent and received between your web browser / client and the server. Without this visibility it is difficult and time-consuming to determine exactly where the fault is.

Don’t give up, there are some applications to help you out.

On developers computer (client side) you will go for HTTP proxy like Fiddler or Charles.
For server debugging (in most situations) you can't use proxy. In that case you have to use network packet sniffer or network protocol analyzer like Wireshark (used to be known as Ethereal)

About Fiddler

Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, can be extended using any .NET language and has ready powerful extensions.

Fiddler is freeware and can debug traffic from virtually any internet application, including Internet Explorer, Mozilla Firefox, Opera, and thousands more.

It will run only on Windows.

http://www.fiddler2.com/




About Charles

Charles is a web proxy (HTTP Proxy / HTTP Monitor) that runs on your own computer. Your web browser is then configured to access the Internet through Charles, and Charles is then able to record and display for you all of the data that is sent and received.

Charles makes debugging quick, reliable and advanced; saving you time and frustration!

Key Features

  • SSL Proxying – view SSL requests and responses in plain text
  • Bandwidth Throttling to simulate slower Internet connections including latency
  • AJAX debugging – view XML and JSON requests and responses as a tree or as text
  • AMF – view the contents of Flash Remoting / Flex Remoting messages as a tree
  • Repeat requests to test back-end changes
  • Edit requests to test different inputs
  • Breakpoints to intercept and edit requests or responses
  • Validate recorded HTML, CSS and RSS/atom responses using the W3C validator

It is shareware, and you may try Charles for 30 days.

It will run on Windows, Mac OS X and Linux/Unix.

http://www.charlesproxy.com/


About Wireshark

Wireshark is the world's foremost network protocol analyzer, and is the de facto (and often de jure) standard across many industries and educational institutions.
Network professionals, security experts, developers, and educators around the world use it regularly.
It is freely available as open source, and is released under the GNU General Public License version 2.
It is developed and maintained by a global team of protocol experts, and it is an example of a disruptive technology.
Wireshark used to be known as Ethereal. If you're still using Ethereal, it is strongly recommended that you upgrade to Wireshark.
Wireshark development thrives thanks to the contributions of networking experts across the globe. It is the continuation of a project that started in 1998.

Wireshark has a rich feature set which includes the following:

  • Deep inspection of hundreds of protocols, with more being added all the time
  • Live capture and offline analysis
  • Standard three-pane packet browser
  • Multi-platform: Runs on Windows, Linux, OS X, Solaris, FreeBSD, NetBSD, and many others
  • Captured network data can be browsed via a GUI, or via the TTY-mode TShark utility
  • The most powerful display filters in the industry
  • Rich VoIP analysis
  • Read/write many different capture file formats: tcpdump (libpcap), Pcap NG, Catapult DCT2000, Cisco Secure IDS iplog, Microsoft Network Monitor, Network General Sniffer® (compressed and uncompressed), Sniffer® Pro, and NetXray®, Network Instruments Observer, NetScreen snoop, Novell LANalyzer, RADCOM WAN/LAN Analyzer, Shomiti/Finisar Surveyor, Tektronix K12xx, Visual Networks Visual UpTime, WildPackets EtherPeek/TokenPeek/AiroPeek, and many others
  • Capture files compressed with gzip can be decompressed on the fly
  • Live data can be read from Ethernet, IEEE 802.11, PPP/HDLC, ATM, Bluetooth, USB, Token Ring, Frame Relay, FDDI, and others (depending on your platfrom)
  • Decryption support for many protocols, including IPsec, ISAKMP, Kerberos, SNMPv3, SSL/TLS, WEP, and WPA/WPA2
  • Coloring rules can be applied to the packet list for quick, intuitive analysis
  • Output can be exported to XML, PostScript®, CSV, or plain text  

It runs on Windows, OS X, Linux and UNIX

http://www.wireshark.org/

 

 

 


Delete a Team Project from Team Foundation Server

May 22, 2009 20:09 by Aleksandar

How do you delete a team project that you don't need anymore?  It certainly isn't possible through the Team Explorer user interface. 

Answer: go to the command prompt and use “TfsDeleteProject.exe“. 

Example:

c:
cd c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\
TfsDeleteProject /server:<SERVER NAME> “Project Name“

 


Tags: ,
Categories: Programming
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Certificate Signing Request (CSR) Generation Instructions with OpenSSL on Windows

April 17, 2009 19:55 by Aleksandar

To generate a CSR, you will need to create a key pair for your server. These two items are a digital certificate key pair and cannot be separated. If you lose your public/private key file or your password and generate a new one, your SSL Certificate will no longer match. You will have to request a new SSL Certificate and may be charged.
 
Step 1: Generate a Key Pair

The utility "openssl" is used to generate the key and CSR. You can download the binary from here
http://www.openssl.org/related/binaries.html
http://www.slproweb.com/products/Win32OpenSSL.html
 
Type the following command at the prompt:

openssl genrsa -des3 -out www.gsmblog.com.key 1024

Note: For Extended Validation certificates the key bit length must be 2048.
 
This command generates a 1024 bit RSA private key and stores it in the file www.gsmblog.com.key.
 
When prompted for a pass phrase: enter a secure password and remember it, as this pass phrase is what protects the private key. Both the private key and the certificate are required to enable SSL.
 
NOTE: To bypass the pass phrase requirement, omit the -des3 option when generating the private key.
If you leave the private key unprotected, access to the server should be restricted so that only authorized server administrators can access or read the private key file.


 
Step 2: Generate the CSR
 
Type the following command at the prompt:

openssl req -new -key www.gsmblog.com.key -out www.gsmblog.com.csr 



This command will prompt for the following X.509 attributes of the certificate:
 
Country Name: Use the two-letter code without punctuation for country, for example: NL, DE or US.
 
State or Province: Spell out the state completely; do not abbreviate the state or province name, for example: Flevoland
 
Locality or City: The Locality field is the city or town name, for example: Amsterdam. Do not abbreviate. For example: Saint Louis, not St. Louis
 
Company: If your company or department has an &, @, or any other symbol using the shift key in its name, you must spell out the symbol or omit it to enroll. Example: XY & Z Corporation would be XYZ Corporation or XY and Z Corportation.
 
Organizational Unit: This field is optional; but can be used to help identify certificates registered to an organization. The Organizational Unit (OU) field is the name of the department or organization unit making the request. To skip the OU field, press Enter on your keyboard.
 
Common Name: The Common Name is the Host + Domain Name. It looks like www.gsmblog.com or "gsmblog.com".
 
Certificates can only be used on Web servers using the Common Name specified during enrollment. For example, a certificate for the domain "domain.com" will receive a warning if accessing a site named "www.domain.com" or "secure.domain.com", because "www.domain.com" and "secure.domain.com" are different from "domain.com".
 
Please do not enter your email address, challenge password or an optional company name when generating the CSR.
 
A public/private key pair has now been created. The private key (www.gsmblog.com.key) is stored locally on the server machine and is used for decryption. The public portion, in the form of a Certificate Signing Request (certrequest.csr), will be for certificate enrollment.
 
To copy and paste the information into the enrollment form, open the file in a text editor such as Notepad and save it as a .txt file. Do not use Microsoft Word as it may insert extra hidden characters that will alter the contents of the CSR.



Once the CSR has been created, proceed to Enrollment.
 
Step 3: Backup your private key
 
Backup up the .key file and the corresponding pass phrase. A good choice is to create a copy of this file onto a diskette or other removable media. While backing up the private key is not required, having one will be helpful in the instance of server failure.