fredag, april 27, 2007

Problems Calling .Net Web Services from UTL_DBWS

I've been having some issues with a problem from a customer, the scenario is quite simple; they simply want to call a .Net Web Service from the database using utl_dbws. This should be fairly straightforward, however, this did not work as expected, instead I've been keep getting this error message:

ORA-29532: Java call terminated by uncaught Java exception:
javax.xml.rpc.soap.SOAPFaultException: Server did not recognize the value of HTTP Header SOAPAction: .
ORA-06512: at "SYS.UTL_DBWS", line 387
ORA-06512: at "SYS.UTL_DBWS", line 384


and I could simply not figure out why. So, when I read the utl_dbws api for the 111:th time (give or take a few times...) I found that:

"'SOAPACTION_USE': This boolean property indicates whether or not SOAPAction is to be used. The default value of this property is 'FALSE'."

which certainly corresponds to the error message I've been getting, as it indicates that no SOAPAction is being sent.

So, I simply added these lines:

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


and the request went fine. A few lines that made the difference but took me too long time to find out...

The utl_dbws package is described in:
http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_dbws.htm#sthref13863

The The SOAPAction HTTP Header Field is described in:
http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528


1 kommentar:

  1. Hi, your hint was very helpful to me, but I have another trouble and I wanna know if you can help me. The problem presents when I pass a string that represent an xml document, and this string is very large, this is the exception raised: ERROR - ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'fnEnviarXML'. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 2, position 8981

    SvaraRadera