Contacts

Testing web services. SOAP API testing. Different XSD formats -

Using the program Web Services. Validation Tool for WSDL and SOAP

Apparently, with the arrival of new technologies and standards, such as XML and HTTP, Web services provided their place in the pantheon of Internet innovation. But how did this innovation arise?

The main concept of Web services can be traced in the United States until the mid-1960s. In the transport industry, for example, in railway and shipping companies, a new concept for exchanging electronic data between computers, developed further to EDI technology (Electronic Data Interchange - exchange of electronic data) was presented. For the first time I heard about EDI from Professor of a Business School in 1980.

In 1996, the National Institute of Standards and Technologies of the United States announced the standard for EDI in the Federal Information Processing Standards Publications (FIPS PUB 161-2). According to the published specification, EDI is the standard of sharing strictly formatted messages between computers. Processing received messages is carried out only with a computer, and these messages are usually not intended to be interpreted by a person. This is exactly what Web services are engaged in, except that in the mid-1960s did not exist XML, the Internet and the World Wide Web.

For those who are not very familiar with Web services, I will briefly consider the definitions and main components of Web services.

What are Web services

Web service is software systemDesigned to support intermasket interactions between network computing resources and using SOAP messages (Simple Object Access Protocol) defined by the WORL WIDE WEB CONSORTIUM consortium.

Simple Object Access Protocol (SOAP) is a simple expandable protocol for which the shared and typed messaging is exchanged in a decentralized, distributed network environment. SOAP messages are recorded in an Extensible Markup Language (XML) language format - simple and flexible text format taking start from Standard Generalized Markup Language (SGML), which was developed by the International Organization for Standardization Organization (ISO 8879: 1986).

Web Services Description Language (WSDL) is based on XML Languagewhich describes the interface of Web services.

What happens when exchanging erroneous SOAP messages? What would happen if the erroneous SOAP message was processed without warning and was even used to generate information designed to make a decision?

In practice it is impossible to say, correctly or no data in the SOAP message. However, you can check the SOAP message to correctly, viewing its interface definition or WSDL.

In real life, debug problems in SOAP messages is very difficult. If there is some error in the SOAP message, the HTTP response code 500 is received from the Web service server. Web service servers do not provide detailed information about which part of the SOAP message there is a problem. You can encounter even the worst situation when correct SOAP answers are accepted from the Web service server without any error messages, and neither you nor your Web service servers can understand the problems in your SOAP queries and answers. For example, you wanted to request the current stock quotes of the company B, but sent a SOAP message to the Web service server with incorrectly written tags. The Web service server can ignore the wrong tags and provide the default value in the response SOAP message, for example, the company's stock quotation. If it remains unnoticed, the consequences may be disastrous.

Problems of this type can be prevented in advance with web tool Services Validation Tool for WSDL and SOAP. It allows you to verify the correctness of SOAP messages using the Web Service Definition Language language (WSDL), even before deploying applications using Web service. The program analyzes the syntax and correctness of your SOAP messages with WSDL and indicates problems, reporting in detail about errors and lines. As a result, you will no longer receive annoying messages HTTP 500. Are your SOAP messages encrypted? No problems. The program decides them and check for you the correctness of the decrypted SOAP messages.

This program was created to help employees of IBM Web Services Support, decisively related to Web service problems on the IBM® WebSphere Application Server, which are reported by customers from around the world. The program is designed to verify the correctness of SOAP messages. If the SOAP message has a digital signature, the program will check it. Using Web Services Validation Tool for WSDL and SOAP, you can even send SOAP messages to Web services servers and receive response SOAP messages. The program was created in order to eliminate the problems in industrial operation through its use in the early stages of development, as well as in order to reduce the time to solve problems arising during operation.

We will create a very simple web service. First we will create a simple Java ™ expand. After checking the Java application, we use IBM Rational® Application Developer for WebSphere® Software will generate a Web service. Then we make some changes to the generated Web service. Finally, we use Web Services Validation Tool for WSDL and SOAP to create, check, transmit and receive SOAP messages.

Simple Web service can be created using the IBM Rational Application Developer for WebSphere Software program. Web services can be created in two ways:

  1. Development "top down" (TOP-DOWN) Development in which Java classes implementing Web services are generated from WSDL.
  2. Development "bottom-up" (Bottom-Up), in which the Web service is generated from the Java Bean component or corporate Java Bean component.

In the following example, we implement Web service using the development method from the bottom up. First we will create a simple Java application. Then we will generate the Java Bean component Web service from the Java application using the IBM Rational Application Developer for WebSphere Software program.

Creating a java application

First we will create a Java application, an outstanding greeting. If the name is not specified, the application will return the text "Hello, Buddy!". If the name is specified, the application will return the text "Hello," followed by this name. Below is the Java application code of the DemowebService located in the demo package. The Hello () method returns a string dependent on behalf.

Listing 1. DemowebService.java.
/ * * @Author: Jinwoo Hwang * Copyright 2010 IBM Corporation * / Package Demo; Public Class DemowebService (String Name) (iF (Name \u003d\u003d NULL) Return "Hello, Buddy!"; Else Return "Hello," + Name + "!";))

Java application testing

It is very important to test the Java application before creating a Web service from it. To start the application, you can write a class with the Main () method. You can also use the functionality of Universal Test Client provided by the IBM Rational Application Developer V7 product for quick testing without writing a test code. It is enough just to select Universal Test Client from the context menu of the Java class to start Test Client.

  1. In Universal Test Client Expand Objects\u003e DemowebService..
  2. Select the method hello..
  3. Enter a string or your name in the field Value and click Invoke.

You can also perform a test by specifying the NULL parameter, and see what happens. If the NULL parameter is transmitted to the Hello () method, the string "Hello, Buddy!" Is returned, as expected.


Creating a Web Service

While everything works well. We will proceed to generating a Web service from Java class using the method of developing Web services from bottom to top.

  1. Select the DemowebService Java application and create a new Web service from IBM Rational Application Developer.

  1. Since we have created a Java class, select Bottom Up Java Bean Web Service In the WEB Service Type list. Choose Start Client. and click FINISH. If we had an EJB class, we could also write an EJB component to generate a Web service.

If everything went fine, you will see in Java Resources next to the DemowebService.java generated by DemowebServiceDelegate.java.


When viewing DemowebServiceDelegate.java, you can find the Java Web service @ javax.jws.Webservice annotation, which specifies targetnamespace, servicespaneame and portname in the DemowebServiceDelegate class. An instance of the DemoweBService is created and the DemoweBService method is created by another Hello () method. If you wish, learn more about Java Web services annotations refer to the Java Specification Request (JSR) document 181. Web service metadata for the Java platform.

