Power to Build

Home » Misc » Treating XML input parameters of a SOAP request as a string

Treating XML input parameters of a SOAP request as a string

Pomzung's Blog

When I was doing a senior project with my friends before graduating, I faced a lot of problems that had never found in classes. One problem that I feel like we had no way to solve it is about an XML input parameter of SOAP request. Why? The structure of SOAP request is an XML document as the figure below. As such, when it’s being sent to desired web service, they will treat the SOAP request as an XML via the XML parser to extract the parameter for further uses inside the web services.

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
     <SendCustomer xmlns="http://namespace">
       <customer_information>
	       <?xml version="1.0" encoding="utf-8" ?>
		     <customer>
				<id_card>123</id_card>
				<fname>abc</fname>
	         </customer>
	  </customer_information>
     </SendCustomer>
  </soap:Body>
</soap:Envelope>

It would be no problem, If the parameter inside, which is

<?xml version="1.0" encoding="utf-8" ?>
  <customer>
    <id_card>123</id_card>
    <fname>abc</fname>
  </customer>

of this SOAP request, is just an ordinary “string”. The problem is coming…

View original post 180 more words


Comments, please?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: