Microsoft Knowledge Base Email Alertz

KBAlertz.com: This step-by-step article describes how to write a Perl SOAP::Lite client for a Web Service that is based on the Microsoft SOAP Toolkit or .NET.

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 308438 - Last Review: October 27, 2002 - Revision: 1.0

HOW TO: Integrate a PERL/SOAP Lite Client by Using a SOAP Toolkit or .NET XML Web Service

This article was previously published under Q308438

On This Page

SUMMARY

This step-by-step article describes how to write a Perl SOAP::Lite client for a Web Service that is based on the Microsoft SOAP Toolkit or .NET.

NOTE: Microsoft does not provide support for Perl.

Requirements

The following items describe the recommended hardware, software, network infrastructure, skills and knowledge, and service packs that you need:
  • Perl version 5.00503 or later
  • Microsoft SOAP Toolkit version 2.0 Service Pack 2
  • .NET Framework Software Development Kit (SDK)
  • SOAP::Lite versions 0.51 or later installed
This article assumes that you are familiar with the following topics:
  • How to set up a Perl distribution from the Comprehensive Perl Archive Network (CPAN). If the XML Web Service that you access uses complex types, you should be familiar with how Perl handles hashes.
  • How to read and understand Web Service Description Language (WSDL) files.

Edit the WSDL File

Incompatibilities exist between the SOAP::Lite WSDL reader and the WSDL generator that is provided by .NET. Specifically, the SOAP::Lite WSDL reader expects all XSD type information to be in a namespace called XSD. These incompatibilities are to be resolved in future releases of SOAP::Lite.

To edit a .NET-generated WSDL file so that it is useable by SOAP::Lite, follow these steps:

NOTE: If the WSDL was generated by the SOAP Toolkit version 2.0, this procedure is unnecessary.
  1. Obtain the WSDL file for the intended service and save it locally. With Active Server Pages (ASP) .NET, for example, you can do so by invoking the .asmx file with the "?WSDL" query string (that is, http://server/scripts/sample.asmx?WSDL). Alternatively, you can use the Disco.exe utility.
  2. Open the local copy of the WSDL file and edit the reference for the XML Namespace for xmlns:s in the definitions element. It originally resembles the following:
    xmlns:s="http://www.w3.org/2001/XMLSchema"
    You should edit it as follows:
    xmlns:xsd=http://www.w3.org/2001/XMLSchema
    					
  3. Change all instances of elements that are prefixed with s: to be prefixed with xsd:. This reflects the change that you made in step 2.
  4. Remove all elements that involve the HTTP GET and HTTP POST messages, portTypes, bindings, and service ports.

Call the Endpoint

After you have the WSDL properly formatted for SOAP::Lite, you can call the endpoint fairly simply. If the file is stored locally (as it is for a .NET endpoint), you must make sure that you are using the file:// style Uniform Resource Identifier (URI) to load the WSDL. To call a simple service that adds two numbers and prints the results, use code that resembles the following:
use SOAP::Lite;

$a = 45;
$b = 55;
print "Adding values ", $a, " and ", $b, "\n";
print SOAP::Lite
    -> service('file://c:/voices/perl/service1.wsdl')
    -> Add($a, $b);
				

Troubleshooting

Getting the WSDL set up correctly can take a little while. You may receive error messages from the SOAP::Lite module that do not seem to be related to how the WSDL is set up and parsed. It is also fairly easy to miss an element that needs to be eliminated or replaced. If this is a major concern, you can choose to not use the WSDL capabilities and make your SOAP calls more direct. When you do this, make sure to have the WSDL file and the SOAP::Lite User's Guide available for reference so that you can make sure that the correct values are passed back and forth and that they are all named correctly.

To make sure that you completely understand the WSDL setup, you can use the Mssoapt.exe tool that ships with the Microsoft SOAP Toolkit version 2.0.

REFERENCES

SOAP::Lite and the .NET XML Web Service implementations are part of a larger community driving interoperability between SOAP implementations. For more information on the current state of the interoperability testing, see the following Web site:
SOAPBuilders Interoperability Lab
http://www.xmethods.com/ilab (http://www.xmethods.com/ilab)
For more information on how to handle SOAP faults and complex types, see the user's guide on the following Web site:
SOAP::Lite for Perl
http://www.soaplite.com (http://www.soaplite.com)
For more information, see the following Web site:
CPAN
http://www.cpan.com/ (http://www.cpan.com/)







APPLIES TO
  • Microsoft SOAP Toolkit 2.0
Keywords: 
kbhowto kbhowtomaster KB308438
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please