Listing 2. DemowebServiceDelegate.java.
/ * * @Author: Jinwoo Hwang * Copyright 2010 IBM Corporation * / Package Demo; @ Javax.jws.WebService (targetNamespace \u003d "http: // demo /", serviceName \u003d "DemoWebServiceService", portName \u003d "DemoWebServicePort") public class DemoWebServiceDelegate (demo.DemoWebService _demoWebService \u003d new demo.DemoWebService (); public String hello ( String Name) (Return _demowebService.Hello (Name);))

Creating WSDL.

In project client program You can also find that the DemowebServiceService.wsdl and DemoweBServiceService_schema1.xsd files have been generated. DemowebServiceService.wsdl contains information in the Web Service Definition Language language describing network Services For the Java application created earlier. DemowebServiceService_schema1.xsd contains an XML schema describing the data type structure used in SOAP messages.


When viewing the DemowebServiceService.wsdl file, you can see that it has a set of definition elements (Definitions Element). The definition elements have 6 elements:

  • types (types);
  • message (message);
  • porttype (port type);
  • binding (binding);
  • service (service);
  • port.

Types. Defines the types of data used when exchanging messages. In DemoweBServiceService.wsdl, we import the DemowebServiceService_schema1.xSD instead of determining the data types in the WSDL file.

Message. Defines messages, exchange that occurs. We have 2 posts: "Hello" and "Helloresponse". The Hello message has a part called "Parameters". This part has the element "TNS: Hello". The Helloresponse message has a part called "Parameters", which is similar to Hello. This part has the element "TNS: Helloresponse". Hello and Helloresponse elements are defined in the DemowebServiceService_schema1.xSD file. We will soon consider them.

Port Type - Supported terminal points of operation. Each operation provides input and output messages. Our Operation "Hello" consists of the input message "TNS: Hello" and the output "TNS: Helloresponse". These operations correspond to the exchange of the request-answer. WSDL provides 4 different exchange primitive for the endpoint:

  • one-way (unidirectional);
  • request-Response;
  • solicit-Response (Require-answer);
  • notification.

With unidirectional exchange, the terminal point only receives a message. When exchanging the "query-response", the endpoint accepts the message and sends the appropriate message. When using the "Require-Answer" exchange, the endpoint sends the message and accepts the appropriate message. When exchanging the "Notification" terminal point only sends a message.

Binding Defines the details of the protocol and the message format specification for operations and messages defined by the port type. For the Style attribute, we use the Document value. The Style attribute provides 2 different message styles: RPC and Document. The RPC style message contains parameters and returned values. Document style messages contain documents. The TRANSPORT attribute indicates the URI for the transportation of SOAP. The specified value http://schemas.xmlsoap.org/soap/http means that HTTP binding will be used in the SOAP specification. URI for the SOAPACTION HTTP header for HTTP binding SOAP is specified in the SoapAction attribute. Since the SOAP HTTP binding is used, the SOAPACTION attribute value is mandatory. For the SOAPACTION attribute, we use an empty string "". The SOAP: Body element determines how the parts of the message inside the BODY SOAP message element are composed. The use attribute provides 2 different options: Literal (literal) and Encoded (encoded). We use Literal. This means that we have chosen the definition of a specific scheme using either the type attribute or item. When using the Encoded version, ABSTRACT type is used with coding rules.

Service. Determines the set of ports used.

Port. Defines the terminal dope of communication by specifying the network address for binding.

network address for binding. In our case, the SOAP endpoint address is http: // LocalHost: 9081 / HelloWorLDWSProject / DemowebServiceService.

Listing 3. DemowebServiceService.wsdl

Creating a scheme

We import DemowebServiceService_schema1.xsd from DemowebServiceService.wsdl. Consider the file demowebserviceservice_schema1.xsd. It is written in the definition language XML Schema to describe the structure and restrictions of the contents of XML documents. We have 2 elements: Hello and Helloresponse. Each element is type. The Hello type has an "arg0" element, which is a string. The "arg0" element is optional, since the MINOCCURS attribute value in its ad is equal to 0. If the MINOCCURS attribute is set to 1 or more, the item must be specified. The same applies to the "Return" element in the Helloresponse type.

Listing 4. DemowebServiceService_schema1.xsd.

Getting Started with Web Services Validation Tool for WSDL and SOAP Program

So, we looked at WSDL and the scheme. Let's start the Web service server so that you can activate the Web service from Web Services Validation Tool for WSDL and SOAP.

To start the Web Services Validation Tool for WSDL and SOAP, the Java 6 (or above) and the digital encoding API and the XML decoding API corresponding to the WORLD WIDE WIDE Web Consortium Consortium specifications "XML Encryption Syntax and Processing" (http: // www are required. w3.org/tr/xmlenc-core/).

IBM Java 6 provides JSR 106 implementation: XML Digital Encryption Apis. If you have installed IBM Java 6 system, it means everything is ready for work and install nothing more.

If in your Java 6 execution time, for example, Sun Microsystems ™ Java 6, no XML Digital Encryption APIS, you need to install libraries implementing JSR 106, or Apache ™ XML Security Version 1.4.3 package, which can be downloaded at http: / /santuario.apache.org/. It is enough just to download a binary distribution, unzip it into the directory and specify the instrumental program where this directory is located using the command line parameters -vmargs and -daxs.

At the time of writing this article, the Web Services Validation Tool for WSDL and SOAP supported JSR 106 and Apache XML Security Version 1.4.3 for XML Digital Encryption and Decryption. If you want to check digital signatures in SOAP messages, you need libraries implementing JSR 105: XML Digital Signature Apis. Fortunately, the Java 6 virtual machines from Sun Microsystems and IBM provide implementations of JSR 105. That is why Java 6 was chosen as minimum requirements By java execution time. If your Java 6 environment does not provide libraries implementing JSR 105, you need to find them.

WEB SERVICES VALIDATION TOOL FOR WSDL AND SOAP program can be downloaded for free. Installing it is very simple. Unzip the package to the directory and run wsvt.exe. If yours virtual machine The default Java is not a Java 6 environment that supports XML digital signatures and digital encryption and decryption, you must specify the location of Java 6 with the -VM parameter, for example:

wSVT -VM C: \\ IBMJAVA6 \\ Bin \\ java.exe

Again, if you have IBM Java 6, you do not need anything else. All you need already enabled in IBM Java 6. When using Java 6 from Sun Microsystems, you must specify the program location Apache XML Security to decrypt encrypted SOAP messages.

For example, the following command will launch a program with Sun Java 6 and Apache XML Security Library Version 1.4.3, located in the C: \\ XML-Security-1_4_3 \\ LIBS directory:

wSVT -VM C: \\ Sunjava6 \\ Bin \\ java.exe -vmargs -daxs \u003d C: \\ XML-Security-1_4_3 \\ LIBS

Below is a list of the Apache XML Security library files that are actually used by Web Services Validation Tool for WSDL and SOAP, although Apache XML Security Version 1.4.3 comes with 9 JAR files:
Commons-Logging.jar;
serializer.jar;
xalan.jar;
XMLSEC-1.4.3.jar.

In Manifest.mf Web Services Validation Tool for WSDL and SOAP programs are as follows:
Bundle-ActivationPolicy: Lazy.
Bundle-Classpath: .,
EXTERNAL: $ AXS $ / Commons-Logging.jar,
EXTERNAL: $ AXS $ / Serializer.jar,
EXTERNAL: $ AXS $ / xalan.jar,
EXTERNAL: $ AXS $ / XMLSEC-1.4.3.jar

That is why it was necessary to specify -vmargs -DaxS \u003d C: \\ XML-Security-1_4_3 \\ LIBS so that the Sun Java 6 environment is decrypted encrypted SOAP messages.

I spent quite a lot of time to eliminate classes and incompatibilities to connect to XML classes that are in the Sun Java execution time environment, Apache XML Security and some Eclipse plugins. Setting up the IBM Java execution time environment has passed without difficulty, since this environment comes with the implementation of JSR 106 and does not require Apache XML Security.

Project creation

Now, after setting up and running instrumental program, You can create a new project. The project may contain a WSDL file, several schema files associated with WSDL file, and SOAP messages in XML files. If there are several WSDL files in the project, only one of them is used, while others are ignored when checking the correctness of the XML file SOAP message. To use another WSDL file, you need to create a separate project. Each SOAP message must be contained in a file with extension.xml, otherwise it will not be considered as a SOAP message.

  1. Right-click and select NEW\u003e Project..

  1. Choose Project. in GENERAL.

  1. Enter "Test Project" in the field Project Name. and click FINISH.

Import WSDL and Schemes

We created the project "Test Project". Now you can import WSDL and XSD.

  1. Select a project, and then from the context menu, select Import.

  1. Choose File System. in GENERAL.

  1. Select a directory in which WSDL and XSD are stored.
  2. Select 2 files (DemowebServiceService.wsdl and demowebserviceservice_schema1.xsd) and click FINISH.

WSDL Overview and Schemes

Now we have a project with WSDL and XSD. You can double-click the left-click WSDL to view WSDL in Design mode and Source ( source). In Design mode, you can visualize Web service with input and output data.


In Source mode, you can view and edit WSDL in a text editor.


If XSD files cannot be opened in the XSD editor, you can open them in the XML editor by selecting Open With\u003e Xml Editor In the context menu of this XSD file.


We opened DemowebServiceService_schema1.xsd in the XML editor.


Creating a SOAP message

So, we have a WSDL and a scheme ready to verify the correctness of SOAP messages. We will proceed to test the Web Services Validation Tool for WSDL and SOAP program with a SOAP message. You must enable the SOAP message to the project. The SOAP message must be contained in the file with extension .xml so that it can be verified correctly.

  1. Choose New\u003e Xml. To create SOAP messages in the project.

  1. Choose Test Project. For the parent folder of the new SOAP message. If the file is not yet selected, enter "demosoapmessage.xml" in the field File Name. and click FINISH.

The program automatically calls an XML editor with a new XML file. It has nothing but a string with a version and an XML encoding. It is good that we have at least something before the creation of the SOAP message from scratch. Do you know how to make a SOAP message? Do not worry. In the next section, we will consider the action to create it in steps.


To create a SOAP message, you can activate the "Hello" service using the parameter "Parameters" with the indication of my name - "Jinwoo". Of course, you can use your own name. Used the namespace http: // demo /. Be careful - it is written as http: // demo /, not http: // demo, it is essential.

Listing 5. HelloWorldSoapMessage.xml
Jinwoo.

Do you see this SOAP message problem? If yes, do not worry. We will deal with this later.


SOAP messaging

Are you ready to send a message to the Web service server?

  1. Select SOAP message and select

  1. In the Transmit SOAP Request and Receive SOAP Request and Receive SOAP Response window you can fill out Service Address, SOAPACTION and Content-Type.. In this application, we do not need to specify SoapAction, since we used an empty string "" for the SoapAction attribute in the section of the DemowebServiceService.wsdl file.
  2. Enter http: // Localhost: 9081 / HelloWorldwsproject / DemowebServiceService in the field Service AddressIf the server runs on the local computer on the LocalHost: 9081 port. Otherwise, you must enter the real address to which Web service is available.
  3. Choose text / Html. For field Content-Type..
  4. Press the button OK. To send SOAP messages to the server.

Receive SOAP messages

If the server is configured and running, you must get a SOAP response. If the answer does not come, check the correctness of the address and the type of content.


Checking the correctness of the SOAP message

Excellent! We accepted a SOAP response. It also persists in the project. But wait. Do you see something wrong? We got "Hello, Buddy!" Instead of "Hello, Jinwoo!". Something went wrong? Do not have a concept?

Unfortunately, the Web service server did not allow us to know what was wrong. No warnings. The situation when unpredictable SOAP responses are sent and the Web service server does not have the concept that it does not happen, can be very dangerous. Even the recipients of SOAP responses may not notice problems in the SOAP message under consideration.

WEB SERVICES VALIDATION TOOL FOR WSDL AND SOAP tool allows you to determine what is happening not so.

Listing 6. Answer
Hello, Buddy!
  1. Select a response SOAP message and click Validate..

WEB SERVICES VALIDATION TOOL FOR WSDL AND SOAP has found an error in the SOAP message.

INVALID SOAP Message: CVC-Complex-Type.2.4.a: Invalid Content Was Found Starting with Element "Parameters". One of "(arg0) is expeded.

Editing SOAP messages

  1. The program complains about the value "Parameters". Change it to Arg0 and save.
Listing 7. Changed SOAP message
Jinwoo.
  1. Check the correctness of the modified response SOAP message. No more error messages appear.

  1. Now we are ready to send a modified response to the server. Select SOAP message and then select Transmit SOAP Request and Receive SOAP Response.

  1. In the Transmit SOAP Request and Receive SOAP Response window, enter HTTP: // Localhost: 9081 / HelloWorLDWSProject / DemoweBServiceService in the field Service AddressIf the server runs on the LocalHost: 9081 port.
  2. Choose text / Html. For field Content-Type. and click OK..

This time, as expected, the correct answer comes.


Listing 8. SOAP response
Hello, Jinwoo!

Detection of improper namespace

What happens if you send a message with incorrect namespace?

  1. Change the namespace on http: // demo2 / save the message.

Listing 9. Change namespace
Jinwoo.
  1. You can then send a request to the server.

You will see an exceptional situation IOException: Server Returned HTTP Response Code: 500 for URI: http: // Localhost: 9081 / HelloWorldwsproject / DemowebServiceService.


The Web service server passed in response information about exceptional situation IOexception, but this information is not enough to detect an error. Check the correctness of the message using the tool program if you want to get more detailed data to solve the problem.


The program reports: "Invalid SOAP Message: CVC-COMPLEX-Type.2.4.a: Invalid Content Was Found Starting with Element 'NS0: Hello". One of "(" http: // demo / ": Hello," http: // demo / ": Helloresponse)" IS EXPECTED ".

This message indicates that the value is expected http: // demo /. It is this, and not an HTTP response code 500, we need to know.


Checking the correctness of encrypted SOAP messages

What if your SOAP messages are encrypted? No problem if you have keys and passwords. Just select the SOAP message and Validate. Just as this is done for any other ordinary SOAP messages. If your SOAP message is encrypted, a request appears on the screen similar to that shown in Figure 35.


At the time of this writing, 3 types of key stores are supported:

  1. Java Key Store (JKS).
  2. Java Cryptography EXTENSION KEY STORE (JEKS).
  3. Personal Information Exchange Syntax Standard (Public Key Cryptography Standards # 12).

You must provide information about your key store: File name, File type and password. If the information is correct, you must select the key and password. You can also find information about your key storage and key list and certificates in key store, for example, the key storage type, provider name, provider version, provider information, key type, creation type, certificate type, algorithm, and format.


If all the information is correct, the program will generate an decrypted SOAP message and check its correctness.


The following encryption algorithms are currently supported:

  • Advanced Encryption Standard (AES) in Cipher Block CHaining mode (CBC) with initialization vector (128/192/256 bits).
  • Advanced Encryption Standard (AES) KEY ENCRYPTION (128/192/256 bits).
  • Triple Data Encryption Algorithm Modes of Operation (Triple-des) KEY ENCRYPTION.
  • Triple Data Encryption Algorithm Modes of Operation (Triple-Des) Key Encryption in Cipher Block Chaining mode (CBC).
  • RSA CRYPTOGRAPHY SPECIFICATIONS VERSION 1.5.
  • RSA Optimal Asymmetric Encryption Padding (OAEP) is a method with a mask generation function.

Checking the correctness of SOAP messages with a digital signature

What if your SOAP message has a digital signature? Just select the SOAP message and then select SOAP Message Digital Signature Verification.


If a digital signature Correct, you will see the following screen:


Otherwise, the program will report an error in the signature. The following specifications and digital signature algorithms are currently supported:

  • Secure Hash Algorithm 1 (SHA-1)
  • Hash Message Authentication Code (HMAC)
  • Digital Signature Algorithm (DSA)
  • Public-Key Cryptography Standards (PKCS # 1)
  • RSA Encryption Algorithm With Secure Hash Algorithm (SHA-1)
  • Canonical XML Version 1.0 and 1.1
  • XSL Transformations (XSLT) Version 1.0
  • XML Path Language (XPath) Version 1.0
  • Base64.

Access to the US National Mete Catering Service using SOAP messages

Created and tested by us simple Web service is working fine. Can be used this program In the "real" environment? You can try to work with the real US National Web service provided by the U.S. National Oceanic and Atmospheric Administration (NOAA).

  1. Create a project.

  1. Create an XML SOAP message code.


The US National Mete Working provides many different Web services. You can try to work with the NDFDGENBYDAY service, which provides weather forecasts for a point with a given latitude and longitude.

To access NDFDGENBYDAY, you must provide the following information:

Table 1. NDFDGENBYDAY.
Service Name (Service Name)Ndfdgenbyday
ENDPOINT (terminal)http://www.weather.gov/forecasts/xml/soap_server/ndfdxmlserver.php.
SOAPACTION (SOAP-ACTION)http://www.weather.gov/forecasts/xml/dwmlgen/wsdl/ndfdxml.wsdl#ndfdgenbyday
encodingStyle (coding style)http://schemas.xmlsoap.org/soap/encoding/
Namespace (namespace)http://www.weather.gov/forecasts/xml/dwmlgen/wsdl/ndfdxml.wsdl
latitude (latitude)Decimal number
lONGITUDE (longitude)Decimal number
startDate (initial date)date
numdays (number of days)Integer
format (format)Line

In this example, we want to create a SOAP request to receive a weekly forecast for the locality with coordinates (LAT38.9, LON-77.01), starting from 2010-07-23 in 24-hour format:

Listing 10. SOAP request
38.99 -77.01 2010-07-23 7 24 Hourly.

We did not indicate the namespace, because the service worked without it. If any problems arise with the namespace, set it.


Select the message I. Transmit SOAP Request and Receive SOAP Response In Web Services Validation Tool for WSDL and SOAP.

Table 2. Information request
NameValue
ENDPOINT (terminal) http://www.weather.gov/forecasts/xml/soap_server/ndfdxmlserver.php.
SOAPACTION (SOAP-ACTION) http://www.weather.gov/forecasts/xml/dwmlgen/wsdl/ndfdxml.wsdl#ndfdgenbyday
CONTENT-TYPE (content type)text / xml; Charset \u003d UTF-8

Now the projection data has become much easier to read.


If this advice will seem not too convenient to you, you can use your own HTML formatting method. Most Web services offer results in an XML format, so you do not have to resort to this technician constantly.

Conclusion

We have created, transformed, accepted and checked the correctness of SOAP messages using the Web Services Validation Tool for WSDL and SOAP. This program allows you to accurately identify the problems that most Web service servers are not even able to detect that it may lead to serious consequences in real life. Using this program at the development stage makes it possible to reduce the troubleshooting time during operation.

Hello!

In several articles, I will talk about the possibilities to test with SOAPUI, as 1c web services work. I will also give examples of return from 1C documents in pDF format and complex XML files. Some things are similar to that, however, I will consider more complex examples of working with web services. But first for starting, I will consider the process of running web services and work with SOAPUI to make it easier to understand their functioning from scratch.

1. Simple web service

To begin with, take a frame configuration without web services and go through the steps to create them.

Add a new web service named Test1 and create a Hello operation in it with a returned String type. Web service names and operations are better to always set in Latin.

You also need to specify the URI namespace and the name of the publication file:

When you press the magnifier in the "Procedure Name field" field, the web service module will be opened and you can implement the Hello function.

HELLO () function Return "Row from 1C web service"; Endfunction

2. Publication of web service.

Now that the resulting function is available on HTTP, you need to publish our service on the web server. Apache 2.2 is suitable for this. I read the article on how to configure the work with IIS and it seemed to me much more difficult. After installing and running Apache 2.2, you need to go to the Administration menu - publish on a web server. The "Catalog" field must be filled and contain the Apache setting. Remember the "Name" and "address" of the web service, they will be useful to us in the next step.

3. Testing with SOAPUI

To test, create a separate WSUSER user, with a simple password and give it full rights.

After that, install and run SOAPUI. This program is very convenient for testing web services, it can receive their description and make post-requests to services.

Go to the File - New Soap Project menu, asks the name of the HELLOTEST project, and in the Initial WSDL field, we write this link:

http: //localhost/test_ws/ws/test1.1cws? WSDL

In it, the part "test_ws" was set on the last stage in the "Name" field and Test1.1CWS in the "Address" field.

Click OK and at this stage will need to be logged in by entering the test user of the WSUSER. A project and two elements of binding will be created.

SOAP12Binding is characterized by working on new version SOAP 1.2 standard. Let's open the Request1 element in the test1soap12binding and see this:

SOAPUI shows which XML will be transmitted to our function. Before starting the test, there is another nuance, the default SOAPUI will require authorization for each separate Request element. Therefore, in order not to specify it every time you need to click on the right mouse button on TestSoap12Binding, select Show Interface View and in the window that opens on the "Service Endpoint" tab of the web service name and password:

If this is not done, then for each Request you will need to set authorization, in the bottom panel by the Auth button.

Now you can finally perform the request to the Hello function and see the answer:

Great, everything worked!

4. Transfer simple parameters to the function.

Now do new feature With parameters, for example, check the work with the dates, we will make the GETSAEDOCNUMBERSBYDATE function, which will receive a document date (expenditure invoice) and return document numbers for this date string. Add a Date parameter to operation with DateTime type:

the code is:

GETSAEDOCNUMBERSBYDATE (DATE) function // DATAnent \u003d start (DATE); DATEONTON (DATE); Evalidocuments \u003d Documents. Departure. Clear (Data Point, Datchetone); numbers \u003d ""; While the sedocuments. Next () Number Cycle \u003d Numbers + "No." + Precision Course. Maker + ";"; EndCycle; Return number; Endfunction

Now in SOAPUI right-click you need to click on the testsoap12binding item and select Update Definition. After that, the project will appear the GETSAuedOCNUMBYDATE function and the ready-made request to it. To fill the date you need to use the "yyyy-mm-ddthh: mm: ss" format (you can see on w3schools and highly recommend using this site to understand the work with XML)

Then it will turn out such request and answer:

5. XDTO packages

If you need to transmit more complex parameters to the function (for example, XML with multiple fields), or to receive complex XML in response, then we can not do without XDTO packages.

Working with XDTO is considered in the cycle of articles. In fact, the package determines the structure and type of fields used by XML files.

I will consider an example of transferring and receiving an XML file, the type of which is defined in the package

As well as in the following articles, I will consider examples:

  • transfer to 1C XML file not described in the package in Base64 format
  • getting out 1C. pDF document In Base64 format and its decoding
  • obtaining from 1C XML file with an embedded structure of elements and determining their quantity

6. Transmission to 1C in the XML file parameter, the type of which is defined in the package.

The task will be this: to find a document of the expenditure invoice for the number specified in the incoming XML and the date and return the document found. You also need to return in the form of an XML with a number, date, counterparty and its code and tabular part goods.

Create Packet1 packet with packet1_ns namespace. For an incoming XML file, we define the type of IndoCsaleQuery object with the Number field of the String type and the DateTime type Date field. For the output file, we will define the type first for one line of the table part of the goods: SaleItem with Name fields type string, Price SUM, Quantity type Decimal. And the SALEDOC document itself will have an integral type: Number, Date, PartnerName fields and the SaleItems field, which will have the type of SaleItem and the maximum number -1. It is such a field indicates that an array of several elements may be present in it. So it looks like this in the configurator:

First show the function code, and then I will explain what happens

The code:

GETSALEDOC (IncomingXML) function of a meter \u003d incomingxml.number; Datades \u003d incomingxml.date; request \u003d new request; Request.Text \u003d "Select | Expendables. Namerenclature. Name as Name, | Expendables. Price, as price, | Expendables. Cooling as Quantity, | Expendables. Summa as SUM, | Expendables. Link | From | Document. Timing | Where | Expenditure products. Link. Maker \u003d & number | and expenses. Link. Data \u003d & datasy "; Request. Installation parameter ("number", disposable); Request. Installing parameter ("Datades", Datades); Sampling \u003d query. Fill (). Select (); If the sample. Racing () \u003d 0 then // Return the error of the tidal flow \u003d FactoryXDTO. Type ("Packet1_ns", "Saladoc"); Packet documentation \u003d FactoryXDTO. Create (sidelines); Packaged flow .Number \u003d "documents not found!"; Refund; Otherwise, we create the types of tidiroculation \u003d FactoryXDTO. Type ("Packet1_ns", "Saladoc"); Tipbabbing \u003d FactoryXDTO. Type ("Packet1_NS", "SaleItem"); Packet documentation \u003d FactoryXDTO. Create (sidelines); // Select from the table part sch \u003d 0; While the sample. The next () cycle if the sch \u003d 0 then // fill the details of the dock document \u003d sample. Link; Packet documentation .Number \u003d dock. Packet documentation.date \u003d dock; Packet documentation .partnername \u003d line (dock. Kontragent); ended; // Fill table part Packaging \u003d FactoryXDTO. Create (Tableful); Filling out (bargaining, sample); // add it to the packet document document .sale.SaleItems. Addly (bargaining); sch \u003d sch + 1; EndCycle; Refund; ended; Endfunction

Here are two main nuances. The first: Since the type of incoming IncomingXML parameter was specified and it was described this type in the package, it is immediately possible to contact the fields of this incoming XML. Second: work with the XDTO factory. From it, a type was obtained for the resulting output parameters and created the value of this type, which was filled with the necessary fields. It is also worth noting that in the SALEDOC type you should enter a separate error field, but for the error test objects will be recorded in the Number field.

Here is what the result of this request in SOAPUI looks like:

As you can see, everything works, but still there is something to improve - for example, I would like to know how many saleitems elements in our document.

About this and about more complex examples, I will tell you in the next article.

In the attached archive - unloading information base And the project SOAPUI.

SOAP (Simple Object Access Protocol) It is a standardized messaging protocol between the client and the server. It is usually used in conjunction with HTTP (S), but can also work with other application-level protocols (for example, SMTP and FTP).
SOAP testing from the point of view of testing techniques is not fundamentally different from working with other APIs, but it requires preliminary preparation (in terms of protocol theory) and special testing tools. In this article, I would like to formulate a small check list of the necessary knowledge and skills, which will be equally useful as a SOAP tester (often not representing, "for what is enough" after the task is set), and the manager forced to evaluate the knowledge of testers and develop plans for learning.

Theoretical base

The fact that SOAP is a protocol is of great importance for testing: you need to explore the protocol itself, "primary" standards and protocols on which it is based, as well as (as necessary) existing extensions.

Xml
XML is a markup language similar to HTML. Any message sent / received via SOAP is an XML document in which data is conveniently structured and easily readable, for example:



Julia
Natasha
Reminder
Do not forget to write an article!


In more detail about XML, you can learn on W3Schools or CodeNet (in Russian). Be sure to pay attention to the description of the Namespaces (conflict resolution method when describing items in XML) - in SOAP, their use is necessary.

Xsd.
When working is always convenient to have a standardized description of possible XML documents and check them on the correctness of filling. To do this, there is an XML Schema Definition (or abbreviated XSD). The two main features of XSD for a tester is a description of data types and imposing restrictions on possible values. For example, an element from the previous example can be done optional to fill and limit its size 255 characters using XSD:

...







...

Expansion SOAP.
In your work, you can also meet various "extensions" SOAP - WS- * standards. One of the most common is WS-Security allows you to work with encryption and electronic signatures. Often, the WS-Policy is used with it, with which you can manage the rights to use your service.

Example of using WS-Security:


Alice.
6S3P2EWNP3LQF + 9VC3EMNOT57OQ \u003d
YF6J8V / CAQI + 1NRSGLRBUZHI
2008-04-28T10: 02: 11Z

All these extensions are quite complex designs used far from each SOAP service; Their detailed study at the initial stage of exploring SOAP testing is unlikely to be relevant.

Instruments

As you already understood, SOAP is a serious thing, to work with him you need to know theory and numerous standards. In practice, such complexity would lead to very tangible labor costs (for example, it would be necessary to watch the scheme in the notebook every time and send the requests of the CURL). Therefore, tools facilitating work with SOAP were created.

XML / XSD editors
A good tester starts testing at the stage of writing documentation, so it is convenient to use special editors to check the schemes. Two most famous - OXYGEN (cross-platform) and Altova (Windows only); Both are paid. These are very powerful programs that are actively using analysts when describing services.

Three features were useful in my practice: XSD visualization, XSD-based XSD generation and XML validation by XSD.

1. Visualization XSD. We need for a visual presentation of the scheme that allows you to quickly identify the mandatory elements and attributes, as well as the existing limitations. For example, the TEXT element is required to request the checkTextRequest, and optional - all three attributes (at the same time the options attribute sets the default value - zero).

Visualization is necessary when the types and restrictions in the scheme are many. If you need only she, and you do not want to pay for special editors, you can consider free alternatives (for example, Jdeveloper).

2. XML generation based on XSD Useful when you want to see the correct example of the message. I use it in order to quickly experiment with the possible fill in the message and check the nuances of the restrictions.

3. After using features from paragraph 2, it is useful to hold xML Validation by XSD - That is, check the message to correctness. Together, features 2 and 3 make it possible to catch cunning defects in XSD even when the service itself is in development.

Testing Tool - SOAPUI

SOAP testing almost always implies the use of SOAPUI. You can read about the use of this tool in different sources (), but it will be more effective to get acquainted with the official documentation. I highlight 8 conditional levels of SOAPUI:

Level 1 - I can send requests
Learn to create a WSDL-based project. SOAPUI can generate all the necessary requests for you; You will only have to check the correctness of their fill and press the "Send" button. After working out the skills of creating correct requests, you must master the art of forming incorrect requests that cause errors.

Level 2 - I can do Test Suites and Test Cases
Start making mini-carotes. Test kits and test cases allow you to create API testing scenarios, prepare data for queries and automatically check the resulting response to the expected. At first, they can be used simply as a collection of requests. For example, if you started a defect and want to quickly check it after fixing, you can select a separate test kit specifically for requests-defects.

Level 3 - I can write assertions
After the test case, you will be useful for you to learn how to make them automatically checked. After that, you will no longer need to look for "eyes" information about the response: if you have an automatic check, the cases will be marked with green (if the check is passed) or red (if not passed). SOAPUI provides a large set of possible checks (assertions), but the most convenient and simple is Contains and Not Contains. With their help, you can check the fact of the availability of a specific text in the received response. These checks also support the search with regular expressions.

Level 4 - I use XPath and / or XQuery in AsSertions
For those who are a little familiar with UI with Selenium, XPath language is a familiar thing. Roughly speaking, XPath allows you to search for elements in an XML document. XQuery - similar technology that can use XPath inside itself; This language is much more powerful, it resembles SQL. Both of these languages \u200b\u200bcan be used in assertions. Checks with their help are more targeted and stable, so your cases will enjoy great confidence.

Level 5 - I can write complex tests with special steps

In test cases, not only one request may be contained, but also several (for example, when you want to emulate the standard scenario of the work of the user "Create the Essence" → "Export the Entity"). There may be other special steps between requests, for example:

  • Properties and Property Transfer (help to re-use data and transmit them between requests);
  • JDBC Request (used to receive data from the database);
  • CONDITIONAL GOTO (allows you to make branching or cycles in the test case);
  • RUN TESTCASE (helps to make some kind of typical queries in separate test cases and cause them where necessary).

Level 6 - I use scripts on Groovy

SOAPUI allows you to write scripts on Groovy in various places. The simplest case is the generation of data at the request itself using the $ (\u003d) inserts. I constantly use such inserts:

  • $ (\u003d new date (). Format ("Yyyy-Mm-Dd't'hh: MM: SS")) - for insertion current date and time in the required format;
  • $ (\u003d java.util.uuid.randomuuid ()) - To insert the correctly formed random GUID.

Full-fledged scripts can be used as steps in cases and checks. At some point you will find that several special steps from the fifth level can be replaced with one script.

Level 7 - I use MockServices
SOAPUI based WSDL can generate MOCK objects. MOCK-object is the simplest simulation of the service. With the help of "Mok" you can start writing and debugging test cases even before the service is actually available for testing. You can also use them as "plugs" for temporarily inaccessible services.

Level 8 - God SOAPUI
You know the difference between the paid and free versions of SOAPUI and use the SOAPUI API in the code. You use plugins and run the execution of cases through the command line and / or Ci. Your test cases are simple and easily supported. In general, you "ate a dog" on this tool. I would gladly talk with those who have mastered SOAPUI at such a level. If you are such - write off in the comments!

Testing using programming languages

I will give an example of how the request to the YandexSpeller API looks like, made using Groovy-WSLITE:

import wslite.soap. *
Def Client \u003d New SoapClient ("http://speller.yandex.net/services/spellservice?wsdl")
Def Response \u003d Client.send (SOAPACTION: "http://speller.yandex.net/services/spellservice/checktext") (
Body (
CheckTextRequest ("Lang": "RU", "XMLNS": "http://speller.yandex.net/services/spellservice") (
Text ("Oshka")
}
}
}
Assert "Error" \u003d\u003d Response.CheckTextResponse.SpellResult.error.s.Text ()
ASSERT "1" \u003d\u003d [Email Protected]()

As far as I know, high-level frameworks (by the REST-Assured type) for testing SOAP does not exist, but the interesting tool has recently appeared - Karate. With it, you can describe cases for testing SOAP and REST in the form of SCCUMBER / GHERKIN scenarios. For many testers, the karate appeal will be the perfect solution, because such scenarios for the complexity of writing and supporting cases will lie somewhere in the middle between using SOAPUI and writing their own framework for SOAP testing.

Conclusion

It is unlikely that you ever want to test SOAP simply for yourself (as it could happen with the REST-Ohm). This is a serious protocol that is used in serious corporate solutions. But his heavyweight is simultaneously a gift tester: All the technologies used are standardized, there are high-quality tools for work. From the tester requires only the desire to study and use them.

Let's bring together the same check list of the necessary skills for the tester. So, if you just start testing SOAP services, you need to know and be able to use:

  • WSDL.
  • SOAP.
  • XML / XSD editors (at XSD visualization level).
  • SOAPUI at level 1.

As you can see, the main emphasis is to study standards, in Soapui it is enough just to be able to perform requests. As I dive into testing SOAP, you will have tasks that will require more serious skills and knowledge, but do not try to study everything and immediately. It is much more important than the sequence in increasing the level of complexity of the tasks. Following this recommendation, at one point you will understand that they have become a good specialist in this area!

Web services in 1c

This article will consider the issues of integration of 1C with already existing web services and the use of 1C itself as a web service.

At the same time, under the web services will be understood to be system running on the Internet and ensuring interaction with them not only by SOAP (which is precisely the web service), but also in other ways, including ordinary HTTP (S)--records.


The risks of using Web services 1C

The 1C81 platform appeared the implementation of web services.

But their use is fraught with risks:

  1. 1C8 does not work well through HTTPS, there are no diagnostic tools, so it's impossible to understand if the service does not want to work through HTTPs sometimes it is impossible. Exit - Implementing web services through CURL or HTTPS tunnel raising.
  2. 1C8 adheres to its WSDL-scheme validation rules. Sometimes for inexplicably reasons WSDL scheme does not want to be loaded into the WS link. You can only learn the cause on a partner forum from one specialist. There are no WSDL diagnostic tools, even the cause or string is not specified on which the diagram load is interrupted.

Rules for building services for the sale

The client is issued a paper on sale (check) only if the transaction for the service has been successful. Otherwise, the situation is possible when the client receives a check and will be in confidence that he received a service, and in fact it is not.

Using external SOAP services

SOAP Web services use WSDL schemas and XDTO objects to represent data.

Download WSDL

In order to use the external service, you need to download it WSDL scheme.

WSDL-scheme validity check

Sometimes the WSDL scheme is not loaded in 1C. You can check the validity (correctness) of the circuit with any WSDL validator, for example http://www.validwsdl.com/.

You need to download a scheme to any HTTP site (you can via FTP) and specify the address of the file in which the scheme is loaded:

Features of download WSDL in 1C

The WSDL load feature in 1c is that valid schemes may not be loaded. There is no built-in validator, so you have to look for an error by destructive analysis, sequentially reducing the number of items in the scheme. You can, for example, delete a description of the web service.

Processing for testing a working external web service

To test the working external web service, use the processing "TestProlnogservice.epf" from the package to this article.

Testing can be used on the example of the Morpher service, inclined names (the address of the service http://www.morpher.ru/webservices/morpher.asmx?wsdl):

In this way, you can test any service that has simple entry points containing simple type parameters: number, date, string.

In processing, you can also specify the login and password that are required to authorize access to the web service.

Standard Services Debugging Means

You can use the SOAPUI program to debug, which can send an arbitrary web service request and get an answer from it.

SOAP and https

Unfortunately, SOAP in 1s sufficiently capriciously behaves when working through the HTTPS protocol, the practice shows that it is impossible to achieve HTTPS connections, although the possibility and is extended in the platform. It affects the lack of diagnostic and debugging tools to determine the reasons, due to which the connection is not established. Therefore, it is convenient to use SOAP through CURL.

The built-in HTTPS use mechanism implies that all certificates must be published in the PEM shared file in the 1C program directory.

Use 1C as a service

Terms of Development of Service based on 1C

Operation "Hello"

The rule of good tone is the creation of an operation in the service that informs that the service is available. This facilitates the lives of integrators, they will be easier to check whether the connection has been established with the service.

For example, you can use the Hello operation without parameters, which simply returns a boolean value of truth.

Publication of Web Service

The procedure is well described in the documentation: File: /// C: /Program%20Files/1cv81/adddoc/ru/v8adddoc81.htm#_toc176167634:

The task of publishing Web services is reduced to hosting configuration files * .1CWS Web services in the appropriate web server directory with appropriate settings for web server. In order to execute the publishing of Web services, you must execute the menu command "Administration | Publication of Web services. "

As a result of the execution of this command, the publication window will be open.

The publishing window of Web services contains the path to the web server and two list:

  • "Web services" - a list of configuration Web services;
  • "Publication" - a list of Web services published on the specified web server.

Using the Compound ... button, you must specify the web server that you want to publish Web services.

The path selection window to the web server allows you to specify the path in two ways:

  • on the "Files" tab - this method is used in the case when the publication is performed on the same computer on which the web server is installed. As a way, the local directory is specified, which corresponds to the Internet page with which the published Web server will be called;
  • on the FTP Site tab, this method is used when you want to publish a Web service on a remote computer. To perform the publication, you must specify the parameters of the FTP connection with remote computer and a directory in which Web service will be published.

Publishing the selected Web service is carried out using the "Publish" button

To cancel the publishing of the Web service, use the Delete button.

You can publish in the local directory or on FTP. You can publish on the remote server on the UNC path if the remote server enters the local network.

After publishing a web service is available at "http: //localhost/test.1cws" or "http://xxx.ru/test.1cws", where xxx.ru - address remote Server And Localhost is the standard address of the local server.

Authorization to Web Service 1c

To access the service you need to pass authentication.

Authorization issues are well reviewed here: http://www.forum.mista.ru/topic.php?id\u003d341168 and in the File documentation: //// /Program%20Files/1cv81/adddoc/en/v8adddoc81.htm

Usually, the web service works under one particular user (more often - specially created). You can use the user 1C "Attach" to the Windows authentication to the Windows IUSR_ user (for the user to disable 1C authorization). Alternatively, you can clear the list of users 1C, then authorization is not required.

If several users are required, you can create multiple logins for a web server, to bind each of them. windows User. And accordingly, to register in 1C access to Windows users.

In the properties, the user and password of the WS object is used not login 1C, but the user login is a web server.

Testing Web Service 1C

For testing 1C as a web service, use the TestPrompheep processing processing .EPF, as described in the "Testing External Web Service" section.

1CWS file and is a WSDL description of the 1C web service.

Use of Retail Services

Usually in retail Services are used to provide various services to the population - receiving payments, repayment of loans, money transfers, purchase software etc.

At the same time, for the service provided in 1C, a check is formed in which the transaction parameters are saved. After that, this check is printed by the client with detailed information about the service provided. A preliminary check is possible, so that the client confirms the data introduced from his words by his signature.

The service can be integrated differently in a retail program written in 1C (UT, Retail and Other):

  1. Processing or code in 1C language can be written, which performs all the work with the service.
  2. A program that works with the service can be used, and in 1C transmits only information for puncturing checks.

Organization of service data in 1C

To store information about the transaction in the check, it is necessary to create an additional tabular part "Sophisticated sales" with details:

  • Nomenclature - binding to check nomenclature.
  • The parameter is the link to the "Sophisticated Sale: Parameters" directory.
  • The value is the value of the parameter, composite type. The string view must be quite long (1024 characters) to be placed the text of the check.

Handbook "Sophisticated sales: Parameters" contains a list of transaction parameters.

Table part it is more profitable to use than a set of details, because There can be a lot of them at the transaction, and in other checks that are not related to the service, these details will not be used, and will take an excess place. In addition, such a decision is universally for any service and does not require the restructuring of data after the introduction of a new service.

The seller is made a separate tab (or printed form not to change the configuration) in which it can see the sign of the transaction details for the check.

Using Treatments in Language 1C

Consider the example of the PAYM conditional service for the "Retail" configuration.

  1. We start in 1C predefined element of the directory of the "PAYM" nomenclature. In 1C mode: Enterprises After updating the configuration, it needs to be assigned the type of product "Service".
  2. In the procedure "Add a nomenclature to tab. Part "Module" Sales Registration "module We call the processing of working with the service written in Language 1C. In case of successful payment, we write and conduct a check:
If (nomenclature \u003d reference books. Substitution.paym) and (enumeration of enumeration. VidaraticsChkkm. Invidence) Then processing pay \u003d functions. Double-circulation ("paym"); Formamplate \u003d processing. Forecorm (); Result \u003d Formamplage. OpenModally (); If the result \u003d is uncertain then return; Ended; This account. To recruit (registering); Ended;
  1. Processing should print orders (if required), fill out a table part of complex sales and prepare the text of the check of the check in the predefined props of "PayMtext."
  2. In the procedure "Conduct and print a check", the check module replacing the name of the goods to the stored in the requisition for the check. The text is replaced only for sale, just the name of the service is printed to return, as usual.
Inspecified the viewing of the listing. Vidoyeratovschekkm. Invoice and sampling. The settlement of solka \u003d reference books. Substratus If the string-sized suggestion is indefinitely the product. Renance \u003d SOCRLP (string-holder sales. Ended;

A separate question is how to ensure the completion of the transaction. Those. If the transaction has passed in the service, how to make it not lost in 1C. The most optimal path is reconciled by the registers. But this is a subject of separate consideration.

Use of programs integrable from 1C

Xdto.

Often XDTO is used in web services. We give the most important tips and recipes on the use of XDTO in 1C.

XDTO in 1c platform

The XDTO packets described in the configuration "XDTO objects" branch are available to create types and objects in the global factory XDTO factory. It does not immediately become apparent.

Some types in the scheme do not have a name to get them, you need to go through the types of hierarchy.

The example described the SYSTE list containing XDTO structures. To create the structure itself, it was necessary to get its type such here:

Type \u003d Factory.Type ("URN: My.R.R.: MasterData: Business", "Business"). Properties. Pour ("System"). Type;

Frequent problems with xDTO

Different XSD schema formats

In some formats, tags are called XS:, in some XSD:, but 1C fully understands both formats. One day there was a situation that XSD was normal without errors imported in 1C, but did not create a single package. The reason was in the absence of an attribute targetnamespace. The tag, respectively, did not know 1c, in which package to place the scheme, but did not give mistakes.

Support service

Given that the service is a combination of two systems - 1C and external, errors can be in both systems, which reduces the overall reliability of work.

In order to easier to understand the reasons for failures in the operation of services, it is recommended to use a set of measures.

Logging requests

Links

  • Xdto.
    • Good description XDTO http://pro1c.org.ua/index.php?showtopic\u003d214
  • Free Interesting Web Services:
    • Aeroflot - information about the schedule of aircraft
    • Morfer - the declination of the names http://www.morpher.ru/webservices/morpher.aspx
  • Untered:
    • Installation and Use of Web Services
      • v8: How to change the configuration file of Apaches?
      • v8: Continuing the topic with Web services - I can not connect Web service
      • v8: On the use of web services - I can not create a proxy ...
      • Knowledge Book: V8: Using External Web Services in 1C: Enterprise 8;

Nowadays, a rarely modern application costs without API. This is fair both for a simple site and for high-loaded distributed systems. Testing API - is one of the main tasks in the quality assurance process. It is not surprising that the demand for testers who can test the API rises from day to day. At this course, you will receive an understanding of the methods, tools and approaches in the API Testing, will acquire the necessary knowledge, which will undoubtedly be reflected in your value as a specialist in testing.

This course will be useful to students familiar with the basics of testing the software that want to grow further and increase their skills.

Course program:

Lesson 1. Input. SOAP protocol

  • Briefly about the lecturer;
  • Goal of the course;
  • What is API, WS and why are they needed;
  • The role of the API testing in the quality assurance process;
  • Overview of WS testing tools;
  • Techniques used in WS testing;
  • The history of the emergence of SOAP;
  • Terminology and main concepts (XML, XSD, ENDPOINT, WSDL).

Lesson 2: SOAP protocol. Architecture Rest.

  • Terminology and main concepts (UDDI, XSLT, XPath, XQuery, HTTP Methods, HTTP Statuses);
  • Structure and main components of SOAP;
  • Scope of application;
  • Features of work;
  • Advantages and disadvantages;
  • Features REST architecture;
  • Terminology and main concepts (WADL, RESTful, JSON, JSONPATH);
  • REST principles;
  • Status code and major statuses;
  • CRUD verbs;
  • Advantages and disadvantages.

Lesson 3. Acquaintance with SOAPUI. Work with the REST project

  • Java installation;
  • Installing SOAPUI;
  • Overview of the main elements of the interface;
  • Connecting a training project;
  • Review of project methods;
  • Sending a request and analysis of the response received;
  • Study of available project web services;
  • Drawing up a testing plan;
  • Writing test cases;
  • Elements "TestSuite", "TestCase", "TestSteps".

Lesson 4. Working with REST Project (XML)

  • Block "assertions";
  • Launch tests at different levels;
  • Element "Properties", the main features;
  • Work with Properties;
  • Element "Property Transfer";
  • Working with AsSertions.

Lesson 5. Working with REST Project (JSON)

  • Conditions and branches;
  • Working with AsSertions;
  • Testrunner, work features;
  • Run TS, TC from the command line;
  • Work with Test Runner;
  • Work with Groovy scripts.

Lesson 6. Work with Groovy scripts

  • Work with static and dynamic data;
  • We generate test data;
  • We receive data from "Properties";
  • Record and transfer data;
  • Conditions and branches;
  • Script assertion.

Lesson 7. Additional features

  • Connecting external libraries and custom classes;
  • MOCK services;
  • Why do MOCK services need;
  • Sample working with mock service;
  • But what about CI?
  • Install Jenkins;
  • Starting a project on jenkins.


Did you like the article? Share it