Using Namespaces in XML Schema and WSDL

xiaoxiao2021-03-06  38

For namespace, people who understand OO thinking should be relatively simple, especially those who have learned C .

So; but a lot of friends from the previous article, in the communication with my communication, it seems that it is not very clear about the namespace,

Let's talk about how to use the namespace in XML Schema and WSDL.

Let's take a look at a java code: package com.hongsoft.test.pkg1; import com.hongsoft.test.pkg2.test1; import com.hongsoft.test.pkg2.test2; in this file, we take com.hongsoft.test .pkg2.test1 and

com.hongsoft.test.pkg2.test2 called source class, referring to this class as a target class,

Other classes under com.hongsoft.test.pkg1 are called the default class.

Then we look at the use of a namespace in XML Schema: Here, we put XMLns: ACC = 'http: //www.samplestore .com / account 'and XMLns: part =' http://www.partnerStore.com/partscatalog 'is called source namespace,

Targetnamespace = 'http://www.samplestore.com/account' is called the target namespace,

XMLns = 'http://www.w3.org/1999/xmlschema' is called the default namespace (we didn't name it). Smart, you have roughly know what the namespace is Dongdong?

Schema has been defined in the default namespace XMLns = 'http://www.w3.org/1999/xmlschema',

In this case, there is no need to indicate what the namespace should be specified in front; this, and we can in the previous Java code

Like other classes of this package directly, in general, define XML Schema, default

Namespaces are XMLns = 'http://www.w3.org/1999/xmlschema'; of course, there is no provision

such.

Ok, then we look at how to use the name space in WSDL: Three must declared external namespaces are WSDL, SOAP and XMLSChemaxmlns =" ​​http://schemas.xmlsoap.org/wsdl/ "is WSDL default namespace XMLns: SOAP = "http://schemas.xmlsoap.org/wsdl/SOAP/" is the SOAP namespace, here we use BPEL4WS, so you don't need this namespace XMLns: XSD = "http://www.w3.org / 2001 / xmlschema "is the XMLSchema name space

Smart you, I have known how to use the namespace in XML Schema and WSDL?

转载请注明原文地址:https://www.9cbs.com/read-119399.html

New Post(0)