Forum Stats

  • 3,855,052 Users
  • 2,264,453 Discussions
  • 7,905,879 Comments

Discussions

Problem communication with Web Service

Hello,

today i've got a really illogical error. I will try to explain:

I have got a procedure, which connect with a web service.
The Code of this function is:
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
create or replace procedure opc.P_WCF_WEBSERVICE(pEmpfaenger in varchar2, pData in varchar2) is
service_ sys.utl_dbws.SERVICE;
call_ sys.utl_dbws.CALL;
service_qname sys.utl_dbws.QNAME;
response sys.XMLTYPE; request
sys.XMLTYPE;
begin
service_qname := sys.utl_dbws.to_qname(null, 'WebService_WCF');
service_ := sys.utl_dbws.create_service(service_qname);
call_ := sys.utl_dbws.create_call(service_);

sys.utl_dbws.set_target_endpoint_address(call_, 'http://server:84/Service.asmx');

sys.utl_dbws.set_property( call_, 'SOAPACTION_USE', 'TRUE');
sys.utl_dbws.set_property( call_, 'SOAPACTION_URI', 'http://tempuri.org/SendXMLTOApplication');

request := sys.XMLTYPE('<SendXMLTOApplication xmlns="http://tempuri.org/"><pEmpfaenger>' ||
pEmpfaenger ||'</pEmpfaenger><pXML>' || pData ||'</pXML></SendXMLTOApplication>');
response :=sys. utl_dbws.invoke(call_, request);

--return response.extract('//child::text()', 'xmlns="http://gefdnb048a:4800/WebService-WCF/Service.asmx"').getstringval();
end P_WCF_WEBSERVICE;


OK, if i want use this procedure, I use the following command:
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
begin
OPC.P_WCF_WEBSERVICE('OPC',
'&&lt;MaschineSperren DLL="MaschineSperren.dll" MC="TBM02" Barcode="14154360" /&&gt; '
);
end;

The WebService got the correct XML-String (<MaschineSperren DLL="MaschineSperren.dll" MC="TBM02" Barcode="14154360" /> )

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

if I use the same command in a Trigger (after insert), I've got the following error message in line ( request := sys.XMLTYPE('<S... ) :


ORA-31011: XML parsing
ORA19202: Error occured in XML processing
LPX-00242 invalid use of amersand(") character(use amp;)
......
.....
.....


I thought, I should replace the & with &amp;
If i use it in that way, my WebService got the follwing xml-string:

&&lt;MaschineSperren DLL="MaschineSperren.dll" MC="TBM01" Barcode="14154360" /&&gt;

But i need a XML string!
"&&lt;" will not replaced to "<", if I do it in that way.



The Problem occures only in a Trigger!!!

What should I do - What can be wrong?

I hope, Someone can help me.

Thanks Andi
This discussion has been closed.