WCF request with utl_dbws how to add Header into SOAP envelope
Indrek TMay 13 2010 — edited May 14 2010I’m trying to make WCF (Windows Communication Foundation) request and using for that utl_dbws package.
After making request (calling utl_dbws.invoke) it will give error “ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect t”
I turned on logging (utl_dbws.set_logger_level) I see that system sends standard SOAP envelope and does not have Header at all. How can I use my own SOAP envelope and/or add Header.
All info that logging give is:
ServiceFacotory: oracle.j2ee.ws.client.ServiceFactoryImpl@eec8c59c
WSDL: null
Service: oracle.j2ee.ws.client.BasicService@7c110d23
*** Created service: -677524827 - oracle.jpub.runtime.dbws.DbwsProxy$ServiceProxy@562bd0c4 ***
ServiceProxy.get(-677524827) = oracle.jpub.runtime.dbws.DbwsProxy$ServiceProxy@562bd0c4
getOperationInfo return NULL: port={http://tempuri.org/Service/}BasicHttpBinding_Service, operation={http://tempuri.org/Service/}GetLov
setProperty(javax.xml.rpc.soap.http.soapaction.use, true)
setProperty(javax.xml.rpc.soap.http.soapaction.uri, http://tempuri.org/Service/GetLov)
setProperty(javax.xml.rpc.encodingstyle.namespace.uri, http://www.w3.org/2005/08/addressing)
setProperty(javax.xml.rpc.security.auth.username, DefaultUser)
setProperty(javax.xml.rpc.security.auth.password, MySecretPassword)
<GetLOV xmlns="http://tempuri.org/"> <request xmlns:d4p1="http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <d4p1:AgentCode>AGENT</d4p1:AgentCode> <d4p1:Language>ENG</d4p1:Language> <d4p1:ProcessName>test</d4p1:ProcessName> </request></GetLOV>
Attribute 0: http://tempuri.org/: xmlns, http://tempuri.org/
createElement(GetLOV,null,http://tempuri.org/)
Attribute 0: http://tempuri.org/: xmlns, http://tempuri.org/
dbwsproxy.element.node.child.0: 1, null
dbwsproxy.add.map: d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
Attribute 0: http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request: xmlns:d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
dbwsproxy.add.map: i, http://www.w3.org/2001/XMLSchema-instance
Attribute 1: http://www.w3.org/2001/XMLSchema-instance: xmlns:i, http://www.w3.org/2001/XMLSchema-instance
createElement(request,null,http://tempuri.org/)
dbwsproxy.add.soap.element.namespace: d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
Attribute 0: http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request: xmlns:d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
dbwsproxy.add.soap.element.namespace: i, http://www.w3.org/2001/XMLSchema-instance
Attribute 1: http://www.w3.org/2001/XMLSchema-instance: xmlns:i, http://www.w3.org/2001/XMLSchema-instance
dbwsproxy.element.node.child.0: 1, null
dbwsproxy.lookup.map: d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
createElement(d4p1:AgentCode,null,http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request)
dbwsproxy.text.node.child.0: 3, E01306
dbwsproxy.element.node.child.1: 1, null
dbwsproxy.lookup.map: d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
createElement(d4p1:Language,null,http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request)
dbwsproxy.text.node.child.0: 3, ENG
dbwsproxy.element.node.child.2: 1, null
dbwsproxy.lookup.map: d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
createElement(d4p1:ProcessName,null,http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request)
dbwsproxy.text.node.child.0: 3, tesr
request:
<GetLOV xmlns="http://tempuri.org/">
<request xmlns:d4p1="http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
<d4p1:AgentCode>AGENT</d4p1:AgentCode>
<d4p1:Language>ENG</d4p1:Language>
<d4p1:ProcessName>test</d4p1:ProcessName>
</request>
</GetLOV>
13.05.2010 14:17:28 oracle.j2ee.ws.client.ClientMessages infoAboutToInvokeCallForEndpoint
INFO: Trying to connect to URL: https://x.y.z/WS/ Service.svc
13.05.2010 14:17:30 oracle.j2ee.ws.client.StreamingSender _sendImpl
FINE: StreamingSender.request:<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body><GetLOV xmlns="http://tempuri.org/"><request xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d4p1="http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request"><d4p1:AgentCode>AGENT</d4p1:AgentCode><d4p1:Language>ENG</d4p1:Language><d4p1:ProcessName>test</d4p1:ProcessName></request></GetLOV></env:Body></env:Envelope>
13.05.2010 14:17:30 oracle.j2ee.ws.client.StreamingSender _sendImpl
FINE: StreamingSender.response:<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode><faultstring xml:lang="et-EE">The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.</faultstring></s:Fault></s:Body></s:Envelope>
Exception in thread "Root Thread" javax.xml.rpc.soap.SOAPFaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.
at oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java:559)
at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java)
at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:112)
at oracle.j2ee.ws.client.dii.CallInvokerImpl.directInvoke(CallInvokerImpl.java:705)
at oracle.j2ee.ws.client.dii.BasicCall.directInvoke(BasicCall.java:692)
at oracle.j2ee.ws.client.dii.BasicCall.invoke(BasicCall.java:598)
at oracle.jpub.runtime.dbws.DbwsProxy$CallProxy.invokeProxy(Unknown Source)
at oracle.jpub.runtime.dbws.DbwsProxy$CallProxy.access$2600(Unknown Source)
at oracle.jpub.runtime.dbws.DbwsProxy.invokeProxy(Unknown Source)