You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Doug Schaible <do...@gmail.com> on 2007/05/19 17:53:04 UTC

Sending < or > in SOAP Message

Good Afternoon All,

Thanks to the tcpmon utility that Martin pointed me to I have uncovered the
problem in my code, but I am not sure how to correct it.

I need to send a small piece of XML in the SOAP message, but the <, >, and "
in the XML is getting conveted into &lt;, &quot;, and &gt;.

How can I keep the <, >, and the "s in the data that I send?

Help is greatly appericated.

Thanks,
Doug
*********************************************************
This is my code:
*********************************************************
 XML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Envelope version=\"01.00\"
  xmlns=\"\"><Sender><Id/><Credential/></Sender></Envelope>";

 MessageElement[] loginME = new MessageElement[1];

 LoginSSOXMLData LoginData = new LoginSSOXMLData(loginME);
 LoginResponseLoginResult LoginDataResponse = new
LoginResponseLoginResult();

 ServiceLocator loc = new ServiceLocator();
 loc.setServiceSoapEndpointAddress("
http://127.0.0.1/SSOEnterprise/webservice/sso.asmx");

 loginQname = loc.getServiceName();

 loginME[0] = new MessageElement(loginQname, (Object)XML);

 ServiceSoap port = loc.getServiceSoap();
 LoginDataResponse = port.login(LoginData);




*********************************************************
*********************************************************
This is the SOAP Message that is being created:
*********************************************************
*********************************************************

POST /SSOEnterprise/webservice/sso.asmx HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: 127.0.0.1
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://WebServices.SSO/Login <http://webservices.sso/Login>"
Content-Length: 563

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><Login<http://www.w3.org/2001/XMLSchema-instance%22%3E%3Csoapenv:Body%3E%3CLogin>xmlns="
http://BrassRing.WebServices.SSO/"><SSOXMLData><Service>&lt;?xml<http://brassring.webservices.sso/%22%3E%3CSSOXMLData%3E%3CService%3E&lt;?xml>version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?&gt;&lt;Envelope
version=&quot;01.00&quot;
xmlns=&quot;&quot;&gt;&lt;Sender&gt;&lt;Id/&gt;&lt;Credential/&gt;&lt;/Sender&gt;&lt;/Envelope&gt;</Service></SSOXMLData></Login></soapenv:Body></soapenv:Envelope>



*********************************************************
*********************************************************
I need it to create a SOAP Message like this:
*********************************************************
*********************************************************

POST /SSOEnterprise/webservice/sso.asmx HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: 127.0.0.1
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://WebServices.SSO/Login <http://webservices.sso/Login>"
Content-Length: 563

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><Login<http://www.w3.org/2001/XMLSchema-instance%22%3E%3Csoapenv:Body%3E%3CLogin>xmlns="
http://BrassRing.WebServices.SSO/"><SSOXMLData><Service<http://brassring.webservices.sso/%22%3E%3CSSOXMLData%3E%3CService>
>
<?xml version="1.0" encoding="UTF-8"?>
<Envelope version="01.00" xmlns="">
<Sender>
<Id/>
<Credential/>
</Sender>
</Envelope>
</Service></SSOXMLData></Login></soapenv:Body></soapenv:Envelope>