Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 63 Insurance
- 535.7K On-Premises Infrastructure
- 138.1K Analytics Software
- 38.6K Application Development Software
- 5.6K Cloud Platform
- 109.3K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71K Infrastructure Software
- 105.2K Integration
- 41.5K Security Software
REST org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.

Hello!
I use SOA Suite 11g.
1. Composite has component
<component name="ClientPrepare" version="2.0">
<implementation.bpel src="ClientPrepare.bpel"/>
<property name="bpel.config.oneWayDeliveryPolicy" type="xs:string"
many="false">async.persist</property>
</component>
and reference (rest service, get method)
<reference name="PrepareService"
ui:wsdlLocation="PrepareService.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/http/ClientPrepare/PrepareService#wsdl.interface(ClientPrepare_ptt)"/>
<binding.ws port="ns#wsdl.endpoint(srv/prt)"
location="PrepareService.wsdl" supports="http">
<property name="http.verb" type="xs:string" many="false">GET</property>
<property name="endpointURI" type="xs:string" many="false">"<some url>"</property>
<property name="http.payload" type="xs:string" many="false">url-encoded</property>
<property name="oracle.webservices.http.invocation" type="xs:string" many="false">false</property>
</binding.ws>
</reference>
2. When component invokes rest service, it receives success http 200, but component process has fault
Unable to invoke endpoint URI "<some url>" successfully due to: javax.xml.soap.SOAPException: Unable to read response: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.
3. Rest Service receives http header only, without content:
HTTP/1.1 200 OK
Date: Tue, 14 Jan 2020 09:03:24 GMT
rlog_pk: 10005254841979
Content-Type: text/html;charset=windows-1251
Content-Language: en
Connection: Keep-Alive
Keep-Alive: timeout=5, max=999
Server: Oracle-Fusion-Middleware/11g (11.1.1.9) Apache-Coyote/1.1 Oracle-Web-Cache-11g/11.1.1.9.0 (N;ecid=733173134358256,0:1)
Content-Length: 0
4. Rest Service response is:
<html><head></head><body></body></html>
Could you please tell me, what should I do for solving?
Best Answer
-
I added to reference in composite.xml follow property
<property name="oracle.soa.two.way.ssl.enabled" type="xs:boolean" many="false" override="may">true</property>
<reference name="PrepareService"
ui:wsdlLocation="PrepareService.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/http/ClientPrepare/PrepareService#wsdl.interface(ClientPrepare_ptt)"/>
<binding.ws port="ns#wsdl.endpoint(srv/prt)"
location="PrepareService.wsdl" supports="http">
<property name="http.verb" type="xs:string" many="false">GET</property>
<property name="endpointURI" type="xs:string" many="false">"<some url>"</property>
<property name="http.payload" type="xs:string" many="false">url-encoded</property>
<property name="oracle.soa.two.way.ssl.enabled" type="xs:boolean" many="false" override="may">true</property>
<property name="oracle.webservices.http.invocation" type="xs:string" many="false">false</property>
</binding.ws>
</reference>
Answers
-
I guess one of the problem is content
Content-Type: text/html
from http header of response. Because process waits xml content.
I guess I should modify wsdl for reference PrepareService with type=text/html , to like that:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="ClientPrepareService"
targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/http/ClientPrepare/ClientPrepare/ClientPrepareService"
xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/http/ClientPrepare/ClientPrepare/ClientPrepareService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msg_in_out="http://ClientPrepareService/http"
xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
<plt:partnerLinkType name="ClientPrepare_plt">
<plt:role name="ClientPrepare_role">
<plt:portType name="tns:ClientPrepare_ptt"/>
</plt:role>
</plt:partnerLinkType>
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://ClientPrepareService/http"
schemaLocation="xsd/ClientPrepareService.xsd"/>
</schema>
</wsdl:types>
<wsdl:message name="req_msg_in">
<wsdl:part name="req" element="msg_in_out:req"/>
</wsdl:message>
<wsdl:message name="res_msg_in">
<wsdl:part name="res" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="ClientPrepare_ptt">
<wsdl:operation name="ClientPrepareOperation">
<wsdl:input message="tns:req_msg_in"/>
<wsdl:output message="tns:res_msg_in"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ClientPrepare_Binding"
type="tns:ClientPrepare_ptt">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ClientPrepareOperation">
<soap:operation soapAction="http://xmlns.oracle.com/pcbpel/adapter/http/ClientPrepare/ClientPrepare/ClientPrepareService/ClientPrepareOperation"
style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<mime:multipartRelated>
<mime:part>
<mime:content part="res" type="text/html"/>
</mime:part>
</mime:multipartRelated>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>
But when I try recreate HTTP Binding Adapter in composite, at 5th step Reply Message Schema is not recognized.
-
I added to reference in composite.xml follow property
<property name="oracle.soa.two.way.ssl.enabled" type="xs:boolean" many="false" override="may">true</property>
<reference name="PrepareService"
ui:wsdlLocation="PrepareService.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/http/ClientPrepare/PrepareService#wsdl.interface(ClientPrepare_ptt)"/>
<binding.ws port="ns#wsdl.endpoint(srv/prt)"
location="PrepareService.wsdl" supports="http">
<property name="http.verb" type="xs:string" many="false">GET</property>
<property name="endpointURI" type="xs:string" many="false">"<some url>"</property>
<property name="http.payload" type="xs:string" many="false">url-encoded</property>
<property name="oracle.soa.two.way.ssl.enabled" type="xs:boolean" many="false" override="may">true</property>
<property name="oracle.webservices.http.invocation" type="xs:string" many="false">false</property>
</binding.ws>
</reference